30 lines
832 B
PHP
30 lines
832 B
PHP
|
|
<?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]);
|
||
|
|
}
|
||
|
|
}
|