wugg 2 年 前
コミット
d53129ed97
1 ファイル変更15 行追加14 行削除
  1. 15 14
      app/admin/controller/Payment.php

+ 15 - 14
app/admin/controller/Payment.php

@@ -15,7 +15,7 @@ class Payment extends BaseController
     public function paymentList()
     {
         $post = $this->post;
-        $condition = "a.is_del!=0 ";
+        $condition = "a.is_del=0 ";
         $check = checkRole($this->roleid,49);
         if($check){
             $condition .=" and `a`.`apply_id` = {$this->uid}";
@@ -1030,22 +1030,22 @@ class Payment extends BaseController
     public function InvList()
     {
         $post = $this->post;
-        $condition = [["is_del","=",0 ]];
+        $condition = [["a.is_del","=",0 ],["b.is_del","=",0 ]];
         $invtype = isset($post['invType'])&&$post['invType']!='' ? intval($post['invType']):"";
         if ($invtype!=''){
-            $condition[]=["invType","=",$invtype];
+            $condition[]=["a.invType","=",$invtype];
         }
         $hpNo = isset($post['hpNo'])&&$post['hpNo']!='' ? trim($post['hpNo']):"";
         if ($hpNo!=''){
-            $condition[]=["hpNo","like","%$hpNo%"];
+            $condition[]=["a.hpNo","like","%$hpNo%"];
         }
          $invoiceType = isset($post['invoiceType'])&&$post['invoiceType']!='' ? intval($post['invoiceType']):"";
         if ($invoiceType!=''){
-            $condition[]=["invoiceType","=",$invoiceType];
+            $condition[]=["a.invoiceType","=",$invoiceType];
         }
         $status = isset($post['status'])&&$post['status']!="" ? intval($post['status']):"";
         if($status!=""){
-           $condition[]=["status","=",$status];
+           $condition[]=["a.status","=",$status];
         }
         $invNumber = isset($post['invNumber'])&&$post['invNumber']!="" ? trim($post['invNumber']):"";
         if($invNumber!=''){
@@ -1058,34 +1058,35 @@ class Payment extends BaseController
         }
         $start = isset($post['start']) && $post['start']!="" ? $post['start'] :"";
         if($start!=""){
-            $condition[]=["addtime",">=",$start." 00:00:00"];
+            $condition[]=["a.addtime",">=",$start." 00:00:00"];
         }
         $end = isset($post['end']) && $post['end']!="" ? $post['end'] :"";
         if($end!=""){
-            $condition[]=["addtime","<=",$end." 23:59:59"];
+            $condition[]=["a.addtime","<=",$end." 23:59:59"];
         }
          $open_start = isset($post['open_start']) && $post['open_start']!="" ? $post['open_start'] :"";
         if($open_start!=""){
-            $condition[]=["open_time",">=",$open_start." 00:00:00"];
+            $condition[]=["a.open_time",">=",$open_start." 00:00:00"];
         }
         $open_end = isset($post['open_end']) && $post['open_end']!="" ? $post['open_end'] :"";
         if($open_end!=""){
-            $condition[]=["open_time","<=",$open_end." 23:59:59"];
+            $condition[]=["a.open_time","<=",$open_end." 23:59:59"];
         }
         $apply_id = isset($post['apply_id']) && $post['apply_id']!="" ? $post['apply_id'] :"";
         if($apply_id!=""){
-            $condition[]=["apply_id","=",$apply_id];
+            $condition[]=["a.apply_id","=",$apply_id];
         }
         $apply_name = isset($post['apply_name']) && $post['apply_name']!="" ? trim($post['apply_name']):"";
         if($apply_name!=""){
-            $condition[]=["apply_name","like","%$apply_name%"];
+            $condition[]=["a.apply_name","like","%$apply_name%"];
         }
         $page = isset($post['page'])&&$post['page']!="" ? intval($post['page']):1;
         $size = isset($post['size'])&&$post['size']!="" ? intval($post['size']):10;
-        $count =Db::name("pay_invoice")->where($condition)->count();
+        $count =Db::name("pay_invoice")->alias("a")->leftJoin("pay b","a.payNo=b.payNo")->where($condition)->count();
         $total = ceil($count/$size);
         $page = $page>$total? intval($total):$page;
-        $list = Db::name("pay_invoice")->where($condition)->page($page,$size)->select();
+        $list = Db::name("pay_invoice")->alias("a")->leftJoin("pay b","a.payNo=b.payNo")->field("a.*")->where
+        ($condition)->page($page,$size)->select();
         return app_show(0,"获取成功",["list"=>$list,"count"=>$count]);
     }