diff --git a/admin/controllers/Common.php b/admin/controllers/Common.php
index e54676f3..69a7ca83 100644
--- a/admin/controllers/Common.php
+++ b/admin/controllers/Common.php
@@ -16,6 +16,15 @@ class Common extends CI_Controller
public $data = array();
+ //获取素材模版
+ public function material()
+ {
+ $this->load->model('app/material/Material_template_model', 'mdTemplate');
+ $rows = $this->mdTemplate->select(array('status' => 1, 'type in(1,2)' => null), 'id desc', '', '', 'id,title');
+ $this->data['data'] = $rows;
+ return $this->show_json(SYS_CODE_SUCCESS);
+ }
+
//获取行政区域
public function area()
{
@@ -1350,6 +1359,7 @@ class Common extends CI_Controller
$this->data['itemsPage'] = array('page' => $page, 'pageLimit' => $size, 'pageCount' => $count, 'hasNext' => $hasNext);
return $this->show_json(SYS_CODE_SUCCESS);
}
+
/**
* Notes:选择品牌
*/
@@ -1444,7 +1454,7 @@ class Common extends CI_Controller
$page = $this->input->post('page') ? intval($this->input->post('page')) : 1;
$size = $this->input->post('size') ? intval($this->input->post('size')) : 10;
$where = "status=1 ";
- if($vin){
+ if ($vin) {
$where .= " and vin='{$vin}'";
} else {
$brand_id && $where .= " and brand_id=$brand_id";
diff --git a/admin/controllers/app/material/Template.php b/admin/controllers/app/material/Template.php
index 1cde9458..49ac7b7f 100644
--- a/admin/controllers/app/material/Template.php
+++ b/admin/controllers/app/material/Template.php
@@ -150,7 +150,7 @@ class Template extends HD_Controller
$msg = '非法参数';
} else if (!$info['title']) {
$msg = '请输入模版名称';
- } else if (!$info['cover']['value']) {
+ } else if (!$info['cover']['value'] && $info['type'] != 3) {
$msg = '请上传封面图';
} else if (!$info['brand_ids'] && $info['type'] != 3) {
$msg = '请选择适用品牌';
diff --git a/admin/controllers/receiver/Customer.php b/admin/controllers/receiver/Customer.php
index 1e971a35..ede61886 100644
--- a/admin/controllers/receiver/Customer.php
+++ b/admin/controllers/receiver/Customer.php
@@ -133,14 +133,19 @@ class Customer extends HD_Controller
$dt_time[1] && $where["dt_time <="] = $dt_time[1] . ' 23:59:59';
}
if ($params['cfrom_id'] || $params['cfrom_id2']) {
- if ($params['cfrom_id2']) {
- $where['cf_id'] = $params['cfrom_id2'];
+ if ($params['cfrom_id'] == 24) {
+ $where['cf_id'] = 24;
+ $params['cfrom_id2'] && $where['t_id'] = $params['cfrom_id2'];
} else {
- $cf_rows = $this->clues_cfrom_model->select(['pid' => $params['cfrom_id']], '', '', '', 'id');
- $cf_ids = array_column($cf_rows, 'id');
- $cf_ids[] = $params['cfrom_id'];
- $cf_str_ids = implode(',', array_filter($cf_ids));
- $cf_str_ids && $where["cf_id in ({$cf_str_ids})"] = null;
+ if ($params['cfrom_id2']) {
+ $where['cf_id'] = $params['cfrom_id2'];
+ } else {
+ $cf_rows = $this->clues_cfrom_model->select(['pid' => $params['cfrom_id']], '', '', '', 'id');
+ $cf_ids = array_column($cf_rows, 'id');
+ $cf_ids[] = $params['cfrom_id'];
+ $cf_str_ids = implode(',', array_filter($cf_ids));
+ $cf_str_ids && $where["cf_id in ({$cf_str_ids})"] = null;
+ }
}
}
$count = $this->customers_model->count($where);
diff --git a/admin/views/receiver/customer/lists.php b/admin/views/receiver/customer/lists.php
index a0c7ca39..2d701c04 100644
--- a/admin/views/receiver/customer/lists.php
+++ b/admin/views/receiver/customer/lists.php
@@ -41,6 +41,7 @@
+
@@ -273,7 +274,8 @@
that.cfroms = result.data.data
});
if (that.cfrom_id > 0) {
- $.get('/receiver/clues/get_cfroms', {'id': that.cfrom_id}, function (result) {
+ var url = that.cfrom_id == 24 ? '/common/material' : '/receiver/clues/get_cfroms';
+ $.get(url, {'id': that.cfrom_id}, function (result) {
that.cfroms2 = result.data.data
});
}
@@ -346,7 +348,8 @@
that.cfrom_id2 = 0;
that.cfroms = [];
} else {
- $.get('/receiver/clues/get_cfroms', {'id': nv}, function (result) {
+ var url = nv == 24 ? '/common/material' : '/receiver/clues/get_cfroms';
+ $.get(url, {'id': nv}, function (result) {
that.cfroms2 = result.data.data;
if (that.cfrom_id2 > 0) {
var cfrom_id2 = '0';
diff --git a/api/controllers/wxapp/material/Biz.php b/api/controllers/wxapp/material/Biz.php
index 83b55633..09d4f09f 100644
--- a/api/controllers/wxapp/material/Biz.php
+++ b/api/controllers/wxapp/material/Biz.php
@@ -78,14 +78,15 @@ class Biz extends Wxapp
}
//统计浏览数
$re_s = $this->mdBizStatistics->sum('browse_num', ['app_id' => $this->app_id, 'biz_id' => $biz_id]);
- $orders = $this->mdBizStatistics->count_order(array('c.biz_id' => $biz_id, 'c.cf_id' => $this->cf_id, 'c.status >=' => 0));
+ //$orders = $this->mdBizStatistics->count_order(array('c.biz_id' => $biz_id, 'c.cf_id' => $this->cf_id, 'c.status >=' => 0));
$this->data['title'] = '店铺';
$this->data['biz_name'] = $re['biz_name'];
$this->data['address'] = $re['address'];
$this->data['lat'] = $re['lat'];
$this->data['lng'] = $re['lng'];
$this->data['auto_brands'] = $auto_brands;
- $this->data['statistics'] = $re_s['browse_num'] . '人浏览 | ' . $orders . '笔成交';
+ //$this->data['statistics'] = $re_s['browse_num'] . '人浏览 | ' . $orders . '笔成交';
+ $this->data['statistics'] = $re_s['browse_num'] . '人浏览';
$this->data['topics'] = array('title' => '热门', 'list' => $list);
return $this->data;
}
@@ -113,7 +114,7 @@ class Biz extends Wxapp
'biz_id' => $biz_id,
'city_id' => $re_biz['city_id'],
'county_id' => $re_biz['county_id'],
- 'cf_title' => '自有资源',
+ 'cf_title' => '素材推广',
'cf_id' => $this->cf_id,
't_id' => $t_id,
'p_time' => date('Y-m-d H:i:s'),