|
|
|
@ -17,15 +17,36 @@ class InvoiceIssuance extends Base |
|
|
|
public function index(): Response |
|
|
|
{ |
|
|
|
|
|
|
|
$param = $this->request->get(); |
|
|
|
$limit = $this->request->get('size', config('apiadmin.ADMIN_LIST_DEFAULT')); |
|
|
|
$start = $this->request->get('page', 1); |
|
|
|
|
|
|
|
$where = []; |
|
|
|
|
|
|
|
if (isset($param['pucode']) && !empty($param['pucode'])) { |
|
|
|
$where[] = ['pucode', '=', $param['pucode']]; |
|
|
|
} |
|
|
|
|
|
|
|
if (isset($param['project_id']) && !empty($param['project_id'])) { |
|
|
|
$where[] = ['project_id', '=', $param['project_id']]; |
|
|
|
} |
|
|
|
|
|
|
|
if (isset($param['mobile']) && !empty($param['mobile'])) { |
|
|
|
$where[] = ['mobile', '=', $param['mobile']]; |
|
|
|
} |
|
|
|
|
|
|
|
if (isset($param['merge']) && !empty($param['merge'])) { |
|
|
|
$where[] = ['merge', '=', $param['merge']]; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
$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') |
|
|
|
$listObj = $InvoiceIssuanceModel->where($where) |
|
|
|
->order('create_time', 'DESC') |
|
|
|
->field($field) |
|
|
|
->paginate(['page' => $start, 'list_rows' => $limit])->each(function ($item, $key) use ($InvoiceHead) { |
|
|
|
|
|
|
|
@ -53,4 +74,24 @@ class InvoiceIssuance extends Base |
|
|
|
]); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 获取发票项目选项 |
|
|
|
* @return Response |
|
|
|
*/ |
|
|
|
public function getIndexData(): Response |
|
|
|
{ |
|
|
|
$projectArr = InvoiceIssuanceModel::$projectArr; |
|
|
|
|
|
|
|
unset($projectArr[0]); |
|
|
|
|
|
|
|
$keyArr = []; |
|
|
|
foreach ($projectArr as $key => $value) { |
|
|
|
$keyArr[] = [ |
|
|
|
'value' => $key, |
|
|
|
'text' => $value |
|
|
|
]; |
|
|
|
} |
|
|
|
return $this->buildSuccess($keyArr); |
|
|
|
} |
|
|
|
|
|
|
|
} |