admin_xzcall_728
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
/**
|
||||
* Created by Vim
|
||||
* User: lcc
|
||||
* Desc: 晓致小号
|
||||
* Date: 2021/4/15
|
||||
* Time: 10:32
|
||||
*/
|
||||
|
||||
$config['mobile_list'] = array(
|
||||
'18916735350','18916689195',
|
||||
);
|
||||
+104
-44
@@ -1008,42 +1008,26 @@ class Common extends CI_Controller
|
||||
*/
|
||||
public function show_sms()
|
||||
{
|
||||
$mobile = $this->input->get('mobile');
|
||||
$type = intval($this->input->get('type'));
|
||||
$type = $this->input->get('type');
|
||||
$id = intval($this->input->get('id'));
|
||||
if (!$id || !$type) {
|
||||
return $this->show_json(SYS_CODE_FAIL, '参数错误!');
|
||||
}
|
||||
if ($type == 'clues') {
|
||||
$this->load->model('receiver/receiver_clues_model', 'mdClues');
|
||||
$re = $this->mdClues->get(array('id' => $id));
|
||||
} else if ($type == 'customer') {
|
||||
$this->load->model('receiver/receiver_customers_model', 'mdCustomers');
|
||||
$re = $this->mdCustomers->get(array('id' => $id));
|
||||
}
|
||||
if (!$re['mobile']) {
|
||||
return $this->show_json(SYS_CODE_FAIL, '客户不存在!');
|
||||
}
|
||||
$mobile = $re['mobile'];
|
||||
$content = '';
|
||||
$mobile_edit = 0;
|
||||
if ($type == 1) {
|
||||
$mobile_sub = $mobile ? substr_replace($mobile, '****', 3, 4) : '';
|
||||
} else if ($type == 2) {
|
||||
$content = '尊敬的合作伙伴您好!我是好店云的客服,已为您分配了一个订单,请及时登录好店云小程序进行处理,感谢您的支持与配合,祝您生活愉快!';
|
||||
if ($id) {
|
||||
$this->load->model('app/jdb/receiver_orders_model', 'mdReceiverOrders');
|
||||
$this->load->model('user/user_biz_model', 'mdUserBiz');
|
||||
$this->load->model('user/user_model', 'mdUser');
|
||||
$reOrders = $this->mdReceiverOrders->get(array('id' => $id), 'brand_id,biz_id');
|
||||
$reUserBiz = array();
|
||||
if ($reOrders['biz_id']) {
|
||||
$reUserBiz = $this->mdUserBiz->select(array('biz_id' => $reOrders['biz_id'], 'type' => 1)
|
||||
, 'id ASC', 0, 0, 'uid');
|
||||
} else if ($reOrders['brand_id']) {
|
||||
$reUserBiz = $this->mdUserBiz->select(array('brand_id' => $reOrders['brand_id'], 'type' => 0)
|
||||
, 'id ASC', 0, 0, 'uid');
|
||||
}
|
||||
if ($reUserBiz) {
|
||||
foreach ($reUserBiz as $key => $value) {
|
||||
$reUser = $this->mdUser->get(array('uid' => $value['uid'], 'status' => 1), 'mobile');
|
||||
$reUser['mobile'] && $mobile = $mobile ? $mobile . ',' . $reUser['mobile'] : $reUser['mobile'];
|
||||
}
|
||||
}
|
||||
}
|
||||
$mobile_sub = $mobile;
|
||||
$mobile_edit = 1;
|
||||
} else {
|
||||
$mobile_sub = $mobile ? substr_replace($mobile, '****', 3, 4) : '';
|
||||
}
|
||||
$mobile_sub = $mobile ? substr_replace($mobile, '*****', 0, 5) : '';
|
||||
$this->data['mobile_sub'] = $mobile_sub;
|
||||
$this->data['mobile'] = $mobile;
|
||||
$this->data['mobile_edit'] = $mobile_edit;
|
||||
$this->data['id'] = $id;
|
||||
$this->data['type'] = $type;
|
||||
@@ -1060,13 +1044,20 @@ class Common extends CI_Controller
|
||||
*/
|
||||
public function send_sms()
|
||||
{
|
||||
$mobile = $this->input->post('mobile');
|
||||
$content = $this->input->post('content');
|
||||
$type = intval($this->input->post('type'));
|
||||
$type = $this->input->post('type');
|
||||
$id = intval($this->input->post('id'));
|
||||
if (!$mobile) {
|
||||
return $this->show_json(SYS_CODE_FAIL, '请输入手机号');
|
||||
if ($type == 'clues') {
|
||||
$this->load->model('receiver/receiver_clues_model', 'mdClues');
|
||||
$re = $this->mdClues->get(array('id' => $id));
|
||||
} else if ($type == 'customer') {
|
||||
$this->load->model('receiver/receiver_customers_model', 'mdCustomers');
|
||||
$re = $this->mdCustomers->get(array('id' => $id));
|
||||
}
|
||||
if (!$re['mobile']) {
|
||||
return $this->show_json(SYS_CODE_FAIL, '客户不存在!');
|
||||
}
|
||||
$mobile = $re['mobile'];
|
||||
if (!$content) {
|
||||
return $this->show_json(SYS_CODE_FAIL, '请输入短信内容');
|
||||
}
|
||||
@@ -1076,11 +1067,7 @@ class Common extends CI_Controller
|
||||
if (mb_strlen($content) > 300) {
|
||||
return $this->show_json(SYS_CODE_FAIL, '短信最多300个字');
|
||||
}
|
||||
if ($type == 1) {
|
||||
$content = '【狸车】' . $content;
|
||||
} else if ($type == 2) {
|
||||
$content = '【好店云】' . $content;
|
||||
}
|
||||
$content = '【狸车】' . $content;
|
||||
$plaintext = '';
|
||||
if (strstr($mobile, ',')) { //多个手机号
|
||||
$mobiles = explode(',', $mobile);
|
||||
@@ -1097,16 +1084,21 @@ class Common extends CI_Controller
|
||||
$this->data['content'] = $content;
|
||||
$this->data['result'] = $plaintext;
|
||||
if ($plaintext) {
|
||||
if ($id && $type == 1) {
|
||||
$this->load->model('receiver/receiver_clue_oplogs_model', 'mdOplogs');
|
||||
if ($id) {
|
||||
$data = array(
|
||||
'clue_id' => $id,
|
||||
'uid' => $this->uid,
|
||||
'uname' => $this->username,
|
||||
'type' => 1,
|
||||
'log' => $content,
|
||||
'c_time' => time()
|
||||
);
|
||||
if ($type == 'clues') {
|
||||
$this->load->model('receiver/receiver_clue_oplogs_model', 'mdOplogs');
|
||||
$data['clue_id'] = $id;
|
||||
} else if ($type == 'customer') {
|
||||
$this->load->model('receiver/receiver_customer_oplogs_model', 'mdOplogs');
|
||||
$data['customer_id'] = $id;
|
||||
}
|
||||
$this->mdOplogs->add($data);//增加操作记录
|
||||
}
|
||||
return $this->show_json(SYS_CODE_SUCCESS, '发送短信成功');
|
||||
@@ -1115,6 +1107,74 @@ class Common extends CI_Controller
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Notes:绑定晓致虚似号手机
|
||||
* Created on: 2021/7/28 11:17
|
||||
* Created by: dengbw
|
||||
* @return bool
|
||||
*/
|
||||
public function bind_mobile()
|
||||
{
|
||||
$params = $this->input->get();
|
||||
$id = intval($params['id']);
|
||||
$type = $params['type'];
|
||||
if (!$id || !$type) {
|
||||
return $this->show_json(SYS_CODE_FAIL, '参数错误!');
|
||||
}
|
||||
$this->load->model('receiver/receiver_xz_model', 'mdReceiverXz');
|
||||
if ($type == 'clues') {
|
||||
$this->load->model('receiver/receiver_clues_model', 'mdClues');
|
||||
$re = $this->mdClues->get(array('id' => $id));
|
||||
} else if ($type == 'customer') {
|
||||
$this->load->model('receiver/receiver_customers_model', 'mdCustomers');
|
||||
$re = $this->mdCustomers->get(array('id' => $id));
|
||||
}
|
||||
if (!$re['mobile']) {
|
||||
return $this->show_json(SYS_CODE_FAIL, '客户不存在!');
|
||||
}
|
||||
$mobile = $re['mobile'];
|
||||
$cache = &load_cache('redis');
|
||||
$xz_admin_phone = $cache->get('xz_admin_phone');
|
||||
$middleNumber = '';
|
||||
if ($xz_admin_phone) {
|
||||
$middleNumber = $xz_admin_phone['admins'][$this->uid];
|
||||
}
|
||||
if (!$middleNumber) {
|
||||
return $this->show_json(SYS_CODE_FAIL, '还未分配号码不可使用');
|
||||
}
|
||||
$this->load->helper('order');
|
||||
$seq_id = create_order_no();
|
||||
require_once COMMPATH . 'third_party/Xcall/Xcall.php';
|
||||
$xcall = new Xcall();
|
||||
$result = $xcall->SWbind($mobile, $seq_id, $middleNumber);
|
||||
if ($result['t_code'] == '-26') {//已经绑定解绑
|
||||
$s_res = $xcall->Searchbind($middleNumber);
|
||||
$bined_mobile = $s_res['data']['value'];//已绑定手机号
|
||||
if ($bined_mobile) {
|
||||
$xcall->SWunbind($bined_mobile, $middleNumber);//解绑
|
||||
$result = $xcall->SWbind($mobile, $seq_id, $middleNumber);
|
||||
}
|
||||
}
|
||||
if ($result['code']) {
|
||||
$this->data['middlenumber'] = $result['data']['virtualMobile'];
|
||||
$add_data = [
|
||||
'call_id' => $seq_id,
|
||||
'display_number' => $result['data']['virtualMobile'],
|
||||
'cf_id' => $id,
|
||||
'cf_uid' => $this->uid,
|
||||
'cf_title' => $type,
|
||||
'cf_platform' => 'admin',
|
||||
'c_time' => time()
|
||||
];
|
||||
$this->mdReceiverXz->add($add_data);
|
||||
} else {
|
||||
return $this->show_json(SYS_CODE_FAIL, $result['msg']);
|
||||
}
|
||||
$this->data['mobile_sub'] = substr_replace($mobile, '*****', 0, 5);
|
||||
$this->data['id'] = $id;
|
||||
$this->show_view('common/bind_mobile');
|
||||
}
|
||||
|
||||
/**
|
||||
* Notes: 获取七牛token
|
||||
* Created on: 2020/4/16 14:27
|
||||
|
||||
@@ -69,6 +69,7 @@ class Clues extends HD_Controller
|
||||
$val['cf_title'] = isset($cf_rows[$val['cf_id']]) ? $cf_rows[$val['cf_id']][0]['title'] : '';
|
||||
$val['status_name'] = $status_arr[$val['status']];
|
||||
$val['admin_name'] = isset($admin_rows[$val['admin_id']]) ? $admin_rows[$val['admin_id']][0]['uname'] : '';
|
||||
$val['mobile_sub'] = $val['mobile'] ? substr_replace($val['mobile'], '*****', 0, 5) : '';
|
||||
$lists[] = $val;
|
||||
}
|
||||
}
|
||||
@@ -116,7 +117,7 @@ class Clues extends HD_Controller
|
||||
$rec_text = '未接通';
|
||||
$row = $this->mdReceiverXz->get(array('id' => $value['log']));
|
||||
if ($row['duration']) {
|
||||
$rec_url = $row['rec_url'] ? build_qiniu_image_url($row['rec_url'], 0,0,'video') : '';
|
||||
$rec_url = $row['rec_url'] ? build_qiniu_image_url($row['rec_url'], 0, 0, 'video') : '';
|
||||
$rec_text = '录音文件未生成';
|
||||
}
|
||||
}
|
||||
@@ -467,61 +468,6 @@ class Clues extends HD_Controller
|
||||
return $this->show_json(SYS_CODE_SUCCESS, '分配成功!');
|
||||
}
|
||||
|
||||
//晓致绑定手机号
|
||||
public function get_xbind()
|
||||
{
|
||||
$params = $this->input->get();
|
||||
$id = intval($params['id']);
|
||||
if (!$id) {
|
||||
return $this->show_json(SYS_CODE_FAIL, '参数错误!');
|
||||
}
|
||||
$re = $this->clues_model->get(array('id' => $id));
|
||||
if (!$re['mobile']) {
|
||||
return $this->show_json(SYS_CODE_FAIL, '客户不存在!');
|
||||
}
|
||||
$mobile = $re['mobile'];
|
||||
$cache = &load_cache('redis');
|
||||
$xz_admin_phone = $cache->get($this->cacheKeyPhone);
|
||||
$middleNumber = '';
|
||||
if ($xz_admin_phone) {
|
||||
$middleNumber = $xz_admin_phone['admins'][$this->uid];
|
||||
}
|
||||
if (!$middleNumber) {
|
||||
return $this->show_json(SYS_CODE_FAIL, '还未分配号码不可使用');
|
||||
}
|
||||
$this->load->helper('order');
|
||||
$seq_id = create_order_no();
|
||||
require_once COMMPATH . 'third_party/Xcall/Xcall.php';
|
||||
$xcall = new Xcall();
|
||||
$result = $xcall->SWbind($mobile, $seq_id, $middleNumber);
|
||||
if ($result['t_code'] == '-26') {//已经绑定解绑
|
||||
$s_res = $xcall->Searchbind($middleNumber);
|
||||
$bined_mobile = $s_res['data']['value'];//已绑定手机号
|
||||
if ($bined_mobile) {
|
||||
$xcall->SWunbind($bined_mobile, $middleNumber);//解绑
|
||||
$result = $xcall->SWbind($mobile, $seq_id, $middleNumber);
|
||||
}
|
||||
}
|
||||
if ($result['code']) {
|
||||
$this->data['middlenumber'] = $result['data']['virtualMobile'];
|
||||
$add_data = [
|
||||
'call_id' => $seq_id,
|
||||
'display_number' => $result['data']['virtualMobile'],
|
||||
'cf_id' => $id,
|
||||
'cf_uid' => $this->uid,
|
||||
'cf_title' => 'clues',
|
||||
'cf_platform' => 'admin',
|
||||
'c_time' => time()
|
||||
];
|
||||
$this->mdReceiverXz->add($add_data);
|
||||
} else {
|
||||
return $this->show_json(SYS_CODE_FAIL, $result['msg']);
|
||||
}
|
||||
$this->data['mobile_sub'] = substr_replace($mobile, '*****', 0, 5);
|
||||
$this->data['id'] = $id;
|
||||
$this->show_view('receiver/clues/edit_xbind');
|
||||
}
|
||||
|
||||
public function lists_call()
|
||||
{
|
||||
$this->load->model('sys/sys_admin_model', 'mdAdmin');
|
||||
@@ -573,11 +519,12 @@ class Clues extends HD_Controller
|
||||
}
|
||||
$cache = &load_cache('redis');
|
||||
$xz_admin_phone = $cache->get($this->cacheKeyPhone);
|
||||
$mobiles = $this->mdReceiverXz->get_mobiles('admin');
|
||||
shuffle($mobiles);
|
||||
$this->config->load('xcall', TRUE);
|
||||
$mobiles = $this->config->item('mobile_list', 'xcall');
|
||||
$mobiles && shuffle($mobiles);
|
||||
if ($type == 0) {//分配手机
|
||||
if (!$mobiles) {
|
||||
return $this->show_json(SYS_CODE_FAIL, '暂无虚似号');
|
||||
return $this->show_json(SYS_CODE_FAIL, '无号码库!');
|
||||
}
|
||||
$number = '';
|
||||
foreach ($mobiles as $key => $value) {
|
||||
@@ -602,7 +549,10 @@ class Clues extends HD_Controller
|
||||
return $this->show_json(SYS_CODE_SUCCESS, '取消分配成功');
|
||||
} else if ($type == 3) {//全部重新分配
|
||||
if (!$mobiles) {
|
||||
return $this->show_json(SYS_CODE_FAIL, '暂无虚似号');
|
||||
return $this->show_json(SYS_CODE_FAIL, '无号码库!');
|
||||
}
|
||||
if (!$xz_admin_phone['admins']) {
|
||||
return $this->show_json(SYS_CODE_FAIL, '未分配号码,不能重置');
|
||||
}
|
||||
$xz_admin_phone_new = array();
|
||||
$i = 0;
|
||||
|
||||
@@ -1,31 +1,36 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: xuxb
|
||||
* Date: 2021/7/26
|
||||
* Time: 11:20
|
||||
*/
|
||||
class Customer extends HD_Controller{
|
||||
class Customer extends HD_Controller
|
||||
{
|
||||
private $searchTpAry = array('mobile' => '客户手机号', 'name' => '客户姓名');
|
||||
|
||||
protected $log_dir;
|
||||
|
||||
public function __construct(){
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->load->model('receiver/receiver_customers_model', 'customers_model');
|
||||
$this->load->model('receiver/receiver_customer_oplogs_model', 'customer_oplogs_model');
|
||||
$this->load->model('receiver/receiver_xz_model');
|
||||
$this->load->model('app/licheb/app_licheb_users_model');
|
||||
$this->load->model("biz/biz_model");
|
||||
$this->log_dir = 'receiver_'. get_class($this);
|
||||
$this->log_dir = 'receiver_' . get_class($this);
|
||||
}
|
||||
|
||||
public function index(){
|
||||
public function index()
|
||||
{
|
||||
return $this->lists();
|
||||
}
|
||||
|
||||
public function lists(){
|
||||
public function lists()
|
||||
{
|
||||
$status_arr = $this->customers_model->get_status();
|
||||
unset($status_arr['-1']);
|
||||
$params = $this->input->get();
|
||||
@@ -53,17 +58,18 @@ class Customer extends HD_Controller{
|
||||
|
||||
$count = $this->customers_model->count($where);
|
||||
$lists = [];
|
||||
if($count){
|
||||
if ($count) {
|
||||
$fileds = 'id,name,mobile,cf_title,c_time,admin_id,status';
|
||||
$rows = $this->customers_model->select($where,'id desc',$page,$size,$fileds);
|
||||
$rows = $this->customers_model->select($where, 'id desc', $page, $size, $fileds);
|
||||
//获取销售员
|
||||
$admin_id_arr = array_unique(array_column($rows,'admin_id'));
|
||||
$admin_id_arr && $admin_rows = $this->app_licheb_users_model->get_map_by_ids($admin_id_arr,'id,uname');
|
||||
foreach($rows as $key => $val){
|
||||
$admin_id_arr = array_unique(array_column($rows, 'admin_id'));
|
||||
$admin_id_arr && $admin_rows = $this->app_licheb_users_model->get_map_by_ids($admin_id_arr, 'id,uname');
|
||||
foreach ($rows as $key => $val) {
|
||||
$lists[] = array(
|
||||
'id' => $val['id'],
|
||||
'name' => $val['name'],
|
||||
'mobile' => $val['mobile'] ? substr_replace($val['mobile'], '****', 3, 4) : '',
|
||||
'mobile' => $val['mobile'],
|
||||
'mobile_sub' => $val['mobile'] ? substr_replace($val['mobile'], '*****', 0, 5) : '',
|
||||
'cf_title' => $val['cf_title'],
|
||||
'status_name' => $status_arr[$val['status']],
|
||||
'admin_name' => isset($admin_rows[$val['admin_id']]) ? $admin_rows[$val['admin_id']][0]['uname'] : '',
|
||||
@@ -80,7 +86,8 @@ class Customer extends HD_Controller{
|
||||
return $this->show_view('receiver/customer/lists', true);
|
||||
}
|
||||
|
||||
public function get(){
|
||||
public function get()
|
||||
{
|
||||
$id = $this->input->get('id');
|
||||
|
||||
$this->load->model("biz/biz_model");
|
||||
@@ -88,12 +95,12 @@ class Customer extends HD_Controller{
|
||||
$this->load->model('auto/auto_series_model');
|
||||
|
||||
$row = $this->customers_model->get(array('id' => $id));
|
||||
if(!$row){
|
||||
if (!$row) {
|
||||
return $this->show_json(SYS_CODE_FAIL, '客户不存在!');
|
||||
}
|
||||
|
||||
$if_driver = 1 == $row['if_driver'] ? '是':'否';
|
||||
$is_top = 1 == $row['is_top'] ? '是':'否';
|
||||
$if_driver = 1 == $row['if_driver'] ? '是' : '否';
|
||||
$is_top = 1 == $row['is_top'] ? '是' : '否';
|
||||
$car_json = json_decode($row['car_json'], true);
|
||||
$side = $car_json['version']['title'] ? $car_json['version']['title'] : '';
|
||||
$color = $car_json['color']['title'] ? $car_json['color']['title'] : '';
|
||||
@@ -102,7 +109,7 @@ class Customer extends HD_Controller{
|
||||
$row_brand = $this->auto_brand_model->get(array('id' => $row['brand_id']), 'name');
|
||||
$row_seriy = $this->auto_series_model->get(array('id' => $row['s_id']), 'name');
|
||||
//获取销售员
|
||||
$row_admin = $this->app_licheb_users_model->get(array('id' => $row['admin_id']),'id,uname');
|
||||
$row_admin = $this->app_licheb_users_model->get(array('id' => $row['admin_id']), 'id,uname');
|
||||
|
||||
//操作日志
|
||||
$rows_log = $this->customer_oplogs_model->select(array('customer_id' => $id), 'c_time desc', 0, 0);
|
||||
@@ -111,7 +118,7 @@ class Customer extends HD_Controller{
|
||||
$info = array(
|
||||
'id' => $row['id'],
|
||||
'name' => $row['name'],
|
||||
'mobile' => substr_replace($row['mobile'], '****', 3, 4),
|
||||
'mobile' => $row['mobile'] ? substr_replace($row['mobile'], '*****', 0, 5) : '',
|
||||
'cf_title' => $row['cf_title'],
|
||||
'c_time' => date('Y-m-d H:i:s', $row['c_time']),
|
||||
'status' => $row['status'],
|
||||
@@ -145,15 +152,13 @@ class Customer extends HD_Controller{
|
||||
//操作日志
|
||||
$logs = array();
|
||||
foreach ($rows_log as $key => $value) {
|
||||
$type_name = '小记';
|
||||
$rec_text = $rec_url = '';
|
||||
if($value['type']==2){
|
||||
$type_name = '拨打电话';
|
||||
$rec_row = $this->receiver_xz_model->get(['id'=>$value['log']],'rec_url,duration');
|
||||
if($rec_row['duration']){
|
||||
if ($value['type'] == 2) {
|
||||
$rec_row = $this->receiver_xz_model->get(['id' => $value['log']], 'rec_url,duration');
|
||||
if ($rec_row['duration']) {
|
||||
$rec_row['rec_url'] && $rec_url = $rec_row['rec_url'];
|
||||
!$rec_row['rec_url'] && $rec_text = '录音暂未生成';
|
||||
}else{
|
||||
} else {
|
||||
$rec_text = '未接通';
|
||||
}
|
||||
}
|
||||
@@ -162,7 +167,7 @@ class Customer extends HD_Controller{
|
||||
'log' => $value['log'],
|
||||
'rec_url' => $rec_url,
|
||||
'rec_text' => $rec_text,
|
||||
'type_name' => $type_name,
|
||||
'type_name' => $this->customer_oplogs_model->typeAry()[$value['type']],
|
||||
'c_time' => date('Y-m-d H:i', $value['c_time'])
|
||||
);
|
||||
}
|
||||
@@ -179,7 +184,8 @@ class Customer extends HD_Controller{
|
||||
return $this->show_view('receiver/customer/get', true);
|
||||
}
|
||||
|
||||
public function add(){
|
||||
public function add()
|
||||
{
|
||||
// TODO: Implement add() method.
|
||||
}
|
||||
|
||||
@@ -187,7 +193,8 @@ class Customer extends HD_Controller{
|
||||
* 新增日志
|
||||
* @return bool
|
||||
*/
|
||||
function add_log(){
|
||||
function add_log()
|
||||
{
|
||||
$params = $this->input->post();
|
||||
if (!$params['id']) {
|
||||
return $this->show_json(SYS_CODE_FAIL, '参数错误!');
|
||||
@@ -216,14 +223,15 @@ class Customer extends HD_Controller{
|
||||
* 编辑
|
||||
* @return bool
|
||||
*/
|
||||
public function edit(){
|
||||
public function edit()
|
||||
{
|
||||
$info = $this->input->post('info');
|
||||
if (!$info) {
|
||||
return $this->show_json(SYS_CODE_FAIL, '非法参数!');
|
||||
}
|
||||
|
||||
$row = $this->customers_model->get(array('id' => $info['id']));
|
||||
if(!$row){
|
||||
if (!$row) {
|
||||
return $this->show_json(SYS_CODE_FAIL, '客户信息不存在!');
|
||||
}
|
||||
|
||||
@@ -264,15 +272,18 @@ class Customer extends HD_Controller{
|
||||
return $this->show_json($code, $msg);
|
||||
}
|
||||
|
||||
public function del(){
|
||||
public function del()
|
||||
{
|
||||
// TODO: Implement del() method.
|
||||
}
|
||||
|
||||
public function batch(){
|
||||
public function batch()
|
||||
{
|
||||
// TODO: Implement batch() method.
|
||||
}
|
||||
|
||||
public function export(){
|
||||
public function export()
|
||||
{
|
||||
// TODO: Implement export() method.
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
<form class="am-form am-form-horizontal" action="<?= $url ?>" data-auto="true" method="post"
|
||||
style="width: 90%;padding-top: 10px">
|
||||
<input type="hidden" name="mobile" value="<?= $mobile ?>">
|
||||
<input type="hidden" name="id" value="<?= $id ?>">
|
||||
<input type="hidden" name="type" value="<?= $type ?>">
|
||||
<div class="am-form-group">
|
||||
|
||||
@@ -59,7 +59,7 @@
|
||||
</span>
|
||||
</div>
|
||||
<div class="am-panel-bd am-g">
|
||||
<table width="100%" style="margin:10px 10px 10px 20px;">
|
||||
<table width="100%" style="margin:0px 0px 10px 0px;">
|
||||
<tr>
|
||||
<td class="table-td">
|
||||
<div class="input-group">
|
||||
@@ -101,13 +101,13 @@
|
||||
<div class="am-form-inline" style="padding-right: 40px;padding-top: 10px;">
|
||||
<div class="text-right pt10">
|
||||
<div class="am-form-group ml10">
|
||||
<a data-modal="/common/show_sms?id=<?= $info['id'] ?>&mobile=<?= $info['mobile'] ?>&type=1"
|
||||
<a data-modal="/common/show_sms?id=<?= $info['id'] ?>&type=clues"
|
||||
data-title="发送短信"
|
||||
class="am-btn am-btn-sm am-btn-success">短信</a>
|
||||
</div>
|
||||
<div class="am-form-group ml10">
|
||||
<a href="javascript:void(0);"
|
||||
data-modal="/receiver/clues/get_xbind?id=<?= $info['id'] ?>"
|
||||
data-modal="/common/bind_mobile?id=<?= $info['id'] ?>&type=clues"
|
||||
class="am-btn am-btn-sm am-btn-success" data-title="获取手机号">
|
||||
拨打电话
|
||||
</a>
|
||||
@@ -131,8 +131,7 @@
|
||||
</span>
|
||||
</div>
|
||||
<div class="am-panel-bd am-g">
|
||||
<table width="100%"
|
||||
style="margin:10px 10px 10px 20px;">
|
||||
<table width="100%" style="margin:0px 0px 10px 0px;">
|
||||
<tr>
|
||||
<td class="table-td">
|
||||
<div class="input-group">
|
||||
@@ -455,7 +454,7 @@
|
||||
}
|
||||
|
||||
.input-group-addon {
|
||||
padding: 0px 10px 0px 0px;
|
||||
padding: 0px 0px 0px 0px;
|
||||
font-size: 1.6rem;
|
||||
font-weight: normal;
|
||||
line-height: 0px;
|
||||
@@ -464,7 +463,7 @@
|
||||
background-color: #fff;
|
||||
border: 0px solid #fff;
|
||||
border-radius: 0px;
|
||||
width: 120px;
|
||||
width: 110px;
|
||||
}
|
||||
|
||||
.table-td {
|
||||
|
||||
@@ -72,7 +72,8 @@
|
||||
|
||||
<div class="am-form-group fl ml10">
|
||||
<button type="button" class="am-btn am-btn-success am-btn-sm w100"
|
||||
data-modal="/receiver/clues/get_add" data-title="新增线索">新增</button>
|
||||
data-modal="/receiver/clues/get_add" data-title="新增线索">新增
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -102,7 +103,7 @@
|
||||
<td><input type="checkbox" name="ids[]" class="order-ids"
|
||||
value="<?= $v['id'] ?>"/></td>
|
||||
<td><?= $v['name'] ?></td>
|
||||
<td><?= $v['mobile'] ?></td>
|
||||
<td><?= $v['mobile_sub'] ?></td>
|
||||
<td><?= $v['cf_title'] ?></td>
|
||||
<td><?= $v['status_name'] ?></td>
|
||||
<td><?= $v['admin_name'] ?></td>
|
||||
@@ -114,14 +115,14 @@
|
||||
<div class="col-md-4 align-l">
|
||||
</div>
|
||||
<div class="col-md-8 align-r" style="padding-right: 30px;">
|
||||
<a href="javascript:void(0);"
|
||||
data-modal="/receiver/clues/get_xbind?id=<?= $v['id'] ?>"
|
||||
class="am-btn am-btn-primary am-btn-xs" data-title="获取手机号">拨打电话</a>
|
||||
<a data-modal="/common/show_sms?id=<?= $v['id'] ?>&mobile=<?= $v['mobile'] ?>&type=1"
|
||||
data-title="发送短信"
|
||||
class="am-btn am-btn-primary am-btn-xs">短信</a>
|
||||
<a href="javascript:void(0);" data-open="/receiver/clues/get?id=<?= $v['id'] ?>"
|
||||
class="am-btn am-btn-primary am-btn-xs">查看详情</a>
|
||||
<a data-modal="/common/bind_mobile?id=<?= $v['id'] ?>&type=clues"
|
||||
href="javascript:void(0);" class="am-btn am-btn-primary am-btn-xs"
|
||||
data-title="获取手机号">拨打电话</a>
|
||||
<a data-modal="/common/show_sms?id=<?= $v['id'] ?>&type=clues"
|
||||
href="javascript:void(0);" class="am-btn am-btn-primary am-btn-xs"
|
||||
data-title="发送短信">短信</a>
|
||||
<a data-open="/receiver/clues/get?id=<?= $v['id'] ?>&type=clues"
|
||||
href="javascript:void(0);" class="am-btn am-btn-primary am-btn-xs">查看详情</a>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -197,14 +198,14 @@
|
||||
return $.form.modal("/receiver/clues/get_adviser?ids=" + ids, 'open_type=modal', "分配顾问");
|
||||
}
|
||||
|
||||
function load_clue(){
|
||||
function load_clue() {
|
||||
var file = $("#clue-file");
|
||||
if (file.val() == '') {
|
||||
layer.msg('文件是空的');
|
||||
return 0;
|
||||
}
|
||||
var loading = layer.load(1, {
|
||||
shade: [0.1,'#fff'] //0.1透明度的白色背景
|
||||
shade: [0.1, '#fff'] //0.1透明度的白色背景
|
||||
});
|
||||
|
||||
var options = {
|
||||
@@ -213,7 +214,7 @@
|
||||
dataType: "json",
|
||||
data: {},
|
||||
success: function (res) {
|
||||
if(1 == res.code){
|
||||
if (1 == res.code) {
|
||||
layer.msg(res.msg, {
|
||||
icon: 1,
|
||||
time: 2000
|
||||
@@ -230,8 +231,8 @@
|
||||
$("#import-form").ajaxSubmit(options);
|
||||
}
|
||||
|
||||
$(function(){
|
||||
$("#import").click(function(){
|
||||
$(function () {
|
||||
$("#import").click(function () {
|
||||
$("#clue-file").val('');
|
||||
layer.open({
|
||||
type: 1,
|
||||
|
||||
@@ -73,24 +73,24 @@
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<!--<td colspan="3">
|
||||
<td colspan="3">
|
||||
<div class="am-form-inline" style="padding-right: 40px;padding-top: 10px;">
|
||||
<div class="text-right pt10">
|
||||
<div class="am-form-group ml10">
|
||||
<a data-modal="/common/show_sms?id=<?= $info['id'] ?>&mobile=<?= $info['mobile'] ?>&type=1"
|
||||
<a data-modal="/common/show_sms?id=<?= $info['id'] ?>&type=customer"
|
||||
data-title="发送短信"
|
||||
class="am-btn am-btn-sm am-btn-success">短信</a>
|
||||
</div>
|
||||
<div class="am-form-group ml10">
|
||||
<a href="javascript:void(0);"
|
||||
data-modal="/receiver/clues/get_xbind?id=<?= $info['id'] ?>"
|
||||
data-modal="/common/bind_mobile?id=<?= $info['id'] ?>&type=customer"
|
||||
class="am-btn am-btn-sm am-btn-success" data-title="获取手机号">
|
||||
拨打电话
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</td>-->
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
@@ -76,28 +76,34 @@
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<template v-for="(v,i) in lists">
|
||||
<tr>
|
||||
<td>{{v.id}}</td>
|
||||
<td>{{v.name}}</td>
|
||||
<td>{{v.mobile}}</td>
|
||||
<td>{{v.cf_title}}</td>
|
||||
<td>{{v.status_name}}</td>
|
||||
<td>{{v.admin_name}}</td>
|
||||
<td>{{v.c_time}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="7">
|
||||
<div class="row">
|
||||
<div class="col-md-4 align-l">
|
||||
</div>
|
||||
<div class="col-md-8 align-r" style="padding-right: 30px;">
|
||||
<a href="javascript:void(0);" :data-open="'/receiver/customer/get?id='+v.id"
|
||||
class="am-btn am-btn-primary am-btn-xs">查看详情</a>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</template>
|
||||
<template v-for="(v,i) in lists">
|
||||
<tr>
|
||||
<td>{{v.id}}</td>
|
||||
<td>{{v.name}}</td>
|
||||
<td>{{v.mobile_sub}}</td>
|
||||
<td>{{v.cf_title}}</td>
|
||||
<td>{{v.status_name}}</td>
|
||||
<td>{{v.admin_name}}</td>
|
||||
<td>{{v.c_time}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="7">
|
||||
<div class="row">
|
||||
<div class="col-md-4 align-l">
|
||||
</div>
|
||||
<div class="col-md-8 align-r" style="padding-right: 30px;">
|
||||
<a :data-modal="'/common/bind_mobile?id='+v.id+'&type=customer'"
|
||||
href="javascript:void(0);" class="am-btn am-btn-primary am-btn-xs"
|
||||
data-title="获取手机号">拨打电话</a>
|
||||
<a :data-modal="'/common/show_sms?id='+v.id+'&type=customer'"
|
||||
href="javascript:void(0);" class="am-btn am-btn-primary am-btn-xs"
|
||||
data-title="发送短信">短信</a>
|
||||
<a href="javascript:void(0);" :data-open="'/receiver/customer/get?id='+v.id"
|
||||
class="am-btn am-btn-primary am-btn-xs">查看详情</a>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</template>
|
||||
</table>
|
||||
</div>
|
||||
<div class="coms-table-ft clearfix">
|
||||
@@ -136,26 +142,26 @@
|
||||
});
|
||||
|
||||
var vue_obj;
|
||||
$(function(){
|
||||
$(function () {
|
||||
vue_obj = new Vue({
|
||||
el: '.coms-table-wrap',
|
||||
data: {
|
||||
params:[],
|
||||
searchTpAry:[],
|
||||
lists:[]
|
||||
params: [],
|
||||
searchTpAry: [],
|
||||
lists: []
|
||||
},
|
||||
mounted:function() {
|
||||
mounted: function () {
|
||||
var vm = this;
|
||||
vm.params = <?=json_encode($params)?>;
|
||||
vm.searchTpAry = <?=json_encode($searchTpAry)?>;
|
||||
vm.lists = <?=json_encode($lists)?>;
|
||||
},
|
||||
methods:{
|
||||
saveEdit:function(){
|
||||
methods: {
|
||||
saveEdit: function () {
|
||||
$("form").submit();
|
||||
}
|
||||
},
|
||||
watch:{}
|
||||
watch: {}
|
||||
});
|
||||
|
||||
<?php page_script($pager) ?>
|
||||
|
||||
@@ -17,9 +17,8 @@ class Xzcall extends HD_Controller
|
||||
parent::__construct();
|
||||
$this->log_file = 'call_xz.log';
|
||||
$this->load->model('receiver/receiver_xz_model');
|
||||
|
||||
$this->load->model('receiver/receiver_customers_model','customers_model');
|
||||
$this->load->model('receiver/order/receiver_orders_model','orders_model');
|
||||
$this->load->model('receiver/receiver_customers_model', 'customers_model');
|
||||
$this->load->model('receiver/order/receiver_orders_model', 'orders_model');
|
||||
}
|
||||
|
||||
public function index()
|
||||
@@ -46,37 +45,42 @@ class Xzcall extends HD_Controller
|
||||
$data['callEnd'] && $up_data['end_time'] = $this->getMsecToMescdate($data['callEnd']);
|
||||
$up_data['json_data'] = json_encode($data, JSON_UNESCAPED_UNICODE);
|
||||
$this->receiver_xz_model->update($up_data, ['id' => $row['id']]);
|
||||
if ($row['cf_id'] && $row['cf_platform'] == 'admin' && $row['cf_title'] == 'clues') { //后台线索池拨打电话回调
|
||||
if ($row['cf_id'] && $row['cf_platform'] == 'admin') { //后台
|
||||
$admin_id = $row['cf_uid'];
|
||||
$this->load->model('sys/sys_admin_model');
|
||||
$this->load->model('receiver/receiver_clue_oplogs_model','mdOplogs');
|
||||
$admin = $this->sys_admin_model->get(array('id' => $admin_id));
|
||||
$addData = array(
|
||||
'clue_id' => $row['cf_id'],
|
||||
'uid' => $admin_id,
|
||||
'uname' => $admin['username'] ? $admin['username'] : '',
|
||||
'type' => 2,//类型 0 普通 1短信 2电话
|
||||
'log' => $row['id'],
|
||||
'c_time' => time()
|
||||
);
|
||||
if ($row['cf_title'] == 'clues') {//线索拨打电话回调
|
||||
$this->load->model('receiver/receiver_clue_oplogs_model', 'mdOplogs');
|
||||
$addData['clue_id'] = $row['cf_id'];
|
||||
} else if ($row['cf_title'] == 'customer') {//客户拨打电话回调
|
||||
$this->load->model('receiver/receiver_customer_oplogs_model', 'mdOplogs');
|
||||
$addData['customer_id'] = $row['cf_id'];
|
||||
}
|
||||
$this->mdOplogs->add($addData);
|
||||
require_once COMMPATH . 'third_party/Xcall/Xcall.php';
|
||||
$xcall = new Xcall();
|
||||
//解绑
|
||||
$xcall->SWunbind($data['to'], $data['virtualMobile']);
|
||||
}elseif($row['cf_id'] && $row['cf_platform'] == 'api'){ //狸车宝
|
||||
require_once COMMPATH.'third_party/Xcall/Xcall.php';
|
||||
} elseif ($row['cf_id'] && $row['cf_platform'] == 'api') { //狸车宝
|
||||
require_once COMMPATH . 'third_party/Xcall/Xcall.php';
|
||||
$xcall = new Xcall();
|
||||
//解绑
|
||||
$result = $xcall -> SWunbind($data['to'],$data['virtualMobile']);
|
||||
if($row['cf_title']=='order'){ //订单
|
||||
$cust = $this->orders_model->get(['id'=>$row['cf_id']]);
|
||||
$result = $xcall->SWunbind($data['to'], $data['virtualMobile']);
|
||||
if ($row['cf_title'] == 'order') { //订单
|
||||
$cust = $this->orders_model->get(['id' => $row['cf_id']]);
|
||||
$this->load->library('receiver/orders_entity');
|
||||
$this->orders_entity->add_log($cust['id'],$row['cf_uid'],$data['uname'],$row['id'],2);
|
||||
}else{ //客户
|
||||
$cust = $this->customers_model->get(['id'=>$row['cf_id']]);
|
||||
$this->orders_entity->add_log($cust['id'], $row['cf_uid'], $data['uname'], $row['id'], 2);
|
||||
} else { //客户
|
||||
$cust = $this->customers_model->get(['id' => $row['cf_id']]);
|
||||
$this->load->library('receiver/customers_entity');
|
||||
$this->customers_entity->add_log($cust['id'],$row['cf_uid'],$data['uname'],$row['id'],2);
|
||||
$this->customers_entity->add_log($cust['id'], $row['cf_uid'], $data['uname'], $row['id'], 2);
|
||||
}
|
||||
//删除redis
|
||||
$cache_key = "XZ_LICHEB_MOBILEB_{$cust['mobile']}_{$row['cf_uid']}";
|
||||
@@ -106,7 +110,7 @@ class Xzcall extends HD_Controller
|
||||
$result = $xcall->getFile($data['getFileUrl'], $data['mid'], $data['tag']);
|
||||
if ($result['code']) { //上传七牛
|
||||
$this->load->library('qiniu');
|
||||
$qiniu = new Qiniu(['type'=>'video']);
|
||||
$qiniu = new Qiniu(['type' => 'video']);
|
||||
$filename = $qiniu->getFileName($data['mid'], 'mp3', 'xz_video_');
|
||||
$q_res = $qiniu->save($filename, $result['data']);
|
||||
if (!$q_res) {
|
||||
|
||||
@@ -16,5 +16,16 @@ class Receiver_customer_oplogs_model extends HD_Model
|
||||
{
|
||||
parent::__construct($this->table_name, 'default');
|
||||
}
|
||||
|
||||
/**
|
||||
* Notes:类型
|
||||
* Created on: 2021/7/27 10:31
|
||||
* Created by: dengbw
|
||||
* @return array
|
||||
*/
|
||||
public function typeAry()
|
||||
{
|
||||
return array(0 => '小记', 1 => '发短信', 2 => '拨打号码');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -15,25 +15,4 @@ class Receiver_xz_model extends HD_Model
|
||||
{
|
||||
parent::__construct($this->table_name, 'default');
|
||||
}
|
||||
|
||||
/**
|
||||
* Notes:虚似号码
|
||||
* Created on: 2021/7/26 14:20
|
||||
* Created by: dengbw
|
||||
* @param string $type
|
||||
* @return array
|
||||
*/
|
||||
public function get_mobiles($type = 'admin')
|
||||
{
|
||||
if ($type == 'api') {//小程序接口专用
|
||||
$mobile = array(
|
||||
'18916735350','18916689195',
|
||||
);
|
||||
} else {//后台专用
|
||||
$mobile = array(
|
||||
'18916735350','18916689195',
|
||||
);
|
||||
}
|
||||
return $mobile;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user