Seller.php
1.94 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
<?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(UNDER_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();
}
}