ShopController.php 934 字节
<?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();
    }







}