|
@@ -0,0 +1,83 @@
|
|
|
+<?php
|
|
|
+
|
|
|
+namespace app\admin\controller;
|
|
|
+
|
|
|
+use app\BaseController;
|
|
|
+use think\App;
|
|
|
+use think\facade\Db;
|
|
|
+
|
|
|
+class Proorder extends BaseController
|
|
|
+{
|
|
|
+public $post="";
|
|
|
+public function __construct(App $app)
|
|
|
+{
|
|
|
+ parent::__construct($app);
|
|
|
+ $this->post=$this->request->post();
|
|
|
+}
|
|
|
+//public function llist(){
|
|
|
+// $page = isset($this->post['page']) && $this->post['page'] !==""? intval($this->post['page']) :"1";
|
|
|
+// $size = isset($this->post['size']) && $this->post['size'] !==""? intval($this->post['size']) :"10";
|
|
|
+// $where =[['c.is_del',"=",0]];
|
|
|
+// $count = Db::name('process')->alias('a')
|
|
|
+// ->join("process_order b","b.order_type=a.process_type","left")
|
|
|
+// ->join("action_process c","c.pid=a.id","left")
|
|
|
+// ->where($where)->count();
|
|
|
+// $total = ceil("$count/$size");
|
|
|
+// $page = $page>$total ? $total:$page;
|
|
|
+// $list = Db::name('process')->alias('a')
|
|
|
+// ->join("process_order b","b.order_type=a.process_type","left")
|
|
|
+// ->join("action_process c","c.pid=a.id","left")
|
|
|
+// ->field('b.order_type,b.order_code,c.order_name,b.action_process')
|
|
|
+// ->where($where)->page($page,$size)->order("a.addtime desc")->select();
|
|
|
+// return app_show(0,"获取成功",['list'=>$list,'count'=>$count]);
|
|
|
+//}
|
|
|
+public function list(){
|
|
|
+ $page = isset($this->post['page']) && $this->post['page'] !==""? intval($this->post['page']) :"1";
|
|
|
+ $size = isset($this->post['size']) && $this->post['size'] !==""? intval($this->post['size']) :"10";
|
|
|
+ $where =[['is_del',"=",0]];
|
|
|
+ $count = Db::name('workflow')->where($where)->count();
|
|
|
+ $total = ceil("$count/$size");
|
|
|
+ $page = $page>$total ? $total:$page;
|
|
|
+ $list = Db::name('workflow')
|
|
|
+ ->where($where)->page($page,$size)->order("addtime desc")->select();
|
|
|
+ $data=[];
|
|
|
+ foreach ($list as $value){
|
|
|
+ $str = Db::name("process_order")->where(['order_type'=>$value['order_type']])->find();
|
|
|
+ $value['order_type']=$str['order_type'];
|
|
|
+ $value['order_status']=$str['order_status'];
|
|
|
+ $data[]=$value;
|
|
|
+ }
|
|
|
+ return app_show(0,"获取成功",['count'=>$count,'list'=>$data]);
|
|
|
+}
|
|
|
+public function waitlist(){
|
|
|
+ $page = isset($this->post['page']) && $this->post['page'] !==""? intval($this->post['page']) :"1";
|
|
|
+ $size = isset($this->post['size']) && $this->post['size'] !==""? intval($this->post['size']) :"10";
|
|
|
+ $where = [['is_del',"=",0]];
|
|
|
+ $order_code= isset($this->post['order_code']) && $this->post['order_code'] !==""? intval($this->post['order_code']):"";
|
|
|
+ if($order_code!=""){
|
|
|
+ $where[]= ["order_code",'like',"%order_code%"];
|
|
|
+ }
|
|
|
+ $apply_id = isset($this->post['apply_id']) && $this->post['apply_id'] !==""? trim($this->post['apply_id']) :"";
|
|
|
+ if($apply_id!=""){
|
|
|
+ $where[]=["apply_id","=",$apply_id];
|
|
|
+ }
|
|
|
+ $action_uid = isset($this->post['action_uid']) && $this->post['action_uid'] !==""? trim($this->post['action_uid']) :"";
|
|
|
+ if($action_uid!=""){
|
|
|
+ $where[]=["action_uid","=",$action_uid];
|
|
|
+ }
|
|
|
+ $count = Db::name('workflow')->where($where)->count();
|
|
|
+ $total = ceil("$count/$size");
|
|
|
+ $page = $page>$total ? $total:$page;
|
|
|
+ $list = Db::name("workflow")
|
|
|
+ ->field("apply_id,apply_name,addtime,action_uid,action_name,order_status,order_type")
|
|
|
+ ->where($where)->page($page,$size)->order("addtime desc")->select();
|
|
|
+ $data=[];
|
|
|
+ foreach ($list as $value) {
|
|
|
+ $str = Db::name("process_order")->where(['order_type' => $value['order_type']])->find();
|
|
|
+ $value['order_code'] = $str['order_code'];
|
|
|
+ $value['action_process'] = $str['action_process'];
|
|
|
+ $data[] = $value;
|
|
|
+ }
|
|
|
+ return app_show(0,"获取成功",['count'=>$count,"list"=>$data]);
|
|
|
+}
|
|
|
+}
|