|
@@ -33,7 +33,7 @@ class CmsContentTemplateSetRepository {
|
|
$subject_id_array = json_decode($request['old_rule'], true);
|
|
$subject_id_array = json_decode($request['old_rule'], true);
|
|
$rule = json_decode($request['rule'], true);
|
|
$rule = json_decode($request['rule'], true);
|
|
if ($subject_id_array['link_type'] == 1 && $rule['link_type'] == 1) {//链接方式都为专题
|
|
if ($subject_id_array['link_type'] == 1 && $rule['link_type'] == 1) {//链接方式都为专题
|
|
- if ($subject_id_array['link_url'] != $rule['link_type']) {
|
|
|
|
|
|
+ if ($subject_id_array['link_url'] != $rule['link_url']) {
|
|
$templates = $this->cmsSubject->where('id', intval($subject_id_array['link_url']))->first();
|
|
$templates = $this->cmsSubject->where('id', intval($subject_id_array['link_url']))->first();
|
|
$update_template = [
|
|
$update_template = [
|
|
$templates->used_count -= 1
|
|
$templates->used_count -= 1
|
|
@@ -51,7 +51,7 @@ class CmsContentTemplateSetRepository {
|
|
];
|
|
];
|
|
$templates->update($update_template);
|
|
$templates->update($update_template);
|
|
} elseif ($subject_id_array['link_type'] != 1 && $rule['link_type'] == 1) {
|
|
} elseif ($subject_id_array['link_type'] != 1 && $rule['link_type'] == 1) {
|
|
- $templates = $this->cmsSubject->where('id', intval($request['rule']['link_url']))->first();
|
|
|
|
|
|
+ $templates = $this->cmsSubject->where('id', intval($rule['link_url']))->first();
|
|
$templates->used_count += 1;
|
|
$templates->used_count += 1;
|
|
$templates->save();
|
|
$templates->save();
|
|
}
|
|
}
|