|
@@ -190,17 +190,28 @@ class After extends Base
|
|
|
// $where[]=["a.apply_id","in",$role['write']];
|
|
|
$condition .="a.cgderid = {$this->uid} or a.apply_id in (".implode(',',$role['write']).")";
|
|
|
}
|
|
|
+ $company_name = isset($this->post['company_name']) && $this->post['company_name'] !== "" ? trim($this->post['company_name']) : "";
|
|
|
+ if ($company_name !== "") $where[] = ["a.apply_id", 'in', get_company_item_user_by_name($company_name)];
|
|
|
+
|
|
|
$count=Db::name("order_return")->alias("a")->leftJoin("order_returninfo b","a.returnCode=b.returnCode")->where
|
|
|
($where)->where($condition)->count();
|
|
|
$total = ceil($count/$size);
|
|
|
$page = $total>=$page ? $page :$total;
|
|
|
- $list =Db::name("order_return")->alias("a")->leftJoin("order_returninfo b","a.returnCode=b.returnCode")->where($where)
|
|
|
- ->where($condition)->field("a.*,b.return_wsm,b.contactor,b.mobile,b.addr,b.addr_code,b.post_code,b.post_company,b.post_fee,b.gys_remark")->page($page,$size)
|
|
|
- ->order("addtime desc")->select();
|
|
|
+ $list =Db::name("order_return")
|
|
|
+ ->alias("a")
|
|
|
+ ->leftJoin("order_returninfo b","a.returnCode=b.returnCode")
|
|
|
+ ->where($where)
|
|
|
+ ->where($condition)
|
|
|
+ ->field("a.*,b.return_wsm,b.contactor,b.mobile,b.addr,b.addr_code,b.post_code,b.post_company,b.post_fee,b.gys_remark,u.itemid")
|
|
|
+ ->page($page,$size)
|
|
|
+ ->leftJoin("depart_user u", "u.uid=a.apply_id AND u.is_del=0")
|
|
|
+ ->order("addtime desc")
|
|
|
+ ->cursor();
|
|
|
$data=[];
|
|
|
foreach ($list as $value){
|
|
|
$customer = Db::name("customer_info")->where(["companyNo"=>$value['customer_code']])->find();
|
|
|
$value['customer_name'] = isset($customer['companyName']) ?trim($customer['companyName']):'';
|
|
|
+ $value['company_name'] = implode('/', array_column(GetPart($value['itemid']), 'name'));
|
|
|
$data[]=$value;
|
|
|
}
|
|
|
return app_show(0,"获取成功",['list'=>$data,"count"=>$count]);
|