|
@@ -1111,14 +1111,25 @@ class Purchin extends Base
|
|
|
if($status!=""){
|
|
|
$where[]= ["a.status",'=',$status];
|
|
|
}
|
|
|
- $count = Db::name('purchease_return')->alias('a')->join("purchease_order b","b.cgdNo=a.cgdNo","left")
|
|
|
- ->where($where)->count();
|
|
|
+ $role = $this->checkDataShare();
|
|
|
+ if (!empty($role[DataGroupModel::$type_全部])) $where[] = ["a.apply_id", "in", $role[DataGroupModel::$type_全部]];
|
|
|
+
|
|
|
+ $count = Db::name('purchease_return')
|
|
|
+ ->alias('a')
|
|
|
+ ->join("purchease_order b","b.cgdNo=a.cgdNo","left")
|
|
|
+ ->where($where)
|
|
|
+ ->count();
|
|
|
$total = ceil($count / $size);
|
|
|
$page = $page >= $total ? $total : $page;
|
|
|
- $list = Db::name('purchease_return')->alias('a')->join("purchease_order b","b.cgdNo=a.cgdNo","left")
|
|
|
- ->where($where)->page($page,$size)
|
|
|
- ->field("a.*,b.spuCode,b.good_price,b.order_type,b.good_price,b.total_fee,b.good_name")->order("a.addtime desc")
|
|
|
- ->select();
|
|
|
+ $list = Db::name('purchease_return')
|
|
|
+ ->alias('a')
|
|
|
+ ->join("purchease_order b","b.cgdNo=a.cgdNo","left")
|
|
|
+ ->where($where)
|
|
|
+ ->page($page,$size)
|
|
|
+ ->field("a.*,b.spuCode,b.good_price,b.order_type,b.good_price,b.total_fee,b.good_name")
|
|
|
+ ->order("a.addtime desc")
|
|
|
+ ->select()
|
|
|
+ ->toArray();
|
|
|
$data=[];
|
|
|
foreach ($list as $value){
|
|
|
if($value['order_type']==3){
|
|
@@ -1128,6 +1139,11 @@ class Purchin extends Base
|
|
|
}
|
|
|
$value['can']= isset($goon['cat_id']) && $goon['cat_id'] !=0 ? made($goon['cat_id']):[];
|
|
|
$value['return_fee']= round($value['good_price']*$value['return_num'],2);
|
|
|
+
|
|
|
+ //是否具有编辑权限
|
|
|
+ $value['is_allow_update'] = 0;
|
|
|
+ if (in_array($this->roleid, [1, 33]) || in_array($value['apply_id'], $role[DataGroupModel::$type_可编辑])) $value['is_allow_update'] = 1;
|
|
|
+
|
|
|
$data[]=$value;
|
|
|
}
|
|
|
return app_show(0,"获取成功",['list'=>$data,'count'=>$count]);
|