diff --git a/admin/controllers/app/licheb/Sytlive.php b/admin/controllers/app/licheb/Sytlive.php index a1fc7384..733dc394 100644 --- a/admin/controllers/app/licheb/Sytlive.php +++ b/admin/controllers/app/licheb/Sytlive.php @@ -28,27 +28,20 @@ class Sytlive extends HD_Controller $params['size'] = $params['size'] ? intval($params['size']) : 20; $lists = array(); $where = array('status>' => -1); - $count = $this->mdSytActivity->count($where); + $count = $this->mdSytLive->count($where); if ($count) { $this->load->library('MyEncryption'); - $res = $this->mdSytActivity->select($where, 'id desc', $params['page'], $params['size']); + $res = $this->mdSytLive->select($where, 'id desc', $params['page'], $params['size']); foreach ($res as $key => $value) { $setValue = array(); $setValue['id'] = $value['id']; $setValue['title'] = $value['title']; - $z_title = ''; - if ($value['z_id']) { - $re_t = $this->mdTopics->get(array('id' => $value['z_id'])); - $re_t['title'] && $z_title = $re_t['title']; - } - $setValue['z_id'] = $value['z_id']; - $setValue['z_title'] = $z_title; + $setValue['session_id'] = $value['session_id']; $setValue['s_time'] = $value['s_time']; $setValue['e_time'] = $value['e_time']; $setValue['c_time'] = date('Y-m-d H:i', $value['c_time']); $setValue['status_name'] = $this->statusAry[$value['status']]; - - $url = http_host_com('home') . "/h5/syt/special?skey=" . $this->myencryption->base64url_encode("a_id=" . $value['id']); + $url = http_host_com('home') . "/h5/syt/live?skey=" . $this->myencryption->base64url_encode("id=" . $value['id']); $setValue['url'] = urlencode($url); $lists[] = $setValue; } @@ -68,13 +61,13 @@ class Sytlive extends HD_Controller $posters = array('imgs_url' => array(), 'imgs' => array()); $share_title = $remark = $rule = $bg_color = $btn_color = ''; if ($id > 0) { - $re = $this->mdSytActivity->get(array('id' => $id)); + $re = $this->mdSytLive->get(array('id' => $id)); if (!$re || empty($re)) { return $this->show_json(SYS_CODE_FAIL, '活动不存在!'); } - $_title = '编辑私域通活动'; + $_title = '编辑私域通-直播'; $dataInfo['editType'] = 0; - $dataInfo['edit_url'] = '/app/licheb/sytactivity/edit'; + $dataInfo['edit_url'] = '/app/licheb/sytlive/edit'; $dataInfo['brand_id'] = $re['brand_id'] ? explode(',', $re['brand_id']) : []; $dataInfo['status'] = $re['status']; $dataInfo['z_id'] = $re['z_id']; @@ -101,27 +94,18 @@ class Sytlive extends HD_Controller $dataInfo['img'] = $re['img'] ? $re['img'] : ''; $dataInfo['img_url'] = $re['img'] ? build_qiniu_image_url($re['img']) : ''; $dataInfo['time'] = $re['s_time'] . " ~ " . $re['e_time']; - $jsonkpi = $re['jsonkpi'] ? json_decode($re['jsonkpi'], true) : ''; - foreach ($this->mdSytKpiData->kpiAry() as $key => $value) { - $kpi_list[$key] = array("num" => $jsonkpi[$key]['num'], "score" => $jsonkpi[$key]['score'] - , "title" => $value['title1'], "num_tag" => $value['num_tag'], "score_tag" => $value['score_tag']); - } } else { - $_title = '新增私域通活动'; + $_title = '新增私域通-直播'; $dataInfo['editType'] = 2; - $dataInfo['edit_url'] = '/app/licheb/sytactivity/add'; + $dataInfo['edit_url'] = '/app/licheb/sytlive/add'; $dataInfo['brand_id'] = []; $dataInfo['status'] = 0; $dataInfo['z_id'] = 0; - foreach ($this->mdSytKpiData->kpiAry() as $key => $value) { - $kpi_list[$key] = array("num" => 0, "score" => 0, "title" => $value['title1'], "num_tag" => $value['num_tag'] - , "score_tag" => $value['score_tag']); - } } foreach ($this->statusAry as $key => $value) { $status_list[] = array("id" => $key, "name" => $value); } - $dataInfo['kpi_list'] = $kpi_list; + $dataInfo['kpi_list'] = []; $dataInfo['id'] = $id; $dataInfo['share_title'] = $share_title; $dataInfo['remark'] = $remark; @@ -132,7 +116,7 @@ class Sytlive extends HD_Controller $this->data['status_list'] = $status_list; $this->data['posters'] = $posters; $this->data['_title'] = $_title; - return $this->show_view('/app/licheb/syt/activity_edit', true); + return $this->show_view('/app/licheb/syt/live_edit', true); } public function add() @@ -143,7 +127,7 @@ class Sytlive extends HD_Controller return $this->show_json($checkData['code'], $checkData['msg']); } $brand_id = $info['brand_id'] ? implode(',', $info['brand_id']) : 0; - $re = $this->mdSytActivity->get(array("z_id" => $info['z_id'], "brand_id" => $brand_id)); + $re = $this->mdSytLive->get(array("z_id" => $info['z_id'], "brand_id" => $brand_id)); if ($re) { return $this->show_json(SYS_CODE_FAIL, '该活动已存在!'); } @@ -169,7 +153,7 @@ class Sytlive extends HD_Controller $addData['s_time'] = $time[0]; $addData['e_time'] = $time[1]; } - $id = $this->mdSytActivity->add($addData); + $id = $this->mdSytLive->add($addData); if (!$id) { return $this->show_json(SYS_CODE_FAIL, '新增活动失败!'); } @@ -211,7 +195,7 @@ class Sytlive extends HD_Controller $updateData['s_time'] = $time[0]; $updateData['e_time'] = $time[1]; } - $this->mdSytActivity->update($updateData, array('id' => $info['id'])); + $this->mdSytLive->update($updateData, array('id' => $info['id'])); $this->data['type'] = 'edit'; return $this->show_json(SYS_CODE_SUCCESS, '修改活动成功!'); } @@ -228,7 +212,7 @@ class Sytlive extends HD_Controller if (!$info['id']) { return $this->show_json(SYS_CODE_FAIL, '参数错误!'); } - $this->mdSytActivity->update(array("status" => intval($info['status'])), array('id' => $info['id'])); + $this->mdSytLive->update(array("status" => intval($info['status'])), array('id' => $info['id'])); return $this->show_json(SYS_CODE_SUCCESS, '操作成功!'); } @@ -245,7 +229,7 @@ class Sytlive extends HD_Controller if (!$params['a_id']) { return $this->show_json(SYS_CODE_FAIL, '参数错误!'); } - $re = $this->mdSytActivity->get(array('id' => $params['a_id'])); + $re = $this->mdSytLive->get(array('id' => $params['a_id'])); if (!$re || empty($re)) { return $this->show_json(SYS_CODE_FAIL, '活动不存在!'); } @@ -262,8 +246,8 @@ class Sytlive extends HD_Controller public function enrollSelect($params) { - $this->load->model('app/syt/syt_activity_enroll_model', 'mdSytActivityEnroll'); - $this->load->model('app/syt/syt_activity_team_model', 'mdSytActivityTeam'); + $this->load->model('app/syt/syt_activity_enroll_model', 'mdSytLiveEnroll'); + $this->load->model('app/syt/syt_activity_team_model', 'mdSytLiveTeam'); $this->load->model('app/hdy/app_hdy_users_model', 'mdHdyUsers'); $params['page'] = $params['page'] ? intval($params['page']) : 1; $params['size'] = $params['size'] ? intval($params['size']) : 20; @@ -276,9 +260,9 @@ class Sytlive extends HD_Controller if ($params['mobile']) { $where['mobile LIKE "%' . $params['mobile'] . '%"'] = null; } - $count = $this->mdSytActivityEnroll->count($where); + $count = $this->mdSytLiveEnroll->count($where); if ($count) { - $res = $this->mdSytActivityEnroll->select($where, 'id desc', $params['page'], $params['size']); + $res = $this->mdSytLiveEnroll->select($where, 'id desc', $params['page'], $params['size']); foreach ($res as $key => $value) { $setValue = array(); $setValue['id'] = $value['id']; @@ -290,7 +274,7 @@ class Sytlive extends HD_Controller $reUsers = $this->mdHdyUsers->get(array('id' => $value['cf_uid'])); $reUsers['nickname'] && $cf_name = $reUsers['nickname']; } else { - $re_t = $this->mdSytActivityTeam->get(array('id' => $value['t_id'])); + $re_t = $this->mdSytLiveTeam->get(array('id' => $value['t_id'])); $re_t['name'] && $cf_name = $re_t['name']; } } @@ -407,12 +391,12 @@ class Sytlive extends HD_Controller public function get_kpidata() { - $this->load->model('app/syt/syt_activity_member_model', 'mdSytActivityMember'); + $this->load->model('app/syt/syt_activity_member_model', 'mdSytLiveMember'); $params = $this->input->get(); $params['page'] = $params['page'] ? intval($params['page']) : 1; $params['size'] = $params['size'] ? intval($params['size']) : 10; $where = array('status' => 1); - $res = $this->mdSytActivityMember->select($where, 'id asc', $params['page'], $params['size']); + $res = $this->mdSytLiveMember->select($where, 'id asc', $params['page'], $params['size']); foreach ($res as $key => $value) { $this->mdSytKpiData->update(array("t_id" => $value['t_id']), array("a_id" => $value['a_id'], 'cf_uid' => $value['uid'])); } diff --git a/admin/controllers/app/licheb/Userslog.php b/admin/controllers/app/licheb/Userslog.php index 89ee009e..69536049 100644 --- a/admin/controllers/app/licheb/Userslog.php +++ b/admin/controllers/app/licheb/Userslog.php @@ -127,7 +127,7 @@ class Userslog extends HD_Controller $menus[] = ['title' => "客户数", 'value' => intval($sum['customers']), 'tag' => '人']; $sum_c = $this->mdUsersLog->sum('c_num', $where); $sum = $this->mdUsersLog->sum('a_num', $where); - $menus[] = ['title' => "进店人数/进店次数", 'value' => intval($sum_c['c_num']) . '/' . intval($sum['a_num']), 'tag' => '人']; + $menus[] = ['title' => "进店人数/进店次数", 'value' => intval($sum_c['c_num']) . '人 / ' . intval($sum['a_num']), 'tag' => '人次']; $sum = $this->mdUsersLog->sum('follows', $where); $menus[] = ['title' => "跟进数", 'value' => intval($sum['follows']), 'tag' => '个']; $sum = $this->mdUsersLog->sum('orders', $where); diff --git a/admin/views/app/licheb/syt/live_edit.php b/admin/views/app/licheb/syt/live_edit.php index 9e89ceae..05af5a53 100644 --- a/admin/views/app/licheb/syt/live_edit.php +++ b/admin/views/app/licheb/syt/live_edit.php @@ -44,33 +44,6 @@
-
- -
-
-
- -
-
- 选择 -
-
- 注:活动页面只能从现有的专题中选择 -
-
-
-
-
- -
-
- -
-
-
@@ -173,75 +146,6 @@
-