作者 刘朕

用户接口优化

... ... @@ -62,7 +62,8 @@ class Bili extends Backend
foreach ($list as $row) {
$row->getRelation('qi')->visible(['title']);
$row->getRelation('goods')->visible(['title']);
$row->getRelation('goods')->visible(['title','base_id']);
$row->base_name = \app\admin\model\Base::where('id',$row['goods']['base_id'])->value('title');
}
$result = array("total" => $list->total(), "rows" => $list->items());
... ...
... ... @@ -6,5 +6,6 @@ return [
'Goods_id' => '商品',
'Bili' => '折扣价格',
'Qi.title' => '批次',
'Goods.title' => '商品名称'
'Goods.title' => '商品名称',
'Base_name' => '基地名称',
];
... ...
... ... @@ -140,6 +140,7 @@ class User extends Api
$UserInfo['avatarUrl'] = $UserInfo['avatar'];
$UserInfo['avatar'] = $this->UserAvatar($UserInfo['avatar']);
$UserInfo['days'] = ($UserInfo['exp_time'] == 0) ? '*' : floor(($UserInfo['exp_time'] - time()) / 86400);
$UserInfo['vip'] = ($UserInfo['exp_time'] == 0 || (floor(($UserInfo['exp_time'] - time())) <= 0)) ? 0 : $UserInfo['vip'];
$UserInfo['exp_time'] = ($UserInfo['exp_time'] == 0) ? '*' : date('Y-m-d H:i:s', $UserInfo['exp_time']);
/*累计飞行时间*/
$UserInfo['CountMinutes'] = ($UserInfo['CountMinutes'] == 0) ? 0 : round($UserInfo['CountMinutes'] / 60, 2);
... ...
... ... @@ -28,6 +28,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
{field: 'id', title: __('Id')},
// {field: 'pi_id', title: __('Pi_id')},
// {field: 'goods_id', title: __('Goods_id')},
{field: 'base_name', title: __('Base_name'), operate: 'LIKE'},
{field: 'qi.title', title: __('Qi.title'), operate: 'LIKE'},
{field: 'goods.title', title: __('Goods.title'), operate: 'LIKE'},
{field: 'bili', title: __('Bili'), operate: 'LIKE'},
... ...