接口后台修改3
This commit is contained in:
parent
517c078f86
commit
6a57f4c5f3
@ -619,10 +619,10 @@ class User extends BaseController
|
||||
$salt = set_salt(20);
|
||||
$data = [
|
||||
'user_id' => $params['id'],
|
||||
'username' => $user['username'],
|
||||
'username' => $user['mobile'],
|
||||
'nickname' => $user['nickname'],
|
||||
'thumb' => 'https://lihai001.oss-cn-chengdu.aliyuncs.com/uploads/20230104/32a639be4ee32349705e947fbbd1e114.png',
|
||||
'mobile' => 13688888886,
|
||||
'thumb' => $user['avatar'],
|
||||
'mobile' => $user['mobile'],
|
||||
'did' => 1,
|
||||
'position_id' => 3,
|
||||
'salt' => $salt,
|
||||
|
@ -806,6 +806,15 @@ class Statistics extends BaseController
|
||||
->join('eb_product_order_log b','a.product_id = b.product_id')
|
||||
->join('eb_store_order c','b.order_id = c.order_id')
|
||||
->field('a.store_name as name,sum(c.total_num) as value')
|
||||
->withAttr('total', function ($value, $data) {
|
||||
$where = [];
|
||||
return Db::connect('shop')->table('eb_store_product')
|
||||
->alias('a')
|
||||
->join('eb_product_order_log b','a.product_id = b.product_id')
|
||||
->join('eb_store_order c','b.order_id = c.order_id')
|
||||
->where($where)
|
||||
->group('a.product_id')->sum('c.total_num');
|
||||
})
|
||||
->where($where)
|
||||
->limit(10)
|
||||
->group('a.product_id')
|
||||
@ -1104,11 +1113,11 @@ class Statistics extends BaseController
|
||||
}
|
||||
|
||||
$return['data'] = [
|
||||
['name' => '土豆','value'=>80],
|
||||
['name' => '番茄','value'=>50],
|
||||
['name' => '红薯','value'=>30],
|
||||
['name' => '山药','value'=>20],
|
||||
['name' => '白菜','value'=>70],
|
||||
['name' => '土豆','value'=>90,'img'=>'https://lihai001.oss-cn-chengdu.aliyuncs.com/public/kk/z5.png'],
|
||||
['name' => '番茄','value'=>34,'img'=>'https://lihai001.oss-cn-chengdu.aliyuncs.com/public/kk/z1.png'],
|
||||
['name' => '红薯','value'=>64,'img'=>'https://lihai001.oss-cn-chengdu.aliyuncs.com/public/kk/z2.png'],
|
||||
['name' => '山药','value'=>15,'img'=>'https://lihai001.oss-cn-chengdu.aliyuncs.com/public/kk/z4.png'],
|
||||
['name' => '白菜','value'=>78,'img'=>'https://lihai001.oss-cn-chengdu.aliyuncs.com/public/kk/z3.png'],
|
||||
];
|
||||
$return['img'] = [
|
||||
'https://lihai001.oss-cn-chengdu.aliyuncs.com/public/kk/z5.png',
|
||||
|
@ -481,5 +481,24 @@ class User extends BaseController
|
||||
}
|
||||
}
|
||||
|
||||
// 获取后台账号信息
|
||||
public function get_backstage(){
|
||||
$uid = JWT_UID;
|
||||
$admin = Db::table('cms_admin')->where('user_id',$uid)->find();
|
||||
if($admin){
|
||||
$data['url'] = 'https://nk.lihaink.cn';
|
||||
$data['username'] = $admin['username'];
|
||||
$pwd = set_password('123456', $admin['salt']);
|
||||
if($pwd == $admin['pwd']){
|
||||
$data['pwd'] = '123456';
|
||||
}else{
|
||||
$data['pwd'] = '密码已改';
|
||||
}
|
||||
}else{
|
||||
$this->apiError('没有后台权限','没有后台权限');
|
||||
}
|
||||
$this->apiSuccess('获取成功',$data);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user