GiftController.php
766 字节
<?php
namespace app\admin\controller;
use cmf\controller\AdminBaseController;
use think\Db;
class GiftController extends AdminBaseController {
public function index() {
$request = request();
if($request->isPost()) {
$data = [
'id' => 1,
'overflow' => $request->param('overflow'),
'reduce' => $request->param('reduce')
];
if(Db::name('gift')->update($data)) {
$this->success('修改成功');
}else {
$this->error('您未作出任何修改');
}
}else {
return $this->fetch('gift', [
'data' => Db::name('gift')->where(['id'=>1])->find()
]);
}
}
}