request->get('size', config('apiadmin.ADMIN_LIST_DEFAULT')); $start = $this->request->get('page', 1); $InvoiceIssuanceModel = new InvoiceIssuanceModel(); $InvoiceHead = new InvoiceHead(); $field = 'id,project_id,merge,pucode,expire_time,mobile,email,create_time,status,amount,invoice_head_id,cancel_time,issuance_time'; $listObj = $InvoiceIssuanceModel->order('create_time', 'DESC') ->field($field) ->paginate(['page' => $start, 'list_rows' => $limit])->each(function ($item, $key) use ($InvoiceHead) { $item->project_itle = InvoiceIssuanceModel::$projectArr[$item->project_id] ?? ''; $item->status = InvoiceIssuanceModel::$statusArr[$item->status] ?? ''; $item->merge = $item->merge ? '合并' : '不合并'; $item->expire_time = $item->expire_time ? date("Y-m") : ''; $item->cancel_time = $item->cancel_time ? date("Y-m-d H:i:s") : ''; $item->issuance_time = $item->issuance_time ? date("Y-m-d H:i:s") : ''; $InvoiceHeadRes = $InvoiceHead->where('id', $item->invoice_head_id)->find(); $item->head_type = ''; $item->head_title = ''; if ($InvoiceHeadRes) { $item->head_type = InvoiceHead::$typeArr[$InvoiceHeadRes['type']]; $item->head_title = $InvoiceHeadRes['title']; } unset($item->invoice_head_id,$item->project_id); })->toArray(); $listInfo = $listObj['data']; return $this->buildSuccess([ 'list' => $listInfo, 'count' => $listObj['total'] ]); } }