|
@@ -139,7 +139,10 @@ class CmsContentTemplateSetRepository
|
|
foreach ($request_rule as $k => $v) {
|
|
foreach ($request_rule as $k => $v) {
|
|
if (isset($v['link_type']) && $v['link_type'] == 1) {
|
|
if (isset($v['link_type']) && $v['link_type'] == 1) {
|
|
$templates = $this->cmsSubject->where('id', intval($v['link_url']))->first();
|
|
$templates = $this->cmsSubject->where('id', intval($v['link_url']))->first();
|
|
- $templates->used_count += 1;
|
|
|
|
|
|
+ if ($templates == null) {
|
|
|
|
+ $templates = new CmsSubject();
|
|
|
|
+ $templates->used_count += 1;
|
|
|
|
+ }
|
|
$templates->save();
|
|
$templates->save();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -190,7 +193,10 @@ class CmsContentTemplateSetRepository
|
|
$templates->update($update_template);
|
|
$templates->update($update_template);
|
|
|
|
|
|
$templates = $this->cmsSubject->where('id', intval($request['rule']['link_url']))->first();
|
|
$templates = $this->cmsSubject->where('id', intval($request['rule']['link_url']))->first();
|
|
- $templates->used_count += 1;
|
|
|
|
|
|
+ if ($templates == null) {
|
|
|
|
+ $templates = new CmsSubject();
|
|
|
|
+ $templates->used_count += 1;
|
|
|
|
+ }
|
|
$templates->save();
|
|
$templates->save();
|
|
}
|
|
}
|
|
} elseif ($subject_id_array['link_type'] == 1 && $request['rule']['link_type'] != 1) {
|
|
} elseif ($subject_id_array['link_type'] == 1 && $request['rule']['link_type'] != 1) {
|
|
@@ -282,7 +288,10 @@ class CmsContentTemplateSetRepository
|
|
if (empty($floor_id)) {
|
|
if (empty($floor_id)) {
|
|
if ($request['rule']['link_type'] == 1) {
|
|
if ($request['rule']['link_type'] == 1) {
|
|
$templates = $this->cmsSubject->where('id', intval($request['rule']['link_url']))->first();
|
|
$templates = $this->cmsSubject->where('id', intval($request['rule']['link_url']))->first();
|
|
- $templates->used_count += 1;
|
|
|
|
|
|
+ if ($templates == null){
|
|
|
|
+ $templates = new CmsSubject();
|
|
|
|
+ $templates->used_count += 1;
|
|
|
|
+ }
|
|
$templates->save();
|
|
$templates->save();
|
|
}
|
|
}
|
|
if (!$this->cmsContentTemplateSet->create($subject)) {
|
|
if (!$this->cmsContentTemplateSet->create($subject)) {
|
|
@@ -315,7 +324,10 @@ class CmsContentTemplateSetRepository
|
|
if (empty($category_id)) {
|
|
if (empty($category_id)) {
|
|
if ($request['rule']['link_type'] == 1) {
|
|
if ($request['rule']['link_type'] == 1) {
|
|
$templates = $this->cmsSubject->where('id', intval($request['rule']['link_url']))->first();
|
|
$templates = $this->cmsSubject->where('id', intval($request['rule']['link_url']))->first();
|
|
- $templates->used_count += 1;
|
|
|
|
|
|
+ if ($templates == null){
|
|
|
|
+ $templates = new CmsSubject();
|
|
|
|
+ $templates->used_count += 1;
|
|
|
|
+ }
|
|
$templates->save();
|
|
$templates->save();
|
|
}
|
|
}
|
|
|
|
|