12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- <?php
- namespace app\api\controller;
- use app\common\controller\Api;
- use think\Db;
- /**
- * 首页接口
- */
- class Index extends Api
- {
- protected $noNeedLogin = [];
- protected $noNeedRight = ['*'];
- //结束后的首页
- public function index(){
- //活动详情
- $find = Db::name('vote_subject')->where('id',1)->find();
- if(!$find){
- $this->error('没有进行中的投票活动');
- }
- $find = info_domain_image($find,['image','paihang_image']);
- //中奖信息
- $zhongjiang = [
- 'zhongjiang_status' => 0,
- 'finish_title' => config('site.finish_title'),
- 'finish_info' => config('site.finish_info'),
- 'finish_iqiyi' => config('site.finish_iqiyi'),
- 'user_kami' => '',
- 'finish_content' => config('site.finish_content'),
- ];
- if($this->auth->isLogin()){
- $exam_user_top = Db::name('exam_user_top')->where('user_id',$this->auth->id)->order('id asc')->find();
- if(!empty($exam_user_top) && !empty($exam_user_top['info'])){
- $zhongjiang['zhongjiang_status'] = 1;
- $zhongjiang['user_kami'] = $exam_user_top['info'];
- }
- }
- $result = [
- 'subject' => $find,
- 'zhongjiang' => $zhongjiang,
- ];
- $this->success(1,$result);
- }
- //领取
- public function lingqu(){
- }
- }
|