|
@@ -18,24 +18,26 @@ use App\Models\Config;
|
|
|
|
|
|
|
|
class Withdraw extends Controller
|
|
class Withdraw extends Controller
|
|
|
{
|
|
{
|
|
|
-function setRmbNote()
|
|
|
|
|
-{
|
|
|
|
|
- try {
|
|
|
|
|
- $params = request()->validate([
|
|
|
|
|
- 'id' => ['required', 'integer', 'min:1'],
|
|
|
|
|
- 'admin_note' => ['required', 'string', 'min:1', 'max:120'],
|
|
|
|
|
- ]);
|
|
|
|
|
- $po = PaymentOrder::where('id', $params['id'])->first();
|
|
|
|
|
- if (!$po) throw new Exception("记录不存在", HttpStatus::CUSTOM_ERROR);
|
|
|
|
|
- $po->admin_note = $params['admin_note'];
|
|
|
|
|
- $po->save();
|
|
|
|
|
- } catch (ValidationException $e) {
|
|
|
|
|
- return $this->error(HttpStatus::CUSTOM_ERROR, $e->validator->errors()->first());
|
|
|
|
|
- } catch (Exception $e) {
|
|
|
|
|
- return $this->error(HttpStatus::CUSTOM_ERROR, $e->getMessage());
|
|
|
|
|
|
|
+ function setRmbNote()
|
|
|
|
|
+ {
|
|
|
|
|
+ try {
|
|
|
|
|
+ $params = request()->validate([
|
|
|
|
|
+ 'id' => ['required', 'integer', 'min:1'],
|
|
|
|
|
+ 'admin_note' => ['required', 'string', 'min:1', 'max:120'],
|
|
|
|
|
+ ]);
|
|
|
|
|
+ $po = PaymentOrder::where('id', $params['id'])
|
|
|
|
|
+ ->where('type', 2)->first();
|
|
|
|
|
+ if (!$po) throw new Exception("记录不存在", HttpStatus::CUSTOM_ERROR);
|
|
|
|
|
+ $po->admin_note = $params['admin_note'];
|
|
|
|
|
+ $po->save();
|
|
|
|
|
+ } catch (ValidationException $e) {
|
|
|
|
|
+ return $this->error(HttpStatus::CUSTOM_ERROR, $e->validator->errors()->first());
|
|
|
|
|
+ } catch (Exception $e) {
|
|
|
|
|
+ return $this->error(HttpStatus::CUSTOM_ERROR, $e->getMessage());
|
|
|
|
|
+ }
|
|
|
|
|
+ return $this->success();
|
|
|
}
|
|
}
|
|
|
- return $this->success();
|
|
|
|
|
-}
|
|
|
|
|
|
|
+
|
|
|
public function rmb()
|
|
public function rmb()
|
|
|
{
|
|
{
|
|
|
try {
|
|
try {
|