| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495 |
- <?php
- namespace app\shop\controller;
- use app\common\controller\Frontend;
- use GuzzleHttp\json_decode;
- use think\cache\driver\Redis;
- class Goods extends Frontend
- {
- protected $noNeedLogin = [''];
- protected $noNeedRight = '*';
- protected $layout = '';
- public function _initialize()
- {
- parent::_initialize();
- }
- function goodslist()
- {
- $catid=input('catid');
- $login_studio=$this->auth->login_studio;
- $studio=db('studio')->where(['title'=>$login_studio])->find();
- if(time()>=strtotime(date("Y-m-d {$studio['start']}")) && time()<= strtotime(date("Y-m-d {$studio['end']}")) )
- {
- $status='营业中';
- }elseif(time()< strtotime(date("Y-m-d {$studio['start']}"))){
- $status='停业中';
- }elseif(time() > strtotime(date("Y-m-d {$studio['end']}"))){
- $status='停业中';
- }
- $isappoint=db('studio_user')->where(['sid'=>$studio['id'],'userid'=>$this->auth->id])->find();
- if($isappoint)
- {
- $flag=0;
- }else{
- $flag=1;
- }
- $this->view->assign([
- 'title'=>get_table_column('goods_cats',$catid,'name'),
- 'catid'=>$catid,
- 'studio'=>$studio,
- 'status'=>$status,
- 'flag'=>$flag,
- ]);
- return $this->fetch();
- }
- /* 商品详情 */
- function goodsdetailed()
- {
- $id=input('id');
- $info=db('goods')->where(['id'=>$id])->find();
- if(!empty($info['images']))
- {
- $images=$info['image'].','.$info['images'];
- $info['img']=explode(',', $images);
- }else{
- $info['img']=[$info['image']];
- }
- $this->view->assign([
- "info"=>$info,
- ]);
- return $this->fetch();
- }
- /* 商品详情 */
- function goodsdetailed1()
- {
- $id=input('id');
- $info=db('goods')->where(['id'=>$id])->find();
- if(!empty($info['images']))
- {
- $images=$info['image'].','.$info['images'];
- $info['img']=explode(',', $images);
- }else{
- $info['img']=[$info['image']];
- }
- $this->view->assign([
- "info"=>$info,
- ]);
- return $this->fetch();
- }
- /* 评论 */
- function appraise()
- {
- $goodsid=input('goodsid');
- $this->view->assign('goodsid',$goodsid);
- return $this->fetch();
- }
- /* 购物车 */
- function cart()
- {
- return $this->fetch();
- }
- }
|