修改线索解锁流程
This commit is contained in:
@@ -1275,9 +1275,9 @@ class Clues extends HD_Controller
|
||||
if (!count($bizList)) {
|
||||
return $this->show_json(SYS_CODE_FAIL, '请选择门店');
|
||||
}
|
||||
if (!$info['rec_time']) {
|
||||
return $this->show_json(SYS_CODE_FAIL, '请选择回收时间');
|
||||
}
|
||||
// if (!$info['rec_time']) {
|
||||
// return $this->show_json(SYS_CODE_FAIL, '请选择回收时间');
|
||||
// }
|
||||
$re = $this->clues_model->get(array('id' => $info['id']));
|
||||
if (!$re || empty($re)) {
|
||||
return $this->show_json(SYS_CODE_FAIL, '线索不存在!');
|
||||
@@ -1307,7 +1307,7 @@ class Clues extends HD_Controller
|
||||
'cont_time' => $re['cont_time'],
|
||||
'cf_pid' => $re['cf_pid'],
|
||||
'c_time' => $re['c_time'],
|
||||
'rec_time' => $info['rec_time']
|
||||
'rec_time' => $info['rec_time'] ?: date('Y-m-d H:i:s')
|
||||
);
|
||||
if ($re['app_id'] == Receiver_clues_model::APP_ID_ACTIVITY) {
|
||||
$add['un_lock'] = Receiver_customers_model::UNLOCK_STATUS;
|
||||
|
||||
@@ -110,7 +110,7 @@ class Customer extends HD_Controller
|
||||
$clues = $this->clues_model->get(['id' => $val['rid']]);
|
||||
$is_unlock = '';
|
||||
if ($clues['app_id'] == Receiver_clues_model::APP_ID_ACTIVITY) {
|
||||
$is_unlock = $val['un_lock'] ? '已解锁' : '未解锁';
|
||||
$is_unlock = Receiver_customers_model::LOCK_LIST[$val['un_lock']];
|
||||
}
|
||||
$lists[] = array(
|
||||
'id' => $val['id'],
|
||||
|
||||
@@ -324,11 +324,13 @@
|
||||
<tr>
|
||||
<template v-if="info.app_id==1">
|
||||
<td class="table-td">
|
||||
<!--
|
||||
<div class="am-para-inline ml30">回收时间:</div>
|
||||
<div class="am-para-inline w200">
|
||||
<input type="text" autocomplete="off" id="id-create-time"
|
||||
v-model="info.rec_time">
|
||||
</div>
|
||||
-->
|
||||
<div class="am-para-inline ml30">
|
||||
<a href="javascript:void(0)" class="am-btn am-btn-sm am-btn-success"
|
||||
@click="saveCustomer()">确认派单</a>
|
||||
|
||||
@@ -83,7 +83,7 @@ class Customer extends BaseController
|
||||
if ($orderSubsidy) {
|
||||
$checkStatus = Receiver_order_subsidy_model::IF_CHECK_STATUS[$orderSubsidy['ifcheck']] ?: '';
|
||||
}
|
||||
$isUnlock = $val['un_lock'] ? '已解锁' : '未解锁';
|
||||
$isUnlock = Receiver_customers_model::LOCK_LIST[$val['un_lock']];
|
||||
$temp = [
|
||||
'cluesSid' => $cluesRow['sid'],
|
||||
'cid' => $val['cid'],
|
||||
|
||||
@@ -33,6 +33,7 @@ class Customers extends Wxapp
|
||||
$this->load->model('auto/auto_brand_model');
|
||||
$this->load->model("biz/biz_model");
|
||||
$this->load->library('receiver/customers_entity');
|
||||
$this->load->library('receiver/clues_entity');
|
||||
$this->load->model('app/paic/app_paic_users_model');
|
||||
$this->biz_id = $this->get_biz_id();
|
||||
}
|
||||
@@ -851,7 +852,7 @@ class Customers extends Wxapp
|
||||
if ($status == 1000) {
|
||||
$where['rid>'] = 0;
|
||||
$where['un_lock'] = 0;
|
||||
$where['rec_time>'] = date('Y-m-d H:i:s');
|
||||
// $where['rec_time>'] = date('Y-m-d H:i:s');
|
||||
$status = 0;
|
||||
$show_log = true;
|
||||
} else {
|
||||
@@ -1545,11 +1546,45 @@ class Customers extends Wxapp
|
||||
protected function put_unlock()
|
||||
{
|
||||
$id = $this->input_param('id');
|
||||
/** @var MyResponse $result */
|
||||
$result = $this->customers_model->unlock($id, $this->biz_id);
|
||||
if (!$result->isSuccess()) {
|
||||
throw new Exception($result->getMessage(), API_CODE_FAIL);
|
||||
$unlock = $this->input_param('unlock');
|
||||
$reason = $this->input_param('reason');
|
||||
if ($unlock) { //不解锁
|
||||
if (!$reason) {
|
||||
throw new Exception('请选择不解锁理由', ERR_PARAMS_ERROR);
|
||||
}
|
||||
$row = $this->customers_model->get(['id' => $id, 'biz_id' => $this->biz_id]);
|
||||
if (!$row) {
|
||||
throw new Exception('数据不存在');
|
||||
}
|
||||
$res = $this->customers_model->update(['un_lock' => Receiver_customers_model::LOCK_STATUS_2], ['id' => $id]);
|
||||
if (!$res) {
|
||||
throw new Exception('保存失败', ERR_PARAMS_ERROR);
|
||||
}
|
||||
//添加线索和和客户记录
|
||||
$uname = $this->session['uname'];
|
||||
$content = "不解锁,理由为【{$reason}】";
|
||||
$this->customers_entity->add_log($id, $this->session['uid'], $uname, $content);
|
||||
if ($row['rid']) {
|
||||
$this->clues_entity->add_log($row['rid'], $this->session['uid'], $uname, $content);
|
||||
}
|
||||
throw new Exception('保存成功', API_CODE_SUCCESS);
|
||||
} else {
|
||||
/** @var MyResponse $result */
|
||||
$result = $this->customers_model->unlock($id, $this->biz_id);
|
||||
if (!$result->isSuccess()) {
|
||||
throw new Exception($result->getMessage(), API_CODE_FAIL);
|
||||
}
|
||||
throw new Exception('解锁成功', API_CODE_SUCCESS);
|
||||
}
|
||||
throw new Exception('解锁成功', API_CODE_SUCCESS);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 线索不解锁理由
|
||||
* @return string[]
|
||||
*/
|
||||
protected function get_lockReason()
|
||||
{
|
||||
return Receiver_customers_model::LOCK_REASON;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -334,7 +334,10 @@ class User extends Wxapp
|
||||
$clues_count = $this->clues_model->count(['biz_id' => $biz_id, 'status' => 1, 'status2' => 1]);
|
||||
$customer_op_list = [];
|
||||
if ($biz['type'] == Biz_model::BIZ_TYPE_4s) {
|
||||
$where = ['biz_id' => $biz_id, 'status' => 0, 'un_lock' => 0, 'rid>' => 0, 'rec_time>' => date('Y-m-d H:i:s')];
|
||||
$where = [
|
||||
'biz_id' => $biz_id, 'status' => 0, 'un_lock' => 0, 'rid>' => 0,
|
||||
// 'rec_time>' => date('Y-m-d H:i:s')
|
||||
];
|
||||
$unlock_count = $this->customers_model->count($where);
|
||||
$customer_op_list[] = ['title' => '待解锁客户(人)', 'icon' => 'icon-daifenpei', 'total' => $unlock_count, 'page' => '/pages/customer/index'];
|
||||
} else {
|
||||
|
||||
@@ -21,6 +21,15 @@ class Receiver_customers_model extends HD_Model
|
||||
//解锁状态
|
||||
const UNLOCK_STATUS = 0; //未解锁
|
||||
const LOCK_STATUS = 1; //已解锁
|
||||
const LOCK_STATUS_2 = 2; //不解锁
|
||||
const LOCK_LIST = [
|
||||
self::UNLOCK_STATUS => '未解锁',
|
||||
self::LOCK_STATUS => '已解锁',
|
||||
self::LOCK_STATUS_2 => '不解锁'
|
||||
];
|
||||
const LOCK_REASON = [
|
||||
"线索重叠", "非精准线索"
|
||||
];
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user