|
@@ -59,9 +59,20 @@ class Index extends Base
|
|
|
* @param \think\Request $request
|
|
|
* @return \think\Response
|
|
|
*/
|
|
|
- public function save(Request $request)
|
|
|
+ public function ListV2()
|
|
|
{
|
|
|
- //
|
|
|
+ $param = $this->request->param(['goodName'=>"","code"=>"","companyNo"=>"","page"=>1,"size"=>20],"post",'trim');
|
|
|
+ $where=[["a.status","<>",0],["tax_category.is_del","=",0]];
|
|
|
+ if($param['goodName']!='') $where[]=['a.goodName|tax_category.cat_code|tax_category.cat_name|tax_category.merge_code|tax_category.short_name','like','%'.$param['goodName'].'%'];
|
|
|
+
|
|
|
+ $list = GodTemp::alias('a')->leftJoin("zswh_account_202304.sys_tax_category tax_category",'tax_category.merge_code=a.cat_code')
|
|
|
+ ->where($where)->field("a.id,a.code,a.goodName,a.cat_tax,a.cat_code,a.cat_name,tax_category.cat_code tax_cat_code,
|
|
|
+ tax_category.cat_name tax_cat_name, merge_code,short_name,1 is_check,tax_category.id tax_id")
|
|
|
+ ->order('a.id desc')->paginate(['page'=>$param['page'],'list_rows'=>$param['size']])->each(function ($item,$key)use($param){
|
|
|
+ $inTax = TaxCompany::with(['tax'])->where(['companyNo'=>$param['companyNo'],'income'=>1,'tax_id'=>$item->tax_id])->findOrEmpty();
|
|
|
+ $item->is_check=$inTax->isEmpty()?0:1;
|
|
|
+ });
|
|
|
+ return success("获取成功",['list'=>$list->items(),'count'=>$list->total()]);
|
|
|
}
|
|
|
|
|
|
/**
|