Seller.php
6.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
<?php
namespace app\admin\controller;
use think\Db;
use think\facade\Request;
class Seller extends Common
{
/********************************打印机管理*******************************/
/**
* 商家list
*/
public function sellerList(){
if(Request::isAjax()){
$data = Request::except('file');
$key= input('post.key') ? input('post.key') : "";
$limit = '&x='.$data["page"].'&y='.$data["limit"].'&keywords='.@$key['id'];
//获取运营人员列表
$list= file_get_contents(ON_LINE.'App.Seller.GetSellerList'.$limit);
$array = json_decode($list,TRUE);
foreach ($array['data'][0]['data'] as $key => $value) {
$array['data'][0]['data'][$key]['cdate'] = date("Y-m-d H:i:s",$value['cdate']);
if($value['status']==1)
$array['data'][0]['data'][$key]['statusVal'] = "启用";
else
$array['data'][0]['data'][$key]['statusVal'] = "停用";
}
return $result = ['code'=>0,'msg'=>'获取成功!','data'=>$array['data'][0]['data'],'count'=>$array['data'][0]['total'],'rel'=>1];
}
$this->assign ( 'title','商户菜品配置');
return $this->fetch();
}
/**
* 停用商家
*/
public function configStop(){
if(Request::isAjax()){
$data = Request::except('file');
$data['status'] = $data['status'] ? 0 : 1;
$list= file_get_contents(ON_LINE.'App.Seller.SetStopBySeller&sellerid='.$data['sellerid'].'&status='.$data['status']);
$array = json_decode($list,TRUE);
if($array['ret']==200){
$result['code'] = 1;
$result['msg'] = 'SUCCESS!';
}else{
$result['code'] = 0;
$result['msg'] = '请求错误!';
}
return $result;
}
return view();
}
/**
* 从商家维度统计:订单、短信等情况
*/
public function getStatistics(){
if(Request::isAjax()){
$data = Request::except('file');
$key= input('post.key') ? input('post.key') : "";
$sid = $data['sid'] ? implode(',', $data['sid']) : '';
$sellername = $data['key'] ? $data['key'] : '';
$stime = $data['stime'] ? strtotime(date($data['stime'],time())) : '';
$etime = $data['etime'] ? strtotime(date($data['etime'],time())) : '';
$parame = '&page='.$data["page"].'&size='.$data["limit"].'&sellername='.@$sellername.'&stime='.@$stime.'&etime='.@$etime.'&type='.@$data['channel'].'&sid='.$sid.'&time_type='.@$data['time_type'];
//获取运营人员列表
$list= file_get_contents(ON_LINE.'App.Report.GetReserveData'.$parame);
$array = json_decode($list,TRUE);
$new_array = array();
foreach ($array['data'] as $key => $value) {
if(is_array($value)){
$new_array[$key]['id'] = $value['id'];
$new_array[$key]['sellername'] = $value['sellername'];
$new_array[$key]['inviting'] = $value['inviting'];
$new_array[$key]['reserve_count'] = $value['appReserveCount'] + $value['AndroidReserveCount'].'('.$value['appReserveCount'] .'/'. $value['AndroidReserveCount'].')';
$new_array[$key]['sms_send_count'] = $value['appSmsCount'] + $value['AndroidSmsCount'].'('.$value['appSmsCount'] .'/'. $value['AndroidSmsCount'].')';
}
}
return $result = [
'code'=>0,'msg'=>'获取成功!',
'data'=>$new_array,
'count'=>$array['data']['total'],
'countReserve'=>"小程序:".$array['data']['appReserveCount']+"电话机:".$array['data']['AndroidReserveCount'],
'countSms'=>"小程序:".$array['data']['appSmsCount']+"电话机:".$array['data']['AndroidSmsCount'],
'inviteeCount'=>$array['data']['inviteeCount'],
'rel'=>1
];
}
$this->assign ( 'title','预定订单统计');
return $this->fetch();
}
/**
* 从设备(电话机)维度统计:订单、短信等情况
*/
public function getEquipment(){
if(Request::isAjax()){
$data = Request::except('file');
$key= input('post.key') ? input('post.key') : "";
$sid = $data['sid'] ? implode(',', $data['sid']) : '';
$sellername = $data['key'] ? $data['key'] : '';
$stime = $data['stime'] ? strtotime(date($data['stime'],time())) : '';
$etime = $data['etime'] ? strtotime(date($data['etime'],time())) : '';
$parame = '&page='.$data["page"].'&size='.$data["limit"].'&sellername='.@$sellername.'&stime='.@$stime.'&etime='.@$etime.'&type='.@$data['channel'].'&sid='.$sid.'&time_type='.@$data['time_type'];
//获取运营人员列表
$list= file_get_contents(UNDER_LINE.'App.Report.GetReserveData'.$parame);
$array = json_decode($list,TRUE);
$new_array = array();
foreach ($array['data'] as $key => $value) {
if(is_array($value)){
$new_array[$key]['id'] = $value['id'];
$new_array[$key]['sellername'] = $value['sellername'];
$new_array[$key]['inviting'] = $value['inviting'];
$new_array[$key]['reserve_count'] = $value['appReserveCount'] + $value['AndroidReserveCount'].'('.$value['appReserveCount'] .'/'. $value['AndroidReserveCount'].')';
$new_array[$key]['sms_send_count'] = $value['appSmsCount'] + $value['AndroidSmsCount'].'('.$value['appSmsCount'] .'/'. $value['AndroidSmsCount'].')';
}
}
return $result = ['code'=>0,'msg'=>'获取成功!','data'=>$new_array,'count'=>$array['data']['total'],'countReserve'=>$array['data']['countReserve'],'countSms'=>$array['data']['countSms'],'rel'=>1];
}
$this->assign ( 'title','预定订单统计');
return $this->fetch();
}
}