作者 何书鹏
1 个管道 的构建 通过 耗费 1 秒

合并分支 'heshupeng' 到 'master'

轮播图片地址cdn



查看合并请求 !52
... ... @@ -45,10 +45,9 @@ class House extends Api
*/
public function banner()
{
$qiniu = get_addon_config('qiniu')['cdnurl'];
$data = Db::name('banner')->field('updatetime',true)->order('createtime desc')->select();
foreach ($data as &$v){
$v['image'] = $qiniu.$v['image'];
$v['image'] = cdnurl($v['image'],true);
$v['createtime'] = date('Y-m-d H:i:s',$v['createtime']);
}
$this->success('success',$data);
... ...
... ... @@ -136,10 +136,9 @@ class HouseBoard extends Api
*/
public function banner()
{
$qiniu = get_addon_config('qiniu')['cdnurl'];
$data = Db::name('advertising')->field('updatetime',true)->order('createtime desc')->select();
foreach ($data as &$v){
$v['image'] = $qiniu.$v['image'];
$v['image'] = cdnurl($v['image'],true);
$v['createtime'] = date('Y-m-d H:i:s',$v['createtime']);
}
$this->success('success',$data);
... ...
... ... @@ -75,11 +75,62 @@ class User extends Api
}
/**
* 会员中心
* @ApiTitle (个人中心-首页)
* @ApiSummary (个人中心-首页)
* @ApiMethod (POST)
* @ApiRoute (/api/user/index)
* @ApiHeaders (name=token, type=string, required=true, description="请求的Token")
* @ApiReturn ({
"code": 1,
"msg": "成功",
"time": "1598664523",
"data": {
"user": {
"id": 2, //用户ID
"username": "何先生", //用户名
"nickname": "何先生", //昵称
"avatar": "http://cloud.caiyunpan.brotop.cn/assets/img/avatar.png", //头像
"money": "0.00", //钱包余额
"house_id": 17, //当前小区ID
"id_num": "100001", //ID
"url": "/u/2",
"today_money": 10, //今日收益
"total_money": 10 //总收益
},
"house": { //当前小区信息
"id": 17, //小区ID
"name": "碧海花园小区" //小区名称
}
}
})
*/
public function index()
{
$this->success('', ['welcome' => $this->auth->nickname]);
$user = $this->auth->getUser();
$store_inform_log = new \app\api\model\StoreInformLog;
// 今日收益
$user['today_money'] = $store_inform_log
->where('user_id',$this->auth->id)
->whereTime('createtime', 'today')
->sum('money');
// 总收益
$user['total_money'] = $store_inform_log
->where('user_id',$this->auth->id)
->sum('money');
$user = $user->visible([
'id',
'username',
'nickname',
'avatar',
'id_num',
'house_id',
'money'
])->append([
'today_money',
'total_money'
]);
$house = \app\api\model\House::get($user['house_id'])->visible(['id','name']);
$this->success('成功', compact('user','house'));
}
/**
... ...
<?php
namespace app\api\model;
class House extends Base
{
}
\ No newline at end of file
... ...