|
@@ -83,14 +83,15 @@ class Purchin extends Base
|
|
|
$role=$this->checkRole();
|
|
|
$condition="";
|
|
|
if(!empty($role['write'])&& $this->uid!=''){
|
|
|
-// $condition.=["apply_id","in",$role['write']];
|
|
|
- $condition.="a.apply_id in (".implode(",",$role['write']).") or c.contactor = {$this->uid}";
|
|
|
+ $condition.="a.apply_id ={$this->uid} or c.contactor = {$this->uid} or sip.personid 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('purchease_in')->alias('a')->join("purchease_order b","b.cgdNo=a.cgdNo","left")
|
|
|
+ $count = Db::name('purchease_in')->alias('a')
|
|
|
+ ->join("purchease_order b","b.cgdNo=a.cgdNo","left")
|
|
|
+ ->leftJoin('supplier sip', 'sip.code=b.supplierNo')
|
|
|
->leftJoin("warehouse_info c","a.wsm_code=c.wsm_code")
|
|
|
->where($where)->where($condition)->count();
|
|
|
$total = ceil($count/$size);
|
|
@@ -98,6 +99,7 @@ class Purchin extends Base
|
|
|
$list = Db::name('purchease_in')
|
|
|
->alias('a')
|
|
|
->join("purchease_order b","b.cgdNo=a.cgdNo","left")
|
|
|
+ ->leftJoin('supplier sip', 'sip.code=b.supplierNo')
|
|
|
->leftJoin("warehouse_info c","a.wsm_code=c.wsm_code")
|
|
|
->leftJoin("depart_user u", "u.uid=a.apply_id AND u.is_del=0")
|
|
|
->where($where)
|