当前人审核状态
This commit is contained in:
@@ -47,8 +47,9 @@ class InvRequisitionController extends BaseController
|
||||
{
|
||||
try {
|
||||
$applicant_id = $request->get('applicant_id');
|
||||
$uid = $request->user->uid;
|
||||
$raw = $this->service->serviceList($request);
|
||||
$data = $this->formatindex($raw,$applicant_id);
|
||||
$data = $this->formatindex($raw,$applicant_id,$uid);
|
||||
// $data = $this->transformData($raw, method_exists($this, 'indexFormat')
|
||||
// ? [$this, 'indexFormat']
|
||||
// : null);
|
||||
@@ -58,9 +59,9 @@ class InvRequisitionController extends BaseController
|
||||
}
|
||||
}
|
||||
|
||||
public function formatindex($p,$applicant_id){
|
||||
public function formatindex($p,$applicant_id,$uid){
|
||||
$records = $p->getCollection()
|
||||
->map(fn($item) => $this->indexFormat($item, $applicant_id))
|
||||
->map(fn($item) => $this->indexFormat($item, $applicant_id,$uid))
|
||||
->toArray();
|
||||
|
||||
return [
|
||||
@@ -77,7 +78,7 @@ class InvRequisitionController extends BaseController
|
||||
* @param array $data
|
||||
* @return array
|
||||
*/
|
||||
protected function indexFormat($data, $applicant_id)
|
||||
protected function indexFormat($data, $applicant_id,$uid)
|
||||
{
|
||||
if (isset($data['id'])){
|
||||
//$data['approve'] = InvRequisitionApprove::where('requisition_id', $data['id'])->get();
|
||||
@@ -97,7 +98,7 @@ class InvRequisitionController extends BaseController
|
||||
|
||||
if($applicant_id != 'self' && isset($data['id'])){ //不是查询自己数据时查询是否已审核
|
||||
$approve = InvRequisitionApprove::where('requisition_id', $data['id'])
|
||||
->where('applicant_id', $applicant_id)
|
||||
->where('approver_id', $uid)
|
||||
->first();
|
||||
$data['action'] = $approve['action']??0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user