物品借用审批列表
This commit is contained in:
@@ -35,6 +35,42 @@ class InvRequisitionService
|
|||||||
return new $this->validator;
|
return new $this->validator;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 构造 CrudUtil 查询配置
|
||||||
|
*/
|
||||||
|
protected function buildQueryConfig(Request $request, string $scene = 'default'): array
|
||||||
|
{
|
||||||
|
$p = $request->all();
|
||||||
|
|
||||||
|
$config = [];
|
||||||
|
$config['model'] = $this->modelClass;
|
||||||
|
switch ($scene) {
|
||||||
|
case 'default':
|
||||||
|
$config['where']['status'] = 1;
|
||||||
|
$config['order']['sort'] = 'desc';
|
||||||
|
$config['order']['id'] = 'desc';
|
||||||
|
break;
|
||||||
|
case 'index':
|
||||||
|
$config['where']['applicant_id'] = $request->user->uid;
|
||||||
|
$config['order']['sort'] = 'desc';
|
||||||
|
$config['order']['id'] = 'desc';
|
||||||
|
break;
|
||||||
|
case 'show':
|
||||||
|
$config['where']['id'] = $p['id'];
|
||||||
|
$config['where']['status'] = 1;
|
||||||
|
break;
|
||||||
|
case 'store':
|
||||||
|
break;
|
||||||
|
case 'update':
|
||||||
|
$config['where']['id'] = $p['id'];
|
||||||
|
break;
|
||||||
|
case 'destroy':
|
||||||
|
$config['where']['id'] = $p['id'];
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $config;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建物品申请 前置
|
* 创建物品申请 前置
|
||||||
|
|||||||
Reference in New Issue
Block a user