|
@@ -22,8 +22,6 @@ class Customer extends Model
|
|
|
|
|
|
public static $user = [];
|
|
public static $user = [];
|
|
public static $search = [];
|
|
public static $search = [];
|
|
- public static $is_search = false;
|
|
|
|
- public static $is_pond_state = true;
|
|
|
|
public static $limitKey = "customerPondState";
|
|
public static $limitKey = "customerPondState";
|
|
const range_function = 'customerRange';
|
|
const range_function = 'customerRange';
|
|
|
|
|
|
@@ -33,16 +31,9 @@ class Customer extends Model
|
|
self::$user = $attributes['userData'];
|
|
self::$user = $attributes['userData'];
|
|
self::$search = $attributes['search'];
|
|
self::$search = $attributes['search'];
|
|
self::$user['range_function'] = self::range_function;
|
|
self::$user['range_function'] = self::range_function;
|
|
- self::$is_search = true;
|
|
|
|
- if(! empty(self::$search['pond_state'])) self::$is_pond_state = false;
|
|
|
|
|
|
+ //进入公海池 去掉限制
|
|
|
|
+ if(! empty(self::$search['pond_state'])) static::addGlobalScope(new DepartmentScope(self::$user, self::$search));
|
|
}
|
|
}
|
|
parent::__construct($attributes);
|
|
parent::__construct($attributes);
|
|
}
|
|
}
|
|
-
|
|
|
|
- protected static function boot(){
|
|
|
|
- parent::boot();
|
|
|
|
- if(self::$is_search && self::$is_pond_state){
|
|
|
|
- static::addGlobalScope(new DepartmentScope(self::$user, self::$search));
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
}
|
|
}
|