diff --git a/admin/controllers/receiver/Clues.php b/admin/controllers/receiver/Clues.php
index 409d0729..d85b1ae1 100644
--- a/admin/controllers/receiver/Clues.php
+++ b/admin/controllers/receiver/Clues.php
@@ -288,7 +288,7 @@ class Clues extends HD_Controller
$dataInfo['province_id_admin'] = $biz ? $biz['province_id'] : 0;
$dataInfo['city_id_admin'] = $biz ? $biz['city_id'] : 0;
$dataInfo['county_id_admin'] = $biz ? $biz['county_id'] : 0;
- $customer = $this->customers_model->get(array('rid' => $re['id'], 'status >' => -1));
+ $customer = $this->customers_model->get(array('rid' => $re['id'], 'biz_id' => $re['biz_id'], 'status >' => -1));
$dataInfo['customer_id'] = $customer['id'];
$map_cfrom = $this->clues_cfrom_model->map('id', 'title', array('status' => 1, 'pid' => 0, 'type' => 0), '', 0, 0, 'id, title');
@@ -557,23 +557,32 @@ class Clues extends HD_Controller
$msg = '修改用户信息成功';
$this->addLog(array('clue_id' => $info['id'], 'type' => 0, 'log' => $log));
}
- } else if ($info['editType'] == 3) {
+ } else if ($info['editType'] == 3 || $info['editType'] == 5) {
+ $cus = $this->customers_model->get(array('mobile' => $re['mobile'], 'status >' => -1, 'biz_id' => $info['biz_id']));
if ($cus = $this->customers_model->get(array('mobile' => $re['mobile'], 'status >' => -1, 'biz_id' => $info['biz_id']))) {
$code = SYS_CODE_FAIL;
$msg = '门店已有该线索';
} else {
- $up_data = [
- 'biz_id' => $info['biz_id'],
- 'status' => 1,
- 'p_time' => date('Y-m-d H:i:s'),
- ];
- $ret = $this->clues_model->update($up_data, array('id' => $info['id']));
- if (!$ret) {
+ if($clue = $this->clues_model->get(array('mobile' => $re['mobile'], 'status >' => -1, 'biz_id' => $info['biz_id']))){
$code = SYS_CODE_FAIL;
- $msg = '派单门店失败';
- } else {
- $msg = '派单门店成功';
- $this->addLog(array('clue_id' => $info['id'], 'type' => 3, 'log' => '派单'));
+ $msg = '门店已派单';
+ }else{
+ $up_data = [
+ 'biz_id' => $info['biz_id'],
+ 'status' => 1,
+ 'status2' => 1,
+ 'p_time' => date('Y-m-d H:i:s'),
+ ];
+
+ $ret = $this->clues_model->update($up_data, array('id' => $info['id']));
+ if (!$ret) {
+ $code = SYS_CODE_FAIL;
+ $msg = '派单门店失败';
+ } else {
+ $msg = $info['editType'] == 3 ? '派单门店成功' : '改派门店成功';
+ $log = $info['editType'] == 3 ? '派单门店' : '改派门店';
+ $this->addLog(array('clue_id' => $info['id'], 'type' => 3, 'log' => $log));
+ }
}
}
} else if ($info['editType'] == 4) {
diff --git a/admin/views/receiver/clues/edit.php b/admin/views/receiver/clues/edit.php
index 6c9ea6f9..6b5db60c 100644
--- a/admin/views/receiver/clues/edit.php
+++ b/admin/views/receiver/clues/edit.php
@@ -174,12 +174,14 @@
diff --git a/admin/views/receiver/order/get/ckinfo.php b/admin/views/receiver/order/get/ckinfo.php
index 498d44e9..3ef63f04 100644
--- a/admin/views/receiver/order/get/ckinfo.php
+++ b/admin/views/receiver/order/get/ckinfo.php
@@ -57,7 +57,7 @@
身份证正面
-
+
diff --git a/api/controllers/wxapp/licheb/User.php b/api/controllers/wxapp/licheb/User.php
index 337544c2..18f2fbbd 100644
--- a/api/controllers/wxapp/licheb/User.php
+++ b/api/controllers/wxapp/licheb/User.php
@@ -402,13 +402,16 @@ class User extends Wxapp
$s_month = date('Y-m-01', strtotime(date("Y-m-d"))) . ' 00:00:00';
$e_month = date('Y-m-d', strtotime("$s_month +1 month -1 day")) . ' 23:59:59';
//线索
- $where_today_xs = ['biz_id' => $biz_id, 'cs_biz_id<>' => -1, 'status>=' => 0, 'c_time>=' => strtotime($s_today), 'c_time<=' => strtotime($e_today)];
- $where_month_xs = ['biz_id' => $biz_id, 'cs_biz_id<>' => -1, 'status>=' => 0, 'c_time>=' => strtotime($s_month), 'c_time<=' => strtotime($e_month)];
+ $where_today_xs = ['biz_id' => $biz_id, 'status>=' => 0, 'c_time>=' => strtotime($s_today), 'c_time<=' => strtotime($e_today)];
+ $where_month_xs = ['biz_id' => $biz_id, 'status>=' => 0, 'c_time>=' => strtotime($s_month), 'c_time<=' => strtotime($e_month)];
//到店
- $where_today_dd = ['biz_id' => $biz_id, 'status>=' => 0, 'cs_biz_id<>' => -1,
+ $where_today_dd = ['biz_id' => $biz_id, 'status>=' => 0,
"id in(select customer_id from lc_receiver_customer_oplogs where type=4 and uid in({$str_uids}) and c_time>=" . strtotime($s_today) . " and c_time<=" . strtotime($e_today) . ")" => null];
- $where_month_dd = ['biz_id' => $biz_id, 'status>=' => 0, 'cs_biz_id<>' => -1,
+ $where_month_dd = ['biz_id' => $biz_id, 'status>=' => 0,
"id in(select customer_id from lc_receiver_customer_oplogs where type=4 and uid in({$str_uids}) and c_time>=" . strtotime($s_month) . " and c_time<=" . strtotime($e_month) . ")" => null];
+ //订单
+ $where_today_order = ['biz_id' => $biz_id, 'status>=' => 0, 'c_time>=' => strtotime($s_today), 'c_time<=' => strtotime($e_today)];
+ $where_month_order = ['biz_id' => $biz_id, 'status>=' => 0, 'c_time>=' => strtotime($s_month), 'c_time<=' => strtotime($e_month)];
//战败
$where_today_defeat = ['biz_id' => $biz_id, 'status>=' => 0, 'cs_biz_id<>' => -1,
"id in(select customer_id from lc_receiver_customer_oplogs where type=7 and uid in({$str_uids}) and c_time>=" . strtotime($s_today) . " and c_time<=" . strtotime($e_today) . ")" => null];
@@ -423,8 +426,8 @@ class User extends Wxapp
, 'month' => ['title' => '本月客户', 'value' => $this->customers_model->count($where_month_xs)]],
['today' => ['title' => '今日', 'value' => $this->customers_model->count($where_today_dd), 'url' => '/pages/customer/filterList/index?status=5&visit=5&title=到店']
, 'month' => ['title' => '本月到店', 'value' => $this->customers_model->count($where_month_dd)]],
- ['today' => ['title' => '今日', 'value' => 0, 'url' => '/pages/order/filterList/index2?status=6&visit=6&title=订单']
- , 'month' => ['title' => '本月订单', 'value' => 0]],
+ ['today' => ['title' => '今日', 'value' => $this->orders_model->count($where_today_order), 'url' => '/pages/order/filterList/index2?status=6&visit=6&title=订单']
+ , 'month' => ['title' => '本月订单', 'value' => $this->orders_model->count($where_month_order)]],
['today' => ['title' => '今日', 'value' => $this->customers_model->count($where_today_defeat), 'url' => '/pages/customer/filterList/index?status=7&visit=7&title=战败']
, 'month' => ['title' => '本月战败', 'value' => $this->customers_model->count($where_month_defeat)]]
];