12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- <?php
- namespace app\admin\controller;
- use think\App;
- class Express extends Base{
- public function __construct(App $app) {
- $this->noLogin = ["*"];
- parent::__construct($app);
- $this->model = new \app\admin\model\ExpressData();
- }
- public function List(){
- $param = $this->request->param(['outCode'=>"","outChildCode"=>"","orderCode"=>"","post_code"=>"","post_name"=>"",
- "status"=>"","page"=>1,"size"=>15],"post","trim");
- $where=[];
- if($param['outCode']!='') $where[]=['orderOut.outCode','like',"%".$param['outCode']."%"];
- if($param['outChildCode']!='') $where[]=['orderChild.outChildCode','like',"%".$param['outChildCode']."%"];
- if($param['orderCode']!='') $where[]=['orderOut.orderCode','like',"%".$param['orderCode']."%"];
- if($param['post_code']!='') $where[]=['express_data.post_code','like',"%".$param['post_code']."%"];
- if($param['post_name']!='') $where[]=['express_data.post_name','like',"%".$param['post_name']."%"];
- if($param['status']!='') $where[]=['express_data.status','=',$param['status']];
- $list = $this->model
- ->with(['OrderOut','OrderChild'])
- ->withJoin(["OrderOut","OrderChild"],"LEFT")
- ->where($where)
- ->order('id desc')
- ->paginate(["page"=>$param['page'],"list_rows"=>$param['size']])
- ->visible(["id","outCode","outChildCode","orderCode","post_name","post_code","post_data","post_logo","contactor",
- "mobile","status","dfStatus","ChStatus","post_express","remark","crontab_num","addtime","updatetime","send_status","sender"]);
- return success("获取成功",["list"=>$list->items(),"count"=>$list->total()]);
- }
- public function Info(){
- $param = $this->request->param(['id'=>0],"post","trim");
- $info = $this->model
- ->with(['OrderOut','OrderChild'])
- ->find($param['id']);
- return success("获取成功",$info);
- }
- }
|