edit-admin-app_config

This commit is contained in:
lccsw
2021-07-27 18:56:21 +08:00
parent e9959a66a0
commit 14ba00d116
9 changed files with 82 additions and 34 deletions
+17 -3
View File
@@ -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.
}
}
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, '保存成功');
}
}
-9
View File
@@ -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([]);
-8
View File
@@ -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([]);
+18 -2
View File
@@ -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;
}
}
}
+23 -1
View File
@@ -26,6 +26,7 @@
<tr>
<th width="10%"><span>ID</span></th>
<th width="30%"><span>小程序名称</span></th>
<th width="10%"><span>发布审核</span></th>
<th width="20%"><span>创建时间</span></th>
<th width="20%"><span>操作</span></th>
</tr>
@@ -35,6 +36,9 @@
<tr>
<td style="vertical-align:middle;word-wrap:break-word"><?=$item['id']?></td>
<td style="vertical-align:middle;word-wrap:break-word"><?=$item['name']?></td>
<td style="vertical-align:middle;word-wrap:break-word">
<input id="publish" type="checkbox" class="mui-switch mui-switch-anim va-mid" true-value="1" false-value="0" <?=$item['publish']?'checked':''?> onchange="set_publish(this,<?=$item['id']?>)"/>
</td>
<td style="vertical-align:middle;word-wrap:break-word"><?=$item['c_time']?></td>
<td style="vertical-align:middle;word-wrap:break-word">
<a class="am-btn am-btn-primary am-btn-xs mr10" href="javascript:void(0);" data-modal="/app/app/get?id=<?=$item['id']?>">详情</a>
@@ -52,4 +56,22 @@
</div>
<script>
</script>
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')
}
</script>
+11 -2
View File
@@ -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'])
];
}
+3 -3
View File
@@ -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'],
+3 -1
View File
@@ -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);
+7 -5
View File
@@ -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){