|
@@ -358,11 +358,22 @@ class RangeService extends Service
|
|
->get()->toArray();
|
|
->get()->toArray();
|
|
$sales_order_id = array_unique(array_column($sales_order_id,'sales_order_id'));
|
|
$sales_order_id = array_unique(array_column($sales_order_id,'sales_order_id'));
|
|
|
|
|
|
|
|
+ $bool = ! empty($search['top_depart_id']) && ! empty($user['is_all_depart']);
|
|
|
|
+ if(! $bool){
|
|
|
|
+ $current_top_depart_id = $user['depart_top'][0] ?? [];
|
|
|
|
+ $current_top_depart_id = $current_top_depart_id['depart_id'] ?? 0;
|
|
|
|
+ $sales_order_id = SalesOrder::whereIn('id', $sales_order_id)
|
|
|
|
+ ->where('top_depart_id',$current_top_depart_id)
|
|
|
|
+ ->select('id')
|
|
|
|
+ ->get()->toArray();
|
|
|
|
+ $sales_order_id = array_column($sales_order_id,'sales_order_id');
|
|
|
|
+ }
|
|
|
|
+
|
|
//指派后 可见范围id
|
|
//指派后 可见范围id
|
|
$return = Self::getRangeDataId($user,SeeRange::type_seven);
|
|
$return = Self::getRangeDataId($user,SeeRange::type_seven);
|
|
|
|
|
|
$return_id = array_unique(array_merge_recursive($sales_order_id,$return));
|
|
$return_id = array_unique(array_merge_recursive($sales_order_id,$return));
|
|
- if(! empty($search['top_depart_id']) && ! empty($user['is_all_depart'])){
|
|
|
|
|
|
+ if($bool){
|
|
$id = DB::table('sales_order')
|
|
$id = DB::table('sales_order')
|
|
->where('del_time',0)
|
|
->where('del_time',0)
|
|
->where('top_depart_id',$search['top_depart_id'])
|
|
->where('top_depart_id',$search['top_depart_id'])
|