<?php
namespace app\web\controller;
use app\model\Goods as GoodsModel;
use app\model\UserPay;
use think\facade\View;

class Goods extends WebController{

    public function show($id){
        $goods = GoodsModel::findOrEmpty($id) ;
        if( $goods->isEmpty() ){
            return $this->message('该商品不存在') ;
        }
        $userPay = UserPay::getPayConfig() ;

        View::assign('userPay',$userPay) ;
        View::assign('goods',$goods) ;
        return View::fetch();
    }
}
