| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134 |
- <?php
- namespace app\shop\controller;
- use app\api\controller\Token;
- use app\common\controller\Frontend;
- use app\common\library\CoinRate;
- use app\common\model\Config;
- use app\common\model\User;
- use think\Session;
- class Index extends Frontend
- {
- protected $noNeedLogin = [''];
- protected $noNeedRight = '*';
- protected $layout = '';
- public function index()
- {
- $sinfo=db('studio')->where(['title'=>$this->auth->login_studio])->find();
- #轮播
- $slideshow = db('ads')->where(['status' => 1,'studio'=>$this->auth->login_studio])->select();
- if (empty($slideshow)) {
- $slideshow = [];
- }
- $index_order=config('site')['index_order'];
- $artist = db('article')->where(['catid' => 2, 'status' => 1])->select();
- if(!$artist)
- {
- $artist=[];
- }
- $cats = db('goods_cats')->where(['status'=>1])->order('id asc')->select();
- foreach ($cats as $k=>$v)
- {
- $start=strtotime(date("Y-m-d {$v['start']}"));
- $end=strtotime(date("Y-m-d {$v['end']}"));
- /*未开始*/
- if(time()<$start)
- {
- $cats[$k]['jctime1']=$start-time();
- $cats[$k]['flag']=1;
- }elseif(time()>=$start && time()<$end)
- {
- $cats[$k]['jctime1']=$end-time();
- $cats[$k]['flag']=2;
- }else{
- $cats[$k]['flag']=0;
- $cats[$k]['jctime1']=0;
- }
- }
- $awards = \app\common\model\Trade::getAwardTotal();
- $counts = \app\common\model\Trade::getSpeedTotalByUser($this->auth->id);
- $awards = [
- 'total'=> isset($awards['total'])? $awards['total'] : 0,
- 'total_usdt'=> isset($awards['total_usdt'])? $awards['total_usdt'] : 0,
- 'speed_total'=> isset($counts['speed_total'])? $counts['speed_total'] : 0,
- 'speed_usdt'=> isset($counts['speed_usdt'])? $counts['speed_usdt'] : 0,
- ];
- $config = Config::getConfigByGroup('basic');
- $indexVideo = isset($config['index_video'])? $config['index_video']['value'] : '';
- $this->view->assign([
- 'indexVideo'=>$indexVideo,
- 'slideshow'=>$slideshow,
- 'cats' => $cats,
- 'awards'=> $awards,
- 'index_order'=>$index_order,
- 'artist'=>$artist,
- 'title'=>$sinfo['name'],
- ]);
- return $this->fetch();
- }
- function artistdetail()
- {
- $id = input('id');
- $noticeinfo = db('article')->where(['id' => $id, 'status' => 1])->find();
- if (empty($noticeinfo)) {
- $noticeinfo = [];
- }
- $this->view->assign('info', $noticeinfo);
- return $this->fetch();
- }
- function noticedetail()
- {
- $id = input('id');
- $noticeinfo = db('article')->where(['id' => $id, 'status' => 1])->find();
- if (empty($noticeinfo)) {
- $noticeinfo = [];
- }
- $this->view->assign('info', $noticeinfo);
- return $this->fetch();
- }
- function notice()
- {
- #轮播
- $slideshow = db('ads')->where(['status' => 1])->select();
- if (empty($slideshow)) {
- $slideshow = [];
- }
- $this->view->assign([
- 'slideshow' => $slideshow,
- ]);
- return $this->fetch();
- }
- function kefu()
- {
- $noticeinfo = db('article')->where(['catid' => 4, 'status' => 1])->find();
- if (empty($noticeinfo)) {
- $noticeinfo = [];
- }
- $this->view->assign('info', $noticeinfo);
- return $this->fetch();
- }
- function qyjs()
- {
- $noticeinfo = db('article')->where(['catid' => 3, 'status' => 1])->find();
- if (empty($noticeinfo)) {
- $noticeinfo = [];
- }
- $this->view->assign('info', $noticeinfo);
- return $this->fetch();
- }
- function xszn()
- {
- $noticeinfo = db('article')->where(['catid' => 2, 'status' => 1])->find();
- if (empty($noticeinfo)) {
- $noticeinfo = [];
- }
- $this->view->assign('info', $noticeinfo);
- return $this->fetch();
- }
- }
|