|
@@ -74,12 +74,13 @@ class PaymentOrder extends Controller
|
|
|
DB::beginTransaction();
|
|
DB::beginTransaction();
|
|
|
try {
|
|
try {
|
|
|
$params = request()->validate([
|
|
$params = request()->validate([
|
|
|
- 'id' => ['required'],
|
|
|
|
|
|
|
+ 'ids' => ['required', 'array', 'min:1'],
|
|
|
|
|
+ 'ids.*' => ['required', 'integer', 'min:1'],
|
|
|
'status' => ['required', 'integer', 'in:2,3'],
|
|
'status' => ['required', 'integer', 'in:2,3'],
|
|
|
'remark' => ['nullable', 'string'],
|
|
'remark' => ['nullable', 'string'],
|
|
|
]);
|
|
]);
|
|
|
$remark = $params['remark'] ?? '';
|
|
$remark = $params['remark'] ?? '';
|
|
|
- $ids = is_array($params['id']) ? $params['id'] : [$params['id']];
|
|
|
|
|
|
|
+ $ids = is_array($params['ids']) ? $params['ids'] : [$params['ids']];
|
|
|
foreach($ids as $id) {
|
|
foreach($ids as $id) {
|
|
|
$info = PaymentOrderModel::find($id);
|
|
$info = PaymentOrderModel::find($id);
|
|
|
if (!$info) throw new Exception('数据不存在', HttpStatus::CUSTOM_ERROR);
|
|
if (!$info) throw new Exception('数据不存在', HttpStatus::CUSTOM_ERROR);
|