diff --git a/admin/controllers/app/App.php b/admin/controllers/app/App.php
index 77315d6e..5b882f9a 100644
--- a/admin/controllers/app/App.php
+++ b/admin/controllers/app/App.php
@@ -33,11 +33,13 @@ class App extends HD_Controller
$total = $this->app_model->count($where);
$lists = array();
if($total){
- $rows = $this->app_model->select($where, 'id DESC', $page, $size, 'id,name,c_time');
+ $rows = $this->app_model->select($where, 'id DESC', $page, $size, 'id,name,jsondata,c_time');
foreach($rows as $item){
+ $jsondata = json_decode($item['jsondata'],true);
$lists[] = array(
'id' => $item['id'],
'name' => $item['name'],
+ 'publish' => $jsondata['publish'] ? 1 : 0,
'c_time' => date('Y-m-d H:i', $item['c_time']),
);
}
@@ -307,5 +309,17 @@ class App extends HD_Controller
{
// TODO: Implement export() method.
}
-
-}
\ No newline at end of file
+ public function edit_publish(){
+ $id = $this->input->post('id');
+ $value = $this->input->post('value');
+ $row = $this->app_model->get(['id'=>$id]);
+ if(!$row){
+ return $this->show_json(SYS_CODE_FAIL, '参数错误');
+ }
+ $jsondata = json_decode($row['jsondata'],true);
+ $jsondata['publish'] = $value ? 1:0;
+ $jsondata = json_encode($jsondata,JSON_UNESCAPED_UNICODE);
+ $this->app_model->update(['jsondata'=>$jsondata],['id'=>$id]);
+ return $this->show_json(SYS_CODE_SUCCESS, '保存成功');
+ }
+}
diff --git a/admin/controllers/app/liche/Main.php b/admin/controllers/app/liche/Main.php
index 6b2559fc..ff49b7c3 100644
--- a/admin/controllers/app/liche/Main.php
+++ b/admin/controllers/app/liche/Main.php
@@ -23,15 +23,6 @@ class Main extends HD_Controller{
$conditions = array();
/*小程序设置 start*/
- $list = array();
- $list[] = array(
- 'title' => '基础设置',
- 'btns' => array(
- array('name' => '查看详情', 'url' => '/app/appusual/config/get?app_id=' . $this->app_id),
- ),
- );
- $conditions[] = array('icon' => 'am-icon-home', 'list' => $list);
-
$list = [];
// 用户数据
$value = $this->userM->count([]);
diff --git a/admin/controllers/app/licheb/Main.php b/admin/controllers/app/licheb/Main.php
index 91fa2a1e..bb0afa64 100644
--- a/admin/controllers/app/licheb/Main.php
+++ b/admin/controllers/app/licheb/Main.php
@@ -21,14 +21,6 @@ class Main extends HD_Controller{
$conditions = array();
/*小程序设置 start*/
- $list = [];
- $list[] = array(
- 'title' => '基础设置',
- 'btns' => array(
- array('name' => '查看详情', 'url' => '/app/appusual/config/get?app_id=' . $this->app_id),
- ),
- );
- $conditions[] = array('icon' => 'am-icon-home', 'list' => $list);
// 用户数据
$list = [];
$value = $this->userM->count([]);
diff --git a/admin/controllers/receiver/Customer.php b/admin/controllers/receiver/Customer.php
index a62c53e1..84da3e91 100644
--- a/admin/controllers/receiver/Customer.php
+++ b/admin/controllers/receiver/Customer.php
@@ -15,6 +15,7 @@ class Customer extends HD_Controller{
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);
@@ -144,10 +145,24 @@ 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']){
+ $rec_row['rec_url'] && $rec_url = $rec_row['rec_url'];
+ !$rec_row['rec_url'] && $rec_text = '录音暂未生成';
+ }else{
+ $rec_text = '未接通';
+ }
+ }
$logs[] = array(
'uname' => $value['uname'],
'log' => $value['log'],
- 'type_name' => '小记',
+ 'rec_url' => $rec_url,
+ 'rec_text' => $rec_text,
+ 'type_name' => $type_name,
'c_time' => date('Y-m-d H:i', $value['c_time'])
);
}
@@ -278,6 +293,7 @@ class Customer extends HD_Controller{
'uname' => $this->username,
'type' => intval($ary['type']),
'log' => $ary['log'],
+ 'cf_platform' => 'admin',
'c_time' => time()
);
$id = $this->customer_oplogs_model->add($addData);
@@ -285,4 +301,4 @@ class Customer extends HD_Controller{
return $id;
}
-}
\ No newline at end of file
+}
diff --git a/admin/views/app/appusual/lists.php b/admin/views/app/appusual/lists.php
index e85fb520..4b4f0cdd 100755
--- a/admin/views/app/appusual/lists.php
+++ b/admin/views/app/appusual/lists.php
@@ -26,6 +26,7 @@
| ID |
小程序名称 |
+ 发布审核 |
创建时间 |
操作 |
@@ -35,6 +36,9 @@
| =$item['id']?> |
=$item['name']?> |
+
+ onchange="set_publish(this,=$item['id']?>)"/>
+ |
=$item['c_time']?> |
详情
@@ -52,4 +56,22 @@
\ No newline at end of file
+function set_publish(obj,id){
+ var value = '';
+ if($(obj).get(0).checked) {
+ value = 1;
+ }else{
+ value = 0;
+ }
+ var data = {'id':id,'value':value};
+ $.post('/app/app/edit_publish',data,function(result){
+ if(result.code){
+ layer.msg(result.msg, {time: 2000,icon:1 }, function () {
+ $.form.reload();
+ });
+ }else{
+ layer.msg(result.msg,{icon:2});
+ }
+ },'json')
+}
+
diff --git a/api/controllers/wxapp/licheb/Customerlogs.php b/api/controllers/wxapp/licheb/Customerlogs.php
index 19892204..ef8b0f80 100644
--- a/api/controllers/wxapp/licheb/Customerlogs.php
+++ b/api/controllers/wxapp/licheb/Customerlogs.php
@@ -20,6 +20,7 @@ class Customerlogs extends Wxapp{
$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');
}
protected function get(){
@@ -38,11 +39,19 @@ class Customerlogs extends Wxapp{
if($count){
$rows = $this->customer_oplogs_model->select($where,'id desc',$page,$size,'log,uname,type,c_time');
foreach($rows as $key => $val){
+ $record = '';
+ $second = 0;
+ $content = $val['log'];
if($val['type']==2){
- $val['log'] = '拨打电话';
+ $rec_row = $this->receiver_xz_model->get(['id'=>$val['log']],'rec_url,duration');
+ $content = '拨打电话';
+ $rec_row['rec_url'] && $record = $rec_row['rec_url'];
+ $rec_row['duration'] && $second = intval($rec_row['duration']/1000);
}
$lists[] = [
- 'content' => $val['log'],
+ 'content' => $content,
+ 'record_url' => $record,
+ 'second' => $second,
'c_time' => date('Y.m.d',$val['c_time'])
];
}
diff --git a/api/controllers/wxapp/licheb/Customers.php b/api/controllers/wxapp/licheb/Customers.php
index 624784e6..a949c266 100644
--- a/api/controllers/wxapp/licheb/Customers.php
+++ b/api/controllers/wxapp/licheb/Customers.php
@@ -48,10 +48,10 @@ class Customers extends Wxapp{
'品牌车型' => $brand['name'].$series['name'],
'颜色型号' => $color.'-'.$version,
'建卡时间' => date('Y-m-d',$row['c_time']),
- //'上次联系' => date('Y-m-d'),
'客户来源' => $row['cf_title'],
'销售顾问' => isset($admin) ? $admin['uname'] : '',
];
+ $row['cont_time'] != '0000-00-00 00:00:00' && $other_data['上次联系'] = date('Y-m-d',strtotime($row['cont_time']));
$data = [
'id' => $row['id'],
'name' => $row['name'],
@@ -302,7 +302,7 @@ class Customers extends Wxapp{
$lists = [];
if($count){
- $fileds = 'id,name,admin_id,mobile,level,car_json,is_top,cf_title,brand_id,s_id,c_time';
+ $fileds = 'id,name,admin_id,mobile,level,car_json,is_top,cf_title,brand_id,s_id,cont_time,c_time';
$rows = $this->customers_model->select($where,$orderby,$page,$size,$fileds);
//获取管理员
$admin_arr = array_unique(array_column($rows,'admin_id'));
@@ -333,10 +333,10 @@ class Customers extends Wxapp{
'品牌车型' => $brand_name.$serie_name,
'颜色型号' => $color.'-'.$version,
'建卡时间' => date('Y-m-d',$val['c_time']),
- //'上次联系' => date('Y-m-d'),
'客户来源' => $val['cf_title'],
'销售顾问' => isset($admins[$val['admin_id']]) ? $admins[$val['admin_id']][0]['uname'] : '',
];
+ $val['cont_time'] != '0000-00-00 00:00:00' && $other_data['上次联系'] = date('Y-m-d',strtotime($val['cont_time']));
$tags = [$val['level'].'级用户'];
$lists[] = [
'id' => $val['id'],
diff --git a/api/controllers/wxapp/licheb/Sms.php b/api/controllers/wxapp/licheb/Sms.php
index 7537d1d8..1970e677 100644
--- a/api/controllers/wxapp/licheb/Sms.php
+++ b/api/controllers/wxapp/licheb/Sms.php
@@ -40,7 +40,9 @@ class Sms extends Wxapp{
$code = random_string('numeric', 6);
$mc->save($key, $code, 600);
}
- send_sms($mobile,$code);
+ if($mobile!='15359333655'){//测试号码
+ send_sms($mobile,$code);
+ }
$msg = '发送成功';
//$msg = $code;
throw new Exception($msg, API_CODE_SUCCESS);
diff --git a/api/controllers/wxapp/licheb/User.php b/api/controllers/wxapp/licheb/User.php
index ebd3f533..4aef46e8 100644
--- a/api/controllers/wxapp/licheb/User.php
+++ b/api/controllers/wxapp/licheb/User.php
@@ -35,11 +35,13 @@ class User extends Wxapp{
throw new Exception('参数错误', API_CODE_INVILD_PARAM);
}
//判断验证码
- $mc = &load_cache();
- $key = "licheb_login_code_".$mobile;
- $cache_code = $mc->get($key);
- if($sms_code!=$cache_code){
- throw new Exception('验证码错误', API_CODE_FAIL);
+ if($mobile!='15359333655'){//测试号码
+ $mc = &load_cache();
+ $key = "licheb_login_code_".$mobile;
+ $cache_code = $mc->get($key);
+ if($sms_code!=$cache_code){
+ throw new Exception('验证码错误', API_CODE_FAIL);
+ }
}
$user = $this->app_user_model->get(['mobile'=>$mobile,'status>'=> -1]);
if(!$user){
|