quanwei
2025-11-01 121b714d710cf3c865f4a1b5efe81abec11056d1
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
<?php
 
namespace app\shop\controller\plus\table;
 
use app\shop\controller\Controller;
use app\shop\model\plus\table\Record as RecordModel;
use app\shop\model\plus\table\Table as TableModel;
/**
 * 表单控制器
 */
class Record extends Controller
{
 
    /**
     * 优惠券列表
     */
    public function index()
    {
        $model = new RecordModel();
        $list = $model->getList($this->postData());
        // 所有表单
        $table_list = (new TableModel())->getAll();
        return $this->renderSuccess('', compact('list', 'table_list'));
    }
 
    /**
     * 删除优惠券
     */
    public function delete($table_record_id)
    {
        $model = RecordModel::detail($table_record_id);
        // 更新记录
        if ($model->setDelete()) {
            return $this->renderSuccess('删除成功');
        }
        return $this->renderError($model->getError()?:'删除失败');
    }
}