|
@@ -126,19 +126,6 @@ class Withdraw extends Controller
|
|
|
return $this->success($result);
|
|
return $this->success($result);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- /**
|
|
|
|
|
- * @api {post} /admin/withdraw/setStatus 通过|拒绝
|
|
|
|
|
- * @apiGroup 提现管理
|
|
|
|
|
- *
|
|
|
|
|
- * @apiUse result
|
|
|
|
|
- * @apiUse header
|
|
|
|
|
- * @apiVersion 1.0.0
|
|
|
|
|
- *
|
|
|
|
|
- * @apiParam {string} id 提现表ID
|
|
|
|
|
- * @apiParam {int} status 状态
|
|
|
|
|
- * - 1 通过
|
|
|
|
|
- * - 2 拒绝
|
|
|
|
|
- */
|
|
|
|
|
public function setStatus()
|
|
public function setStatus()
|
|
|
{
|
|
{
|
|
|
DB::beginTransaction();
|
|
DB::beginTransaction();
|
|
@@ -155,8 +142,12 @@ class Withdraw extends Controller
|
|
|
request()->validate($validate);
|
|
request()->validate($validate);
|
|
|
$ids = request()->input('ids');
|
|
$ids = request()->input('ids');
|
|
|
$remark = request()->input('remark');
|
|
$remark = request()->input('remark');
|
|
|
|
|
+ $count = 0;
|
|
|
foreach ($ids as $id) {
|
|
foreach ($ids as $id) {
|
|
|
- WithdrawService::setStatus($id, $status, $remark);
|
|
|
|
|
|
|
+ $count += WithdrawService::setStatus($id, $status, $remark);
|
|
|
|
|
+ }
|
|
|
|
|
+ if ($count < 1) {
|
|
|
|
|
+ throw new Exception('操作失败', HttpStatus::CUSTOM_ERROR);
|
|
|
}
|
|
}
|
|
|
DB::commit();
|
|
DB::commit();
|
|
|
} catch (ValidationException $e) {
|
|
} catch (ValidationException $e) {
|