修改添加绑定用户权限功能

This commit is contained in:
wangxiaowei 2024-10-08 14:57:48 +08:00
parent c6bf774c27
commit 93b6717e2c
2 changed files with 29 additions and 11 deletions

@ -3,6 +3,7 @@
namespace app\api\controller;
use app\api\logic\LocalStoreLogic;
use app\api\logic\MallNewsLogic;
use app\api\logic\UserLogic;
use app\common\basics\Api;
use app\common\enum\NoticeEnum;
@ -398,13 +399,20 @@ class LocalStore extends Api
// 绑定用户列表
public function bindList()
{
try {
$post = $this->request->post();
LocalStoreLogic::bindList($post);
return JsonServer::success('添加成功');
} catch (\Exception $e) {
return JsonServer::error($e->getMessage());
if($this->request->isGet()) {
$data = LocalStoreLogic::bindList($post);
return JsonServer::success('获取成功', $data);
}else{
return JsonServer::error('请求方式错误');
}
// try {
// $post = $this->request->post();
// LocalStoreLogic::bindList($post);
// return JsonServer::success('添加成功');
// } catch (\Exception $e) {
// return JsonServer::error($e->getMessage());
// }
}
// 绑定用户

@ -496,11 +496,21 @@ class LocalStoreLogic extends Logic
public static function bindList($post)
{
$user = LocalStoreBind::where([
'lstore_id' => $post['lstore_id'],
'is_unbind' => 0,
])->group('bind_user_id')->select()->toArray();
dump($user);die;
$list = LocalStoreBind::where(['lstore_id' => $post['lstore_id'], 'is_unbind' => 0])
->order('id desc')
->page($post['page_no'], $post['page_size'])
->select();
$count = LocalStoreBind::where(['lstore_id' => $post['lstore_id'], 'is_unbind' => 0])->count();
$more = is_more($count, $post['page_no'], $post['page_size']); //是否有下一页
return [
'lists' => $list,
'page_no' => $post['page_no'],
'page_size' => $post['page_size'],
'count' => $count,
'more' => $more,
];
}
public static function bindUser($post)