diff --git a/admin/controllers/topics/Topics.php b/admin/controllers/topics/Topics.php index d000507a..41bf91c6 100644 --- a/admin/controllers/topics/Topics.php +++ b/admin/controllers/topics/Topics.php @@ -28,6 +28,7 @@ Class Topics extends AppBase $this->load->model('topics/topic_module_button_model', 'mdModuleButton'); $this->load->model('topics/topic_user_log_model', 'mdUserLog'); $this->load->model("sys/sys_admin_model", 'mdSysAdmin'); + $this->load->model('receiver/receiver_clues_cfrom_model', 'mdCluesCfrom'); } /** @@ -346,12 +347,22 @@ Class Topics extends AppBase if (!$re || empty($re)) { return $this->show_json(SYS_CODE_FAIL, '专题不存在!'); } - $re['bg_img_url'] = build_qiniu_image_url($re['bg_img']); $info = $re; - $json = $info['jsondata'] ? json_decode($info['jsondata'], true) : ''; - $info['cf_id'] = $json['cf_id'] ? $json['cf_id'] : ""; - $info['mp_app_id'] = $json['mp_app_id'] ? $json['mp_app_id'] : ""; - $info['ebiz'] = $json['ebiz'] ? $json['ebiz'] : ""; + if ($re['cf_id']) { + $re_cf = $this->mdCluesCfrom->get(['id' => $re['cf_id']]); + if ($re_cf) { + if ($re_cf['pid'] == 0) { + $info['cfrom_id'] = $re_cf['id']; + $info['cfrom_id2'] = 0; + } else { + $info['cfrom_id'] = $re_cf['pid']; + $info['cfrom_id2'] = $re_cf['id']; + } + } + } + $jsonData = $info['jsondata'] ? json_decode($info['jsondata'], true) : ''; + $info['bg_img_url'] = $re['bg_img'] ? build_qiniu_image_url($re['bg_img']) : ''; + $info['share_img_url'] = $jsonData['share_img'] ? build_qiniu_image_url($jsonData['share_img']) : ''; $_title = '编辑专题'; $edit_url = '/topics/topics/edit'; } else { @@ -359,9 +370,9 @@ Class Topics extends AppBase $edit_url = '/topics/topics/add'; $info['id'] = $id; $info['app_id'] = $app_id; - $info['cf_id'] = ""; - $info['mp_app_id'] = ""; - $info['ebiz'] = 0; + $info['share_img_url'] = ''; + $info['cfrom_id'] = 0; + $info['cfrom_id2'] = 0; } $info['spm'] = $this->input->get('spm'); $info['edit_url'] = $edit_url; @@ -384,13 +395,18 @@ Class Topics extends AppBase } $bg_color = $this->input->post('bg_color'); $bg_img = $this->input->post('bg_img'); - + $share_img = $this->input->post('share_img'); + $cfrom_id = intval($this->input->post('cfrom_id')); + $cfrom_id2 = intval($this->input->post('cfrom_id2')); + $jsonData['share_img'] = $share_img ? $share_img : ''; $dataItems['app_id'] = $app_id; $dataItems['title'] = $title; $dataItems['bg_color'] = $bg_color; $dataItems['bg_img'] = $bg_img; $dataItems['status'] = 1; $dataItems['c_time'] = time(); + $dataItems['cf_id'] = $cfrom_id2 ? $cfrom_id2 : $cfrom_id; + $dataItems['jsondata'] = json_encode($jsonData, JSON_UNESCAPED_UNICODE); $id = $this->mdTopics->add($dataItems); if (!$id) { return $this->show_json(SYS_CODE_FAIL, '添加失败'); @@ -410,9 +426,15 @@ Class Topics extends AppBase } $bg_color = $this->input->post('bg_color'); $bg_img = $this->input->post('bg_img'); + $share_img = $this->input->post('share_img'); + $cfrom_id = intval($this->input->post('cfrom_id')); + $cfrom_id2 = intval($this->input->post('cfrom_id2')); + $jsonData['share_img'] = $share_img ? $share_img : ''; $dataItems['title'] = $title; $dataItems['bg_color'] = $bg_color; $dataItems['bg_img'] = $bg_img; + $dataItems['cf_id'] = $cfrom_id2 ? $cfrom_id2 : $cfrom_id; + $dataItems['jsondata'] = json_encode($jsonData, JSON_UNESCAPED_UNICODE); $re = $this->mdTopics->update($dataItems, array('id' => $id)); if (!$re) { return $this->show_json(SYS_CODE_FAIL, '修改失败'); diff --git a/admin/views/topics/edit.php b/admin/views/topics/edit.php index d0610715..e0c0aedd 100644 --- a/admin/views/topics/edit.php +++ b/admin/views/topics/edit.php @@ -38,6 +38,44 @@ + +
+ +
+
+
线索来源
+ +
+
+
+ +
+
+
+
+ + + +
+
+
@@ -46,6 +84,59 @@
+ 0) { ?>
diff --git a/admin/views/topics/module_button.php b/admin/views/topics/module_button.php index 908b002b..188571e7 100644 --- a/admin/views/topics/module_button.php +++ b/admin/views/topics/module_button.php @@ -161,20 +161,20 @@
-
{{params.app_id==6 ? 'h5跳转链接': '跳转链接'}}
+
跳转链接
-
- -
-
-
小程序跳转链接
- -
+ +
+ +
+
+
提示文案
+
- +
\ No newline at end of file diff --git a/api/controllers/wxapp/liche/Topics.php b/api/controllers/wxapp/liche/Topics.php index 99220116..f513c0e0 100644 --- a/api/controllers/wxapp/liche/Topics.php +++ b/api/controllers/wxapp/liche/Topics.php @@ -130,17 +130,22 @@ class Topics extends Wxapp 'img' => $jsondata['img'] ? build_qiniu_image_url($jsondata['img']) : '', 'color' => $jsondata['color'] ? $jsondata['color'] : '', 'descrip' => $module['descrip'] ? $module['descrip'] : '', + 'prompt' => $jsondata['prompt'] ? $jsondata['prompt'] : '', ]; break; default: } } } + $jsonData = $re['jsondata'] ? json_decode($re['jsondata'], true) : ''; + $share_img = $jsonData['share_img'] ? build_qiniu_image_url($jsonData['share_img']) : ''; + $bg_img = $re['bg_img'] ? build_qiniu_image_url($re['bg_img']) : ''; $data = [ 'id' => $re['id'], 'title' => $re['title'], - 'bg_img' => build_qiniu_image_url($re['bg_img']), + 'bg_img' => $bg_img, 'bg_color' => $re['bg_color'], + 'share_img' => $share_img, 'list' => $list, 'mButton' => $mButton ];