scenario = $form::SCENARIO_LIST; $form->attributes = $param; $form->store_id = get_store_id(); return $this->asJson($form->searchForm()); } /** * Undocumented function * * @Author LGL 24963@qq.com * @DateTime 2021-01-06 * @desc: 添加专题分类 * @return void */ public function actionAddTopicType() { $param = post_params(); $form = new TopicTypeForm(); $form->scenario = $form::SCENARIO_ADD; $form->attributes = $param; $form->store_id = get_store_id(); $res = $form->saveTopicType(); return $this->asJson($res); } /** * Undocumented function * * @Author LGL 24963@qq.com * @DateTime 2021-01-06 * @desc: 编辑专题分类 * @return void */ public function actionEditTopicType() { $param = post_params(); $form = new TopicTypeForm(); $form->scenario = $form::SCENARIO_EDIT; $form->attributes = $param; $form->store_id = get_store_id(); $res = $form->saveTopicType(); return $this->asJson($res); } /** * Undocumented function * * @Author LGL 24963@qq.com * @DateTime 2021-01-06 * @desc: 删除专题分类 * @return void */ public function actionDelTopicType() { //主键id用key标识并进行获取 $param = get_params('key'); $form = new TopicTypeForm(); $form->scenario = $form::SCENARIO_DEL; $form->id = $param; $res = $form->delTopicType(); return $this->asJson($res); } /** * Undocumented function * * @Author LGL 24963@qq.com * @DateTime 2021-01-18 * @desc: 修改是否显示 * @return void */ public function actionEditTopicTypeShow() { //主键id用key标识并进行获取 $param = post_params('key'); $form = new TopicTypeForm(); $form->scenario = $form::SCENARIO_EDIT_STATUS; $form->id = $param; $form->is_show = post_params('is_show'); $res = $form->editTopicTypeIsShow(); return $this->asJson($res); } public function actionVideoCatList(){ $param = get_params(); $form = new VideoForm(); $form->keyword = $param['keyword']; $form->status = get_params('status', -1); $form->store_id = get_store_id(); return $this->asJson($form->getVideoCatList()); } public function actionVideoCatEdit(){ $param = post_params(); $form = new VideoForm(); $form->store_id = get_store_id(); $form->keyword = $param['keyword']; $form->id = $param['id']; $form->name = $param['name']; $form->status = $param['status']; return $this->asJson($form->saveVideoCat()); } public function actionChangeVideoCatStatus(){ $param = post_params(); $form = new VideoForm(); $form->ids = $param['ids']; $form->status = $param['status']; return $this->asJson($form->changeVideoCatStatus()); } public function actionDelVideoCat(){ $param = post_params(); $form = new VideoForm(); $form->ids = $param['ids']; return $this->asJson($form->delVideoCat()); } public function actionGetVideoCatSelectList(){ $list = VideoCat::find()->where(['is_delete' => VideoCat::IS_NOT_DELETE,'store_id' => get_store_id()])->select(['id','name'])->asArray()->all(); return $this->asJson(['code' => 0,'data'=>$list]); } /** * Undocumented function * * @Author LGL 24963@qq.com * @DateTime 2021-01-07 * @desc: 获取视频列表 * @return void */ public function actionGetVideoList() { $param = get_params(); $form = new VideoForm(); $form->scenario = $form::SCENARIO_LIST; $form->attributes = $param; $form->store_id = get_store_id(); return $this->asJson($form->searchVideo()); } /** * 批量操作 * @return \yii\web\Response */ public function actionVideoBatch() { $id = post_params('id'); $status = post_params('status'); if (!is_array($id)) { return $this->asJson([ 'code' => 1, 'msg' => '参数不正确' ]); } Video::updateAll(['is_delete' => intval($status)], ['in', 'id', $id]); return $this->asJson([ 'code' => 0, 'msg' => '更新成功' ]); } /** * * * @Author LGL 24963@qq.com * @DateTime 2021-01-07 * @desc: 添加视频 * @return void */ public function actionAddVideo() { $param = post_params(); $form = new VideoForm(); $form->scenario = $form::SCENARIO_ADD; $form->attributes = $param; $form->store_id = get_store_id(); $res = $form->saveVideo(); return $this->asJson($res); } /** * Undocumented function * * @Author LGL 24963@qq.com * @DateTime 2021-01-07 * @desc: 编辑视频信息 * @return void */ public function actionEditVideo() { $param = post_params(); $form = new VideoForm(); $form->scenario = $form::SCENARIO_EDIT; $form->attributes = $param; $form->store_id = get_store_id(); $res = $form->saveVideo(); return $this->asJson($res); } /** * Undocumented function * * @Author LGL 24963@qq.com * @DateTime 2021-01-07 * @desc: 删除视频 * @return void */ public function actionDelVideo() { //主键id用key标识并进行获取 $param = get_params('key'); $form = new VideoForm(); $form->scenario = $form::SCENARIO_DEL; $form->id = $param; $res = $form->delVideo(); return $this->asJson($res); } /** * Undocumented function * * @Author LGL 24963@qq.com * @DateTime 2021-01-08 * @desc: 获取话题列表 * @return void */ public function actionGetTopicList() { $param = get_params(); $form = new TopicForm(); $form->scenario = $form::SCENARIO_LIST; $form->attributes = $param; $form->store_id = get_store_id(); return $this->asJson($form->searchForm()); } /** * 批量操作 * @return \yii\web\Response */ public function actionTopicBatch() { $id = post_params('id'); $status = post_params('status'); if (!is_array($id)) { return $this->asJson([ 'code' => 1, 'msg' => '参数不正确' ]); } Topic::updateAll(['is_delete' => intval($status)], ['in', 'id', $id]); if (count($id) === 1) { (new DiyCommon)->JobBehaviors(get_store_id(), StoreSyncExtLog::TYPE_PT, $id); } return $this->asJson([ 'code' => 0, 'msg' => '更新成功' ]); } /** * Undocumented function * * @Author LGL 24963@qq.com * @DateTime 2021-01-08 * @desc: 添加话题 * @return void */ public function actionAddTopic() { $param = post_params(); $form = new TopicForm(); $form->scenario = $form::SCENARIO_ADD; $form->attributes = $param; $form->store_id = get_store_id(); $res = $form->saveTopic(); return $this->asJson($res); } /** * Undocumented function * * @Author LGL 24963@qq.com * @DateTime 2021-01-08 * @desc: 编辑话题 * @return void */ public function actionEditTopic() { $param = post_params(); $form = new TopicForm(); $form->scenario = $form::SCENARIO_EDIT; $form->attributes = $param; $form->store_id = get_store_id(); $res = $form->saveTopic(); return $this->asJson($res); } /** * Undocumented function * * @Author LGL 24963@qq.com * @DateTime 2021-01-08 * @desc: 删除话题 * @return void */ public function actionDelTopic() { //主键id用key标识并进行获取 $param = get_params('key'); $form = new TopicForm(); $form->scenario = $form::SCENARIO_DEL; $form->id = $param; $res = $form->delTopic(); return $this->asJson($res); } /** * Undocumented function * * @Author LGL 24963@qq.com * @DateTime 2021-01-08 * @desc: 话题是否显示 * @return void */ public function actionEditTopicShow() { //主键id用key标识并进行获取 $param = get_params('key'); $form = new TopicForm(); $form->scenario = $form::SCENARIO_EDIT_STATUS; $form->id = $param; $form->is_show = get_params('is_show'); $res = $form->editTopicIsShow(); return $this->asJson($res); } /** * Undocumented function * * @Author LGL 24963@qq.com * @DateTime 2021-01-06 * @desc: 获取专题分类列表 */ public function actionGetAboutArticle() { $param = get_params(); $form = new AboutArticleForm(); $form->scenario = $form::SCENARIO_LIST; $form->attributes = $param; $form->store_id = get_store_id(); return $this->asJson($form->searchAboutArticle()); } /** * Undocumented function * * @Author LGL 24963@qq.com * @DateTime 2021-01-06 * @desc: 添加专题分类 * @return void */ public function actionAddAboutArticle() { $param = post_params(); $form = new AboutArticleForm(); $form->scenario = $form::SCENARIO_ADD; $form->attributes = $param; $form->store_id = get_store_id(); $res = $form->saveAboutArticle(); return $this->asJson($res); } /** * Undocumented function * * @Author LGL 24963@qq.com * @DateTime 2021-01-06 * @desc: 编辑专题分类 * @return void */ public function actionEditAboutArticle() { $param = post_params(); $form = new AboutArticleForm(); $form->scenario = $form::SCENARIO_EDIT; $form->attributes = $param; $form->store_id = get_store_id(); $res = $form->saveAboutArticle(); return $this->asJson($res); } /** * Undocumented function * * @Author LGL 24963@qq.com * @DateTime 2021-01-06 * @desc: 删除专题分类 * @return void */ public function actionDelAboutArticle() { //主键id用key标识并进行获取 $param = get_params('key'); $form = new AboutArticleForm(); $form->scenario = $form::SCENARIO_DEL; $form->id = $param; $res = $form->delAboutArticle(); return $this->asJson($res); } /** * 批量操作 * @return \yii\web\Response */ public function actionArticleBatch() { $id = post_params('id'); $status = post_params('status'); if (!is_array($id)) { return $this->asJson([ 'code' => 1, 'msg' => '参数不正确' ]); } AboutArticle::updateAll(['is_delete' => intval($status)], ['in', 'id', $id]); if (count($id) === 1) { (new DiyCommon)->JobBehaviors(get_store_id(), StoreSyncExtLog::TYPE_ARTICLE); } return $this->asJson([ 'code' => 0, 'msg' => '更新成功' ]); } /** * 批量操作 * @return \yii\web\Response */ public function actionTopicTypeBatch() { $id = post_params('id'); $status = post_params('status'); if (!is_array($id)) { return $this->asJson([ 'code' => 1, 'msg' => '参数不正确' ]); } TopicType::updateAll(['is_delete' => intval($status)], ['in', 'id', $id]); return $this->asJson([ 'code' => 0, 'msg' => '更新成功' ]); } }