|
@@ -211,6 +211,11 @@ class CmsContentTemplateSetRepository {
|
|
];
|
|
];
|
|
|
|
|
|
if (empty($advertisement_id)){
|
|
if (empty($advertisement_id)){
|
|
|
|
+ if ($request['rule']['link_type'] == 1){
|
|
|
|
+ $templates = $this->cmsSubject->where('id',intval($request['rule']['link_url']))->first();
|
|
|
|
+ $templates->used_count +=1;
|
|
|
|
+ $templates->save();
|
|
|
|
+ }
|
|
if (!$this->cmsContentTemplateSet->create($subject)) {
|
|
if (!$this->cmsContentTemplateSet->create($subject)) {
|
|
throw new HttpException(500, '添加失败');
|
|
throw new HttpException(500, '添加失败');
|
|
}
|
|
}
|
|
@@ -239,6 +244,11 @@ class CmsContentTemplateSetRepository {
|
|
'updated_at' => date('Y-m-d H:i:s')
|
|
'updated_at' => date('Y-m-d H:i:s')
|
|
];
|
|
];
|
|
if (empty($floor_id)){
|
|
if (empty($floor_id)){
|
|
|
|
+ if ($request['rule']['link_type'] == 1){
|
|
|
|
+ $templates = $this->cmsSubject->where('id',intval($request['rule']['link_url']))->first();
|
|
|
|
+ $templates->used_count +=1;
|
|
|
|
+ $templates->save();
|
|
|
|
+ }
|
|
if (!$this->cmsContentTemplateSet->create($subject)) {
|
|
if (!$this->cmsContentTemplateSet->create($subject)) {
|
|
throw new HttpException(500, '添加失败');
|
|
throw new HttpException(500, '添加失败');
|
|
}
|
|
}
|