|
|
@@ -20,6 +20,7 @@ class Withdraw extends Controller
|
|
|
{
|
|
|
function setRmbNote()
|
|
|
{
|
|
|
+ DB::beginTransaction();
|
|
|
try {
|
|
|
$params = request()->validate([
|
|
|
'id' => ['required', 'integer', 'min:1'],
|
|
|
@@ -30,9 +31,12 @@ class Withdraw extends Controller
|
|
|
if (!$po) throw new Exception("记录不存在", HttpStatus::CUSTOM_ERROR);
|
|
|
$po->admin_note = $params['admin_note'];
|
|
|
$po->save();
|
|
|
+ DB::commit();
|
|
|
} catch (ValidationException $e) {
|
|
|
+ DB::rollBack();
|
|
|
return $this->error(HttpStatus::CUSTOM_ERROR, $e->validator->errors()->first());
|
|
|
} catch (Exception $e) {
|
|
|
+ DB::rollBack();
|
|
|
return $this->error(HttpStatus::CUSTOM_ERROR, $e->getMessage());
|
|
|
}
|
|
|
return $this->success();
|