Files
cunkebao_v3/Server/application/chukebao/controller/WechatGroupController.php

30 lines
832 B
PHP
Raw Normal View History

2025-09-25 17:52:56 +08:00
<?php
namespace app\chukebao\controller;
use library\ResponseHelper;
use think\Db;
class WechatGroupController extends BaseController
{
public function getList(){
$accountId = $this->getUserInfo('s2_accountId');
$userId = $this->getUserInfo('id');
$companyId = $this->getUserInfo('companyId');
$query = Db::table('s2_wechat_group')->where(['accountId' => $accountId])->whereIn('groupType',[1,2])->order('sortIndex desc,id desc');
$list = $query->select();
$total = $query->count();
// 处理每个好友的数据
foreach ($list as $k => &$v) {
$v['createTime'] = !empty($v['createTime']) ? date('Y-m-d H:i:s', $v['createTime']) : '';
}
unset($v);
return ResponseHelper::success(['list'=>$list,'total'=>$total]);
}
}