diff --git a/admin/controllers/Common.php b/admin/controllers/Common.php index 3fc915c1..f9da5d28 100644 --- a/admin/controllers/Common.php +++ b/admin/controllers/Common.php @@ -942,14 +942,7 @@ class Common extends CI_Controller $this->load->library('hdwechat', $wxconfig); $result = $this->hdwechat->qrcode($filename, $scene, $page, $width); if ($result) { - if (false !== strpos($_SERVER['HTTP_HOST'], 'dev')) { //dev 测试 - $base_url = 'https://hd-api-dev.xiaoyu.com/'; - } elseif (false !== strpos($_SERVER['HTTP_HOST'], 'test')) {//test 测试 - $base_url = 'https://api.test.haodian.cn/'; - } else { // 正式 - $base_url = 'https://api.haodian.cn/'; - } - $this->data['qrcode'] = $base_url . $result['url']; + $this->data['qrcode'] = http_host_com() .'/'. $result['url']; } // $scene = 82; // $url_params = array('path' => '/' . $page, 'query' => 'id=' . $scene . '&form=auth&_um_campaign=604823e96ee47d382b7a2b79&_um_channel=604823e96ee47d382b7a2b7a', diff --git a/admin/controllers/app/material/Template.php b/admin/controllers/app/material/Template.php index 9b5cd247..3cd53e94 100644 --- a/admin/controllers/app/material/Template.php +++ b/admin/controllers/app/material/Template.php @@ -9,11 +9,17 @@ defined('BASEPATH') OR exit('No direct script access allowed'); */ class Template extends HD_Controller { + private $cf_id = 24;//素材报名 + public function __construct() { parent::__construct(); $this->load->model('app/material/Material_template_model', 'mdTemplate'); + $this->load->model('app/material/Material_biz_model', 'mdMaterialBiz'); + $this->load->model('app/material/Material_biz_statistics_model', 'mdBizStatistics'); + $this->load->model('receiver/receiver_customers_model', 'mdCustomers'); $this->load->model('auto/auto_brand_model', 'mdAutoBrand'); + $this->load->model("biz/biz_model", 'mdBiz'); } //首页信息 @@ -68,6 +74,49 @@ class Template extends HD_Controller return $this->show_view('/app/material/template/lists', true); } + public function lists_biz() + { + $params = $this->input->get(); + $t_id = intval($params['t_id']); + if (!$t_id) { + return $this->show_json(SYS_CODE_FAIL, '参数错误'); + } + $re = $this->mdTemplate->get(array('id' => $t_id)); + $params['page'] = $params['page'] ? intval($params['page']) : 1; + $params['size'] = $params['size'] ? intval($params['size']) : 20; + $lists = $users = array(); + $where = array('app_id' => $params['app_id'], 't_id' => $t_id); + if ($params['biz_name']) { + $where['biz_id in (select id from lc_biz where biz_name like "%' . $params['biz_name'] . '%")'] = null; + } + $count = $this->mdMaterialBiz->count($where); + if ($count) { + $fileds = "biz_id,c_time"; + $res = $this->mdMaterialBiz->select($where, "id desc", $params['page'], $params['size'], $fileds); + $str_ids = implode(',', array_unique(array_column($res, 'biz_id'))); + $map_biz = $this->mdBiz->map('id', 'biz_name', array("id in({$str_ids})" => null)); + foreach ($res as $key => $value) { + $setValue = array(); + $biz_id = intval($value['biz_id']); + $re_s = $this->mdBizStatistics->sum('browse_num', array('app_id' => $params['app_id'], 'biz_id' => $biz_id, 't_id' => $t_id)); + $count_c = $this->mdCustomers->count(array('biz_id' => $biz_id, 'cf_id' => $this->cf_id, 'status >=' => 0, 't_id' => $t_id)); + $count_o = $this->mdBizStatistics->count_order(array('c.biz_id' => $biz_id, 'c.cf_id' => $this->cf_id, 'c.status >=' => 0, 'c.t_id' => $t_id)); + $setValue['browse_num'] = intval($re_s['browse_num']); + $setValue['baoming_num'] = $count_c; + $setValue['order_name'] = $count_o; + $setValue['biz_id'] = $biz_id; + $setValue['biz_name'] = $map_biz[$value['biz_id']]; + $setValue['c_time'] = date('Y-m-d H:i:s', $value['c_time']); + $lists[] = $setValue; + } + } + $this->data['lists'] = $lists; + $this->data['params'] = $params; + $this->data['_title'] = $re['title'] . '_门店使用数据列表'; + $this->data['pager'] = array('count' => ceil($count / $params['size']), 'curr' => $params['page'], 'totle' => $count); + return $this->show_view('/app/material/template/lists_biz', true); + } + //展示单条数据 public function get() { diff --git a/admin/views/app/material/template/lists.php b/admin/views/app/material/template/lists.php index e57fecef..73e3a0f9 100644 --- a/admin/views/app/material/template/lists.php +++ b/admin/views/app/material/template/lists.php @@ -54,7 +54,6 @@ 适用品牌 状态 创建时间 - 操作 @@ -66,8 +65,22 @@ - 修改 + + + +
+
+
+
+ 门店数据 + 分享链接 + 查看详情 +
+ diff --git a/admin/views/app/material/template/lists_biz.php b/admin/views/app/material/template/lists_biz.php new file mode 100644 index 00000000..f3994b13 --- /dev/null +++ b/admin/views/app/material/template/lists_biz.php @@ -0,0 +1,52 @@ +
+ +
+
共有条数据
+ + + + + + + + + + + + + + + + + + + + + + + +
门店浏览次数报名客户订单客户创建时间操作
分享链接
+
+
+
+ +
+
+
\ No newline at end of file diff --git a/admin/views/biz/store/lists.php b/admin/views/biz/store/lists.php index 46ccf7ab..34d3ff92 100755 --- a/admin/views/biz/store/lists.php +++ b/admin/views/biz/store/lists.php @@ -142,6 +142,9 @@ + 分享链接 修改