fix(testing): GranaryBackend 白名单放行 edit 与 detail 动作并支持 ids 参数
这个提交包含在:
@@ -30,13 +30,13 @@ class GranaryBackend extends Backend
|
||||
$action = strtolower($this->request->action());
|
||||
$actions = [
|
||||
'granary' => ['index', 'add', 'detail', 'dell'],
|
||||
'testing' => ['index', 'add', 'sort', 'dell'],
|
||||
'testing' => ['index', 'add', 'edit', 'detail', 'sort', 'dell'],
|
||||
'content' => ['index', 'add', 'status', 'getcontent', 'dell'],
|
||||
'forecast' => ['index', 'detail', 'add', 'retry', 'actual'],
|
||||
];
|
||||
if (!isset($actions[$controller]) || !in_array($action, $actions[$controller], true)) $this->error('不支持此操作');
|
||||
$table = $controller === 'forecast' ? 'grain_forecast' : $controller;
|
||||
$id = $this->request->post('id', $this->request->get('id', ''));
|
||||
$id = $this->request->post('id', $this->request->get('id', $this->request->get('ids', '')));
|
||||
if ($action === 'actual') {
|
||||
$id = Db::name('grain_forecast_point')->where('id', $this->request->post('point_id/d', 0))->value('forecast_id');
|
||||
if (!$id) $this->error('预测周期不存在');
|
||||
|
||||
在新工单中引用
屏蔽一个用户