getClassNevList(1, ['id', 'day_title']); return $this->render('daytoutiaoindex', ['data' => $data]); } /* * 添加报名 * */ public function actionDaytoutiaoadd() { $server = new Listclassnevserver(); $data = $server->getClassNevList(1, ['id', 'day_title']); return $this->render('daytoutiaoadd', ['data' => $data]); } /* * 编辑 * */ public function actionDaytoutiaoedit() { $id = Yii::$app->request->get('id'); $server = new Listclassnevserver(); $lanmu = $server->getClassNevList(1, ['id', 'day_title']); $data = \common\models\DayToutiao::findOne($id); return $this->render('daytoutiaoedit', ['lanmu' => $lanmu, 'data' => $data]); } /* * 获取头条报名列表数据 * */ public function actionDaytoutiaoform() { $input = Yii::$app->request->post(); $server = new Daytoutiaoserver(); $data = $server->getList($input); if (!$data) return Help::JsonCode(Help::ERROR, '获取数据失败'); return Help::JsonData(0, '获取数据成功', $data['count'], $data['data']); } /* * 处理编辑数据 * */ public function actionDaytoutiaoeditform() { $input = Yii::$app->request->post(); $server = new Daytoutiaoserver(); $data = $server->editData($input); if(!$data) return Help::JsonCode(Help::ERROR,'添加失败'); return Help::JsonCode(Help::SUCCESS,$data); } /* * 报名数据添加 * */ public function actionDaytoutiaoaddform() { $input = Yii::$app->request->post(); $server = new Daytoutiaoserver(); $data = $server->addList($input); return Help::JsonCode(Help::SUCCESS, $data); } /* * 重新发送 * */ public function actionDaytoutiaoanewsend() { $id = Yii::$app->request->post('id'); $server = new Daytoutiaoserver(); $data = $server->anewSend($id); return Help::JsonCode(Help::SUCCESS, $data); } /* * 删除 * */ public function actionDaytoutiaodel() { $id = Yii::$app->request->post('id'); $server = new Daytoutiaoserver(); $data = $server->delOne($id); if ($data) return Help::JsonCode(Help::SUCCESS, '删除成功'); return Help::JsonCode(Help::ERROR, '删除失败'); } /* * 设为无效 * */ public function actionDaytoutiaosetwx() { $did = Yii::$app->request->post('did'); $server = new Daytoutiaoserver(); $data = $server->setWx($did); if ($data) return Help::JsonCode(Help::SUCCESS, '设置完成'); return Help::JsonCode(Help::ERROR, '设置失败'); } }