'integer', 'recalled_flag' => 'integer', 'create_id' => 'integer']; /** * 仅管理系统消息 * @param array $param * @return \Hyperf\Contract\LengthAwarePaginatorInterface */ public static function list(array $param) { $model = self::query()->with(["account" => function ($query) { $query->select(['account_id', 'username']); }]); if (isset($param['title']) && $param['title'] != '') { $model = $model->where('title', "like", "%{$param['title']}%"); } return $model->where("type", "system") ->orderByDesc("message_id") ->select(["message_id", "title", "content", "recalled_flag", "create_id", "create_time", "update_time"]) ->paginate((int)$param['limit']); } public function account() { return $this->hasOne(Account::class, 'account_id', 'create_id'); } }