|
@@ -1914,17 +1914,23 @@ class OrderInv extends BaseController{
|
|
|
* @throws \think\db\exception\ModelNotFoundException
|
|
|
*/
|
|
|
public function tikcetList(){
|
|
|
- $post=$this->request->only(["invNo"=>"","page"=>1,"size"=>15],"post","trim");
|
|
|
+ $post=$this->request->only(["invNo"=>"","companyNo"=>"","relaComNo"=>"","page"=>1,"size"=>15],"post","trim");
|
|
|
$where=[];
|
|
|
- if($post["invNo"]!="") $where[]=["invNo","=",$post['invNo']];
|
|
|
+ if($post["invNo"]!="") $where[]=["a.invNo","=",$post['invNo']];
|
|
|
+ if($post["companyNo"]!="") $where[]=["b.inv_out","=",$post['companyNo']];
|
|
|
+ if($post["relaComNo"]!="") $where[]=["b.inv_out","=",$post['relaComNo']];
|
|
|
+
|
|
|
$count=Db::name("invoice_ticket")->where($where)->count();
|
|
|
$total =ceil($count/$post['size']);
|
|
|
$page= $post['page']>$total ? intval($total):intval($post['page']);
|
|
|
$list = Db::name("invoice_ticket")
|
|
|
+ ->alias("a")
|
|
|
+ ->leftJoin("invoice_pool b","a.invNo=b.invNo")
|
|
|
->where($where)
|
|
|
- ->json(["item"])
|
|
|
+ ->field("a.*")
|
|
|
+ ->json(["a.item"])
|
|
|
->page($page,intval($post['size']))
|
|
|
- ->order("id desc")
|
|
|
+ ->order("a.id desc")
|
|
|
->select()->toArray();
|
|
|
$typename=["004"=>"增值税专用发票",'007'=>"增值税普通发票",'026'=>'增值税电子普通发票','028'=>'增值税电子专用发票'];
|
|
|
foreach ($list as &$value){
|