|
@@ -18,6 +18,20 @@ class JuliangAccountController extends CatchController
|
|
|
public function list(Request $request) {
|
|
|
$advAccountId = $request->input('account_id');
|
|
|
$advAccountName = $request->input('account_name');
|
|
|
+ $unBind = $request->input('unbind', 0);
|
|
|
+ $alreadyBindConfigIds = null;
|
|
|
+ if($unBind) {
|
|
|
+ $alreadyBindConfigIds = DB::table('promotions')
|
|
|
+ ->where([
|
|
|
+ 'uid' => $this->getOptimizerUid(),
|
|
|
+ 'callback_type' => 1,
|
|
|
+ 'status' => 1,
|
|
|
+ 'is_enabled' => 1,
|
|
|
+ ])->where('callback_config_id' , '<>', 0)
|
|
|
+ ->distinct()
|
|
|
+ ->select('callback_config_id')
|
|
|
+ ->get()->pluck('callback_config_id')->toArray();
|
|
|
+ }
|
|
|
|
|
|
return DB::table('juliang_account_callback_config')
|
|
|
->where(['company_uid' => $this->getOptimizerUid()])
|
|
@@ -25,7 +39,10 @@ class JuliangAccountController extends CatchController
|
|
|
return $query->where('adv_account_id' , $advAccountId);
|
|
|
})->when($advAccountName, function ($query, $advAccountName) {
|
|
|
return $query->where('adv_account_name', 'like', '%'. $advAccountName. '%');
|
|
|
- })->orderBy('id', 'desc')
|
|
|
+ })->when($alreadyBindConfigIds, function ($query, $alreadyBindConfigIds) {
|
|
|
+ return $query->whereNotIn('id', $alreadyBindConfigIds);
|
|
|
+ })
|
|
|
+ ->orderBy('id', 'desc')
|
|
|
->paginate($request->input('limit', 30));
|
|
|
}
|
|
|
|
|
@@ -295,8 +312,9 @@ class JuliangAccountController extends CatchController
|
|
|
'callback_type' => 1,
|
|
|
'callback_config_id' => $request->input('id'),
|
|
|
'is_enabled' => 1,
|
|
|
+ 'status' => 1,
|
|
|
])->update([
|
|
|
- 'callback_config_id' => 0,
|
|
|
+ 'status' => 0,
|
|
|
'updated_at' => $now,
|
|
|
]);
|
|
|
DB::table('juliang_account_rate_config_log')
|
|
@@ -326,4 +344,5 @@ class JuliangAccountController extends CatchController
|
|
|
|
|
|
return 'ok';
|
|
|
}
|
|
|
+
|
|
|
}
|