wugg 2 سال پیش
والد
کامیت
8db8391dc5
1فایلهای تغییر یافته به همراه25 افزوده شده و 5 حذف شده
  1. 25 5
      app/admin/controller/OrderInv.php

+ 25 - 5
app/admin/controller/OrderInv.php

@@ -1406,16 +1406,36 @@ class OrderInv extends BaseController{
            $condition[]=["a.apply_name","like","%$apply_name%"];
         }
         $count=Db::name("invoice_pool")->alias("a")
-        ->leftJoin("invoice_pool_info b","a.invNo=b.invNo")
-        ->leftJoin("invoice_ticket c","a.invNo=c.invNo and c.type=0")
+	        ->rightJoin("invoice_pool_info b","a.invNo=b.invNo")
+        ->leftJoin("invoice_ticket c","a.invNo=c.invNo and c.type=0 and c.is_del=0")
         ->where($condition)->count();
         $total =ceil($count/$size);
         $page= $page>$total ? intval($total):$page;
         $list=Db::name("invoice_pool")->alias("a")
-        ->leftJoin("invoice_pool_info b","a.invNo=b.invNo")
+        ->rightJoin("invoice_pool_info b","a.invNo=b.invNo")
         ->leftJoin("invoice_ticket c","a.invNo=c.invNo and c.type=0 and c.is_del=0")
-        ->where($condition)->field("b.*,a.*,c.inv_code,c.inv_number,c.open_date,c.type")
-        ->page($page,$size)->order("a.addtime desc")->select()->toArray();
+        ->where($condition)
+        ->field("a.id,
+						a.invNo,
+						a.apply_id,
+						a.apply_name,
+						a.status,
+						a.inv_value,
+						a.inv_type,
+						a.buyer_check,
+						a.seller_check,
+						a.exam_remark,
+						a.check_remark,
+						a.inv_company,
+						a.inv_out,
+						b.buyer_title,
+						b.seller_title,
+						a.addtime,
+						c.inv_code,
+						c.inv_number,
+						c.open_date,
+						c.type")
+        ->page($page,$size)->order("a.id desc")->select()->toArray();
         return app_show(0,"获取成功",["list"=>$list,"count"=>$count]);
     }
 		//红冲申请