底层创建账号提交

This commit is contained in:
wong
2025-04-18 13:46:34 +08:00
parent b16786c74a
commit ac8600ab6d
3 changed files with 81 additions and 67 deletions

View File

@@ -19,6 +19,9 @@ class GetFriendListV1Controller extends BaseController
*/
public function index()
{
$page = $this->request->param('page',1);
$limit = $this->request->param('limit',20);
try {
$where = [];
@@ -26,9 +29,12 @@ class GetFriendListV1Controller extends BaseController
$where['companyId'] = $this->getUserInfo('companyId');
} else {
$where['companyId'] = $this->getUserInfo('companyId');
$where['userId'] = $this->getUserInfo('id');
//$where['userId'] = $this->getUserInfo('id');
}
print_r($where);
exit;
$data = WechatFriend::alias('wf')
->field(['wa1.nickname','wa1.avatar','wa1.alias','wa1.wechatId','wa2.nickname as ownerNickname','wa2.alias as ownerAlias','wf.createTime'])
@@ -36,6 +42,8 @@ class GetFriendListV1Controller extends BaseController
->leftJoin('wechat_account wa2','wf.ownerWechatId = wa2.wechatId')
->where($where);
$total = $data->count();
$list = $data->page($page, $limit)->select();
@@ -44,8 +52,8 @@ class GetFriendListV1Controller extends BaseController
'code' => 200,
'msg' => '获取成功',
'data' => [
'list' => $data->select(),
'total' => $data->total(),
'list' => $list,
'total' => $total,
]
]);
} catch (\Exception $e) {