|
@@ -92,7 +92,8 @@ class Purchin extends Base
|
|
|
// }
|
|
|
|
|
|
$role = $this->checkDataShare();
|
|
|
- if (!empty($role[DataGroupModel::$type_全部])) $condition.="a.apply_id in (".implode(",",$role[DataGroupModel::$type_全部]).") or c.contactor = {$this->uid}";
|
|
|
+ if (!empty($role[DataGroupModel::$type_全部])) $condition.="sip.personid in (".implode(",",
|
|
|
+ $role[DataGroupModel::$type_全部]).") or a.apply_id={$this->uid} or c.contactor = {$this->uid}";
|
|
|
|
|
|
$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)];
|
|
@@ -102,6 +103,7 @@ class Purchin extends Base
|
|
|
->alias('a')
|
|
|
->join("purchease_order b","b.cgdNo=a.cgdNo","left")
|
|
|
->leftJoin("warehouse_info c","a.wsm_code=c.wsm_code")
|
|
|
+ ->leftJoin('supplier sip', 'sip.code=b.supplierNo')
|
|
|
->where($where)
|
|
|
->where($condition)
|
|
|
->count();
|
|
@@ -116,7 +118,10 @@ class Purchin extends Base
|
|
|
->where($where)
|
|
|
->where($condition)
|
|
|
->page($page,$size)
|
|
|
- ->field("a.apply_name,a.sendtime,b.order_type,b.order_source,a.status,a.cgdNo,a.wsm_in_code,a.send_num,a.wsm_code,b.good_name,b.spuCode,a.post_company,a.post_code,a.post_fee,a.apply_id,a.wsm_num,a.error_num,a.wait_num,a.status,a.check_name,a.checkid,b.bkcode,b.supplierNo,u.itemid,b.cgder_id,b.cgder,b.good_createrid,b.good_creater")
|
|
|
+ ->field("a.apply_name,a.sendtime,b.order_type,b.order_source,a.status,a.cgdNo,
|
|
|
+ a.wsm_in_code,a.send_num,a.wsm_code,b.good_name,b.spuCode,a.post_company,a.post_code,
|
|
|
+ a.post_fee,a.apply_id,a.wsm_num,a.error_num,a.wait_num,a.status,a.check_name,a.checkid,
|
|
|
+ b.bkcode,b.supplierNo,u.itemid,sip.personid as cgder_id,sip.person as cgder,b.good_createrid,b.good_creater")
|
|
|
->order("a.addtime desc")
|
|
|
->cursor();
|
|
|
$data=[];
|
|
@@ -524,8 +529,8 @@ class Purchin extends Base
|
|
|
if(empty($goon)){
|
|
|
return error_show(1002,"未找到商品数据");
|
|
|
}
|
|
|
- $cat= isset($goon['cat_id']) && $goon['cat_id'] !=0 ? made($goon['cat_id']):[];
|
|
|
- $info['cgder']=$dom['cgder'];
|
|
|
+ $cat= isset($goon['cat_id']) && $goon['cat_id'] !=0 ? made($goon['cat_id']):[];
|
|
|
+ $info['cgder']=Db::name("supplier")->where(["code"=>$dom['supplierNo']])->value("person",'');
|
|
|
$info['spuCode']=$dom['spuCode'];
|
|
|
$info['good_name']=$dom['good_name'];
|
|
|
$info['skuCode']=$dom['skuCode'];
|