|
@@ -43,10 +43,13 @@ class Index extends Base
|
|
|
$where=[["status","<>",0]];
|
|
|
if($param['goodName']!='') $where[]=['goodName','like','%'.$param['goodName'].'%'];
|
|
|
if($param['code']!='') $where[]=['code','like','%'.$param['code'].'%'];
|
|
|
- $list = GodTemp::with(['tax_info'])->where($where)->order('id desc')->paginate(['page'=>$param['page'],'list_rows'=>$param['size']])->each(function($item) use($param){
|
|
|
- $inTax = TaxCompany::where(['companyNo'=>$param['companyNo'],'tax_id'=>$item['tax_id']])->findOrEmpty();
|
|
|
- $item['inTax']=$inTax->income??0;
|
|
|
- });
|
|
|
+ if($param['companyNo']!=''){
|
|
|
+ $inTax = TaxCompany::with(['tax'])->where(['companyNo'=>$param['companyNo'],'income'=>1])->select();
|
|
|
+ $magerCode= array_column($inTax->toArray(),'merge_code');
|
|
|
+ $where[]=['cat_code','in',$magerCode];
|
|
|
+ }
|
|
|
+
|
|
|
+ $list = GodTemp::with(['tax_info'])->where($where)->order('id desc')->paginate(['page'=>$param['page'],'list_rows'=>$param['size']]);
|
|
|
return success("获取成功",['list'=>$list->items(),'count'=>$list->total()]);
|
|
|
}
|
|
|
|