This commit is contained in:
小鱼开发
2024-06-25 14:14:50 +08:00
parent fbda65f021
commit 2db67b26f5
4 changed files with 41 additions and 27 deletions
+22 -13
View File
@@ -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) {
+8 -6
View File
@@ -174,12 +174,14 @@
</div>
<div class="am-para-inline" style="margin-left: 30px;">
<?php if($info['biz_id']){ ?>
<?php if(!$info['customer_id']){ ?>
<a href="javascript:void(0)" class="am-btn am-btn-sm am-btn-danger" @click="saveEdit(4)">转交门店跟踪</a>
<?php }else{ ?>
<a href="javascript:void(0)" data-open="/receiver/customer/get?id=<?=$info['customer_id']?>" class="am-btn am-btn-sm am-btn-default">门店跟进中</a>
<?php }} else{ ?>
<a href="javascript:void(0)" class="am-btn am-btn-sm am-btn-success" @click="saveEdit(3)">确认派单</a>
<?php if(!$info['customer_id']){ ?>
<a href="javascript:void(0)" class="am-btn am-btn-sm am-btn-danger" @click="saveEdit(4)">转交门店跟踪</a>
<a href="javascript:void(0)" class="am-btn am-btn-sm am-btn-success" @click="saveEdit(5)">改派门店</a>
<?php }else{ ?>
<a href="javascript:void(0)" data-open="/receiver/customer/get?id=<?=$info['customer_id']?>" class="am-btn am-btn-sm am-btn-default">门店跟进中</a>
<a href="javascript:void(0)" class="am-btn am-btn-sm am-btn-success" @click="saveEdit(5)">另派门店</a>
<?php }} else{ ?>
<a href="javascript:void(0)" class="am-btn am-btn-sm am-btn-success" @click="saveEdit(3)">确认派单</a>
<?php }?>
</div>
</td>
+2 -2
View File
@@ -57,7 +57,7 @@
</a>
<div class="tc f12">身份证正面</div>
</li>
<li style="position:relative;" v-if="info.img_data.cardidb">
<!--li style="position:relative;" v-if="info.img_data.cardidb">
<div style="position:absolute;top:5px;right:0;padding:0 8px 2px 8px;line-height:22px; background-color:rgba(0,0,0,.5);font-size:14px;color:#fff;"
onclick="del_img('data','cardidb','')">x
</div>
@@ -69,7 +69,7 @@
<a :href="info.img_data.cardidb" target="_blank">查看原图</a>
</div>
</li>
</li-->
<li v-else>
<a href="javascript:void(0);" class="pic" data-file="1" data-type="jpg,png,gif,png,jpeg"
data-uptype="qiniu" data-field="cardidb" data-mark="compalbum">
+9 -6
View File
@@ -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)]]
];