'integer', 'account_type' => 'integer', 'belong_id' => 'integer', 'account_id' => 'integer', 'category_id' => 'integer']; public static function list(array $param) { $model = (new self()); if (isset($param['account_type']) && $param['account_type'] != '') { $model = $model->where('account_type', $param['account_type']); } if (isset($param['belong_id']) && $param['belong_id'] != '') { $model = $model->where('belong_id', $param['belong_id']); } if (isset($param['account_id']) && $param['account_id'] != '') { $model = $model->where('account_id', $param['account_id']); } if (isset($param['category_id']) && $param['category_id'] != '') { $model = $model->where('category_id', $param['category_id']); } if (isset($param['ori_name']) && $param['ori_name'] != '') { $model = $model->where('ori_name', "like", "%{$param['ori_name']}%"); } if (isset($param['type']) && $param['type'] != '') { $model = $model->where('type', $param['type']); } return $model->orderByDesc("asset_id") ->select(["asset_id", "file_name", "ori_name", "url", "type", "mime", "size", "create_time"]) ->paginate((int)$param['limit']); } public static function move(array $data) { if (!isset($data['ids']) || count($data['ids']) == 0) { return false; } return self::whereIn('asset_id', $data['ids'])->update([ 'category_id' => $data['category_id'] ]); } }