* +---------------------------------------------------------------------- */ namespace App\Http\Model\Cloud; use App\Http\Model\BaseModel; /** * 云盘权限. */ class CloudAuth extends BaseModel { public $timestamps = false; /** * 表名. * @var string */ protected $table = 'folder_auth'; /** * 主键. * @var string */ protected $primaryKey = 'id'; public function scopeFolderId($query, $value) { is_array($value) ? $query->whereIn('folder_id', $value) : $query->where('folder_id', $value); } public function scopeUserId($query, $value) { is_array($value) ? $query->whereIn('user_id', $value) : $query->where('user_id', $value); } public function scopeNotUid($query, $value) { $query->where('uid', '<>', $value); } }