|
@@ -114,6 +114,13 @@ class PromotionController extends CatchController
|
|
|
return 'ok';
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 更新推广的回传配置
|
|
|
+ * 1, 如果是巨量账户级,推广id和巨量账户唯一绑定
|
|
|
+ * @param Request $request
|
|
|
+ * @return string
|
|
|
+ * @throws \Illuminate\Validation\ValidationException
|
|
|
+ */
|
|
|
public function updateCallbackConfig(Request $request) {
|
|
|
$this->validate($request, [
|
|
|
'id' => 'required',
|
|
@@ -121,6 +128,15 @@ class PromotionController extends CatchController
|
|
|
'callback_config_id' => 'required',
|
|
|
'remark' => 'nullable|string|max:140',
|
|
|
]);
|
|
|
+ if(1 == $request->input('callback_type')) {
|
|
|
+ $exist = DB::table('promotions')
|
|
|
+ ->where(['is_enabled' => 1, 'callback_type' => $request->input('callback_type'),
|
|
|
+ 'callback_config_id' => $request->input('callback_config_id')])
|
|
|
+ ->first();
|
|
|
+ if($exist->id != $request->input('id')) {
|
|
|
+ CommonBusinessException::throwError(Errors::JULIANG_ACCOUNT_PROMOTION_UNIQUE);
|
|
|
+ }
|
|
|
+ }
|
|
|
DB::table('promotions')
|
|
|
->where(['id' => $request->input('id'), 'uid' => $this->getLoginUserId(), 'is_enabled' => 1])
|
|
|
->update([
|