From 14ba00d116766ea1c0160e85b3d5a537f8e8178c Mon Sep 17 00:00:00 2001 From: lccsw <1127794702@qq.com> Date: Tue, 27 Jul 2021 18:56:21 +0800 Subject: [PATCH] edit-admin-app_config --- admin/controllers/app/App.php | 20 +++++++++++++--- admin/controllers/app/liche/Main.php | 9 ------- admin/controllers/app/licheb/Main.php | 8 ------- admin/controllers/receiver/Customer.php | 20 ++++++++++++++-- admin/views/app/appusual/lists.php | 24 ++++++++++++++++++- api/controllers/wxapp/licheb/Customerlogs.php | 13 ++++++++-- api/controllers/wxapp/licheb/Customers.php | 6 ++--- api/controllers/wxapp/licheb/Sms.php | 4 +++- api/controllers/wxapp/licheb/User.php | 12 ++++++---- 9 files changed, 82 insertions(+), 34 deletions(-) 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 @@