param(); $con = []; $this->validate($params, ['locale' => 'require']); $con = Tool::getOptionalQuery(['i18n_lang_type_guid', '='],['c.i18n_lang_type_code', '=', 'locale']); $query = ModelHomeVideo::where($con) ->alias('a') ->leftjoin('i18n_lang_type c', 'a.i18n_lang_type_guid = c.i18n_lang_type_guid') ->field([ 'a.home_video_id', 'a.home_video_guid', 'a.i18n_lang_type_guid', 'a.home_video_cover', 'c.i18n_lang_type_code', 'a.home_video_url' ]) ->order('home_video_create_time', 'desc') ->select(); return msg(0, "获取首页视频列表成功!", [ 'data' => $query, 'count' => count($query) ]); } /** * 获取首页视频详情 */ public function getHomeVideoInfo(Request $request): array { $params = $request->param(); $this->validate($params, ['home_video_guid' => 'require']); $find = ModelHomeVideo::field([ 'home_video_id', 'home_video_guid', 'i18n_lang_type_guid', 'home_video_url' ]) ->where('home_video_guid', $params['home_video_guid']) ->find(); return msg(0, '获取首页视频详情成功!', ['data' => $find]); } }