diff --git a/Server/application/cunkebao/config/route.php b/Server/application/cunkebao/config/route.php index d9c55088..efdebf92 100644 --- a/Server/application/cunkebao/config/route.php +++ b/Server/application/cunkebao/config/route.php @@ -97,6 +97,7 @@ Route::group('v1/', function () { Route::get('group-list', 'app\cunkebao\controller\WorkbenchController@getGroupList'); // 获取群列表 Route::get('account-list', 'app\cunkebao\controller\WorkbenchController@getAccountList'); // 获取账号列表 Route::get('transfer-friends', 'app\cunkebao\controller\WorkbenchController@getTrafficList'); // 获取账号列表 + Route::get('import-contact', 'app\cunkebao\controller\WorkbenchController@getImportContact'); // 获取通讯录导入记录列表 Route::get('getJdSocialMedia', 'app\cunkebao\controller\WorkbenchController@getJdSocialMedia'); // 获取京东联盟导购媒体 Route::get('getJdPromotionSite', 'app\cunkebao\controller\WorkbenchController@getJdPromotionSite'); // 获取京东联盟广告位 diff --git a/Server/application/cunkebao/controller/WorkbenchController.php b/Server/application/cunkebao/controller/WorkbenchController.php index 0b151812..e273675b 100644 --- a/Server/application/cunkebao/controller/WorkbenchController.php +++ b/Server/application/cunkebao/controller/WorkbenchController.php @@ -1781,4 +1781,63 @@ class WorkbenchController extends Controller return false; } + + /** + * 获取通讯录导入记录列表 + * @return \think\response\Json + */ + public function getImportContact() + { + $page = $this->request->param('page', 1); + $limit = $this->request->param('limit', 10); + $workbenchId = $this->request->param('workbenchId', 0); + + $where = [ + ['wici.workbenchId', '=', $workbenchId] + ]; + + // 查询发布记录 + $list = Db::name('workbench_import_contact_item')->alias('wici') + ->join('traffic_pool tp', 'tp.id = wici.poolId', 'left') + ->join('traffic_source tc', 'tc.identifier = tp.identifier', 'left') + ->join('wechat_account wa', 'wa.wechatId = tp.wechatId', 'left') + ->field([ + 'wici.id', + 'wici.workbenchId', + 'wici.createTime', + 'tp.identifier', + 'tp.mobile', + 'tp.wechatId', + 'tc.name', + 'wa.nickName', + 'wa.avatar', + 'wa.alias', + ]) + ->where($where) + ->order('tc.name DESC,wici.createTime DESC') + ->group('tp.identifier') + ->page($page, $limit) + ->select(); + + foreach ($list as &$item) { + $item['createTime'] = date('Y-m-d H:i:s', $item['createTime']); + } + + + // 获取总记录数 + $total = Db::name('workbench_import_contact_item')->alias('wici') + ->where($where) + ->count(); + + return json([ + 'code' => 200, + 'msg' => '获取成功', + 'data' => [ + 'list' => $list, + 'total' => $total, + ] + ]); + } + + } \ No newline at end of file