|
@@ -5,6 +5,7 @@ namespace app\cxinv\controller;
|
|
|
|
|
|
use app\common\Ocr;
|
|
|
use app\cxinv\model\GodTemp;
|
|
|
+use app\user\model\TaxCompany;
|
|
|
use think\App;
|
|
|
use think\Request;
|
|
|
|
|
@@ -38,11 +39,14 @@ class Index extends Base
|
|
|
//商品库模糊查询
|
|
|
public function List()
|
|
|
{
|
|
|
- $param = $this->request->param(['goodName'=>"","code"=>"","page"=>1,"size"=>20],"post",'trim');
|
|
|
+ $param = $this->request->param(['goodName'=>"","code"=>"","companyNo"=>"","page"=>1,"size"=>20],"post",'trim');
|
|
|
$where=[];
|
|
|
if($param['goodName']!='') $where[]=['goodName','like','%'.$param['goodName'].'%'];
|
|
|
if($param['code']!='') $where[]=['code','like','%'.$param['code'].'%'];
|
|
|
- $list = GodTemp::where($where)->order('id desc')->paginate(['page'=>$param['page'],'list_rows'=>$param['size']]);
|
|
|
+ $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;
|
|
|
+ });
|
|
|
return success("获取成功",['list'=>$list->items(),'count'=>$list->total()]);
|
|
|
}
|
|
|
|