ShopController.php
934 字节
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<?php
/**
* Created by PhpStorm.
* auther: sgj
* Date: 2018/12/17
* Time: 16:18
*/
namespace app\portal\controller;
use app\portal\model\GoodsModel;
use cmf\controller\WeChatBaseController;
use think\Request;
class ShopController extends WeChatBaseController
{
protected $GoodsModel;
public function __construct(GoodsModel $GoodsModel)
{
parent::__construct();
$this->GoodsModel = $GoodsModel;
}
public function index()
{
$goods=$this->GoodsModel->getList()->toArray();
$this->assign('goods',$goods);
return $this->fetch();
}
public function goodinfo(){
$id=input('id');
$good=$this->GoodsModel->getGoodInfo($id);
$this->assign('good',$good);
// dump($good);
return $this->fetch();
}
/*
* 确认订单
*/
public function confirmOrder(){
return $this->fetch();
}
}