<?php

namespace plugin\admin\app\controller;

use support\Request;
use support\Response;
use support\think\Db;

/**
 * 礼品卡管理
 *
 * @icon fa fa-circle-o
 */
class GiftController extends Crud
{

    /**
     * Product模型对象
     * @var \app\model\Gift
     */
    protected $model = null;
    protected $type = 'default'; 
    protected $noNeedAuth = [];

    function __construct()
    {
        $this->model = new \app\model\Gift;
        $statusList = $this->model->getStatusList();
        $this->assign("statusList", $statusList);
        $this->assignconfig("statusList", $statusList);
    }
    public function insert(Request $request): Response
    {
        if ($request->method() != 'POST') {
            return view('update',[
                'row'   =>  [
                    'price'        =>  '10',
                    'max_quantity'      =>  0,
                    'status'            =>  1
                ]
            ]);
        }
        return parent::insert($request);
    }
}
