自动建群群提交 + 自动点赞数据优化
This commit is contained in:
@@ -364,12 +364,36 @@ class GetPotentialListWithInCompanyV1Controller extends BaseController
|
||||
|
||||
public function getPackage()
|
||||
{
|
||||
|
||||
$page = $this->request->param('page',1);
|
||||
$limit = $this->request->param('limit',10);
|
||||
$keyword = $this->request->param('keyword','');
|
||||
|
||||
$companyId = $this->getUserInfo('companyId');
|
||||
$package = Db::name('traffic_source_package')
|
||||
->whereIn('companyId', [$companyId,0])
|
||||
->field('id,name')
|
||||
->select();
|
||||
return ResponseHelper::success($package);
|
||||
$package = Db::name('traffic_source_package')->alias('tsp')
|
||||
->join('traffic_source_package_item tspi','tspi.packageId=tsp.id','left')
|
||||
->whereIn('tsp.companyId', [$companyId,0])
|
||||
->field('tsp.id,tsp.name,tsp.description,tsp.createTime,count(tspi.id) as num')
|
||||
->group('tsp.id');
|
||||
|
||||
if (!empty($keyword)){
|
||||
$package->where('tsp.name|tsp.description','like','%'.$keyword.'%');
|
||||
}
|
||||
|
||||
$list = $package->page($page,$limit)->select();
|
||||
$total = $package->count();
|
||||
|
||||
foreach ($list as $k => &$v) {
|
||||
$v['createTime'] = !empty($v['createTime']) ? date('Y-m-d H:i:s', $v['createTime']) : '';
|
||||
}
|
||||
unset($v);
|
||||
|
||||
$data = [
|
||||
'total' => $total,
|
||||
'list' => $list,
|
||||
];
|
||||
|
||||
return ResponseHelper::success($data);
|
||||
}
|
||||
|
||||
|
||||
@@ -405,7 +429,14 @@ class GetPotentialListWithInCompanyV1Controller extends BaseController
|
||||
if (!empty($package)){
|
||||
return ResponseHelper::error('该流量池名称已存在');
|
||||
}
|
||||
$packageId = Db::name('traffic_source_package')->insertGetId(['userId' => $userId,'companyId' => $companyId,'name' => $packageName,'isDel' => 0]);
|
||||
$packageId = Db::name('traffic_source_package')->insertGetId([
|
||||
'userId' => $userId,
|
||||
'companyId' => $companyId,
|
||||
'name' => $packageName,
|
||||
'matchingRules' => json_encode($this->makeWhere()),
|
||||
'createTime' => time(),
|
||||
'isDel' => 0,
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user