User.php 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556
  1. <?php
  2. namespace App\Http\Controllers\admin;
  3. use App\Constants\HttpStatus;
  4. use App\Http\Controllers\Controller;
  5. use App\Services\SecretService;
  6. use App\Services\TopUpService;
  7. use Illuminate\Support\Facades\App;
  8. use Illuminate\Support\Facades\DB;
  9. use App\Services\UserService;
  10. use Exception;
  11. use Illuminate\Validation\ValidationException;
  12. use App\Services\AddressService;
  13. use Illuminate\Http\JsonResponse;
  14. use App\Models\User as UserModel;
  15. use App\Models\UserSession;
  16. use App\Models\UserLogin;
  17. use App\Models\ThirdGameRecycle;
  18. use App\Models\Wallet;
  19. use App\Services\BalanceLogService;
  20. use App\Services\ThirdGameBalanceService;
  21. use Illuminate\Support\Facades\Cache;
  22. use Illuminate\Support\Str;
  23. class User extends Controller
  24. {
  25. //修改用户密码/资金密码
  26. function setPassword()
  27. {
  28. try {
  29. $params = request()->validate([
  30. 'member_id' => ['required', 'string', 'min:1'],
  31. 'password' => ['nullable'],
  32. 'payment_password' => ['nullable'],
  33. ]);
  34. $user = UserModel::where('member_id', $params['member_id'])->first();
  35. if (!$user) throw new Exception("用户不存在", HttpStatus::CUSTOM_ERROR);
  36. if (!empty($params['password'])) {
  37. $user->password = create_password($params['password']);
  38. $user->save();
  39. //删除缓存
  40. $token = UserSession::where('user_id', $params['member_id'])->orderByDesc('expire_time')->value('token');
  41. Cache::delete('token_user_' . $token);
  42. UserSession::where('user_id', $params['member_id'])->delete();
  43. }
  44. if (!empty($params['payment_password'])) {
  45. $user->payment_password = password_hash($params['payment_password'], PASSWORD_DEFAULT);
  46. $user->save();
  47. }
  48. } catch (ValidationException $e) {
  49. return $this->error(HttpStatus::CUSTOM_ERROR, $e->validator->errors()->first());
  50. } catch (Exception $e) {
  51. return $this->error(HttpStatus::CUSTOM_ERROR, $e->getMessage());
  52. }
  53. return $this->success();
  54. }
  55. function banned()
  56. {
  57. try {
  58. $params = request()->validate([
  59. 'member_id' => ['required', 'string', 'min:1'],
  60. 'is_banned' => ['required', 'integer', 'in:0,1'],
  61. ]);
  62. UserModel::where('member_id', $params['member_id'])->update(['is_banned' => $params['is_banned']]);
  63. if ($params['is_banned'] == 1) {
  64. //如果用户被禁用,删除所有会话
  65. UserSession::where('user_id', $params['member_id'])->delete();
  66. return $this->success();
  67. }
  68. } catch (ValidationException $e) {
  69. return $this->error(HttpStatus::CUSTOM_ERROR, $e->validator->errors()->first());
  70. } catch (Exception $e) {
  71. return $this->error(HttpStatus::CUSTOM_ERROR, $e->getMessage());
  72. }
  73. return $this->success();
  74. }
  75. function setNote()
  76. {
  77. try {
  78. $params = request()->validate([
  79. 'member_id' => ['required', 'string', 'min:1'],
  80. 'admin_note' => ['required', 'string', 'min:1', 'max:120'],
  81. ]);
  82. $user = UserModel::where('member_id', $params['member_id'])->first();
  83. if (!$user) throw new Exception("用户不存在", HttpStatus::CUSTOM_ERROR);
  84. $user->admin_note = $params['admin_note'];
  85. $user->save();
  86. } catch (ValidationException $e) {
  87. return $this->error(HttpStatus::CUSTOM_ERROR, $e->validator->errors()->first());
  88. } catch (Exception $e) {
  89. return $this->error(HttpStatus::CUSTOM_ERROR, $e->getMessage());
  90. }
  91. return $this->success();
  92. }
  93. public function index(): JsonResponse
  94. {
  95. try {
  96. $search = request()->validate([
  97. 'page' => ['nullable', 'integer', 'min:1'],
  98. 'limit' => ['nullable', 'integer', 'min:1'],
  99. 'member_id' => ['nullable', 'string', 'min:1'],
  100. 'like_first_name' => ['nullable', 'string', 'min:1'],
  101. 'username' => ['nullable', 'string', 'min:1'],
  102. 'register_ip' => ['nullable', 'string', 'min:1'],
  103. 'order' => ["nullable", 'string', "in:asc,desc"],
  104. 'by' => ['nullable', 'string', "in:available_balance,created_at,last_active_time"],
  105. 'user_code' => ['nullable'],
  106. 'agent_user_code' => ['nullable'],
  107. 'level' => ['nullable'],
  108. 'from' => ['nullable'],
  109. 'start_time' => ['nullable', 'date', 'date_format:Y-m-d', 'required_with:end_time'],
  110. 'end_time' => ['nullable', 'date', 'date_format:Y-m-d', 'required_with:start_time'],
  111. 'recharge_channel_group_id' => ['nullable'],
  112. ]);
  113. $order = request()->input('order', 'desc');
  114. $by = request()->input('by', 'available_balance');
  115. $result = UserService::paginate($search,$order,$by);
  116. } catch (ValidationException $e) {
  117. return $this->error(HttpStatus::CUSTOM_ERROR, $e->validator->errors()->first().'ssss');
  118. } catch (Exception $e) {
  119. return $this->error(HttpStatus::CUSTOM_ERROR, $e->getMessage());
  120. }
  121. return $this->success($result);
  122. }
  123. /**
  124. * 查询指定用户在 ag、pg 等三方游戏平台的余额明细。
  125. */
  126. public function thirdGameDetail(ThirdGameBalanceService $service): JsonResponse
  127. {
  128. try {
  129. $params = request()->validate([
  130. 'member_id' => ['required', 'string', 'min:1'],
  131. ]);
  132. if (!UserModel::where('member_id', $params['member_id'])->exists()) {
  133. throw new Exception('用户不存在', HttpStatus::CUSTOM_ERROR);
  134. }
  135. $result = $service->detail((string) $params['member_id']);
  136. if (!$result['ok']) {
  137. throw new Exception($result['msg'], HttpStatus::CUSTOM_ERROR);
  138. }
  139. unset($result['ok']);
  140. return $this->success($result);
  141. } catch (ValidationException $e) {
  142. return $this->error(HttpStatus::CUSTOM_ERROR, $e->validator->errors()->first());
  143. } catch (Exception $e) {
  144. return $this->error(HttpStatus::CUSTOM_ERROR, $e->getMessage());
  145. }
  146. }
  147. /**
  148. * 一键回收指定用户的全部三方游戏余额并入账主钱包。
  149. */
  150. public function recycleThirdGameBalance(ThirdGameBalanceService $service): JsonResponse
  151. {
  152. $lock = null;
  153. $lockAcquired = false;
  154. try {
  155. $params = request()->validate([
  156. 'member_id' => ['required', 'string', 'min:1'],
  157. ]);
  158. $memberId = (string) $params['member_id'];
  159. if (!UserModel::where('member_id', $memberId)->exists()) {
  160. throw new Exception('用户不存在', HttpStatus::CUSTOM_ERROR);
  161. }
  162. if (!Wallet::where('member_id', $memberId)->exists()) {
  163. throw new Exception('用户钱包不存在', HttpStatus::CUSTOM_ERROR);
  164. }
  165. $lock = Cache::lock('admin_third_game_recycle:' . $memberId, 120);
  166. $lockAcquired = $lock->get();
  167. if (!$lockAcquired) {
  168. throw new Exception('该用户正在回收三方余额,请勿重复操作', HttpStatus::CUSTOM_ERROR);
  169. }
  170. $pendingCredit = ThirdGameRecycle::where('member_id', $memberId)
  171. ->where('status', ThirdGameRecycle::STATUS_PROVIDER_SUCCEEDED)
  172. ->orderBy('id')
  173. ->first();
  174. if ($pendingCredit) {
  175. try {
  176. $credited = $this->creditThirdGameRecycle($pendingCredit->id);
  177. } catch (Exception $e) {
  178. throw new Exception(
  179. '三方余额已回收但钱包补入账失败,流水号:' . $pendingCredit->operation_id,
  180. HttpStatus::CUSTOM_ERROR
  181. );
  182. }
  183. $credited['recovered_pending_operation'] = true;
  184. return $this->success($credited);
  185. }
  186. $unresolved = ThirdGameRecycle::where('member_id', $memberId)
  187. ->whereIn('status', [
  188. ThirdGameRecycle::STATUS_PENDING,
  189. ThirdGameRecycle::STATUS_UNCERTAIN,
  190. ])
  191. ->orderByDesc('id')
  192. ->first();
  193. if ($unresolved) {
  194. throw new Exception(
  195. '存在待核对的三方回收流水:' . $unresolved->operation_id . ',请先人工核对三方账单',
  196. HttpStatus::CUSTOM_ERROR
  197. );
  198. }
  199. $operation = ThirdGameRecycle::create([
  200. 'operation_id' => (string) Str::uuid(),
  201. 'member_id' => $memberId,
  202. 'player_id' => $service->playerId($memberId),
  203. 'status' => ThirdGameRecycle::STATUS_PENDING,
  204. ]);
  205. $recycled = $service->recycle($memberId);
  206. if (!$recycled['ok']) {
  207. $operation->status = !empty($recycled['uncertain'])
  208. ? ThirdGameRecycle::STATUS_UNCERTAIN
  209. : ThirdGameRecycle::STATUS_FAILED;
  210. $operation->error = $recycled['msg'];
  211. $operation->save();
  212. throw new Exception(
  213. $recycled['msg'] . ',流水号:' . $operation->operation_id,
  214. HttpStatus::CUSTOM_ERROR
  215. );
  216. }
  217. $operation->status = ThirdGameRecycle::STATUS_PROVIDER_SUCCEEDED;
  218. $operation->game_balance = $recycled['game_balance'];
  219. $operation->wallet_balance = $recycled['wallet_balance'];
  220. $operation->save();
  221. try {
  222. $credited = $this->creditThirdGameRecycle($operation->id);
  223. } catch (Exception $e) {
  224. throw new Exception(
  225. '三方余额已回收但钱包入账失败,请重试回收以补入账,流水号:' . $operation->operation_id,
  226. HttpStatus::CUSTOM_ERROR
  227. );
  228. }
  229. return $this->success($credited);
  230. } catch (ValidationException $e) {
  231. return $this->error(HttpStatus::CUSTOM_ERROR, $e->validator->errors()->first());
  232. } catch (Exception $e) {
  233. return $this->error(HttpStatus::CUSTOM_ERROR, $e->getMessage());
  234. } finally {
  235. if ($lockAcquired && $lock) {
  236. $lock->release();
  237. }
  238. }
  239. }
  240. /**
  241. * 将三方已回收的流水幂等入账;事务失败时保留 provider_succeeded 供下次补偿。
  242. */
  243. private function creditThirdGameRecycle(int $operationId): array
  244. {
  245. return DB::transaction(function () use ($operationId) {
  246. $operation = ThirdGameRecycle::where('id', $operationId)->lockForUpdate()->firstOrFail();
  247. if ($operation->status === ThirdGameRecycle::STATUS_COMPLETED) {
  248. $walletBalance = (float) Wallet::where('member_id', $operation->member_id)
  249. ->value('available_balance');
  250. return $this->recycleResponse($operation, $walletBalance);
  251. }
  252. if ($operation->status !== ThirdGameRecycle::STATUS_PROVIDER_SUCCEEDED) {
  253. throw new Exception('三方回收流水状态不可入账', HttpStatus::CUSTOM_ERROR);
  254. }
  255. $wallet = Wallet::where('member_id', $operation->member_id)->lockForUpdate()->firstOrFail();
  256. $before = (string) $wallet->available_balance;
  257. $walletGain = (string) $operation->wallet_balance;
  258. $after = bcadd($before, $walletGain, 10);
  259. if (bccomp($walletGain, '0', 10) > 0) {
  260. BalanceLogService::addLog(
  261. $operation->member_id,
  262. $walletGain,
  263. $before,
  264. $after,
  265. '三方游戏转出',
  266. $operation->id,
  267. '后台一键回收游戏余额'
  268. );
  269. $wallet->available_balance = $after;
  270. $wallet->save();
  271. }
  272. $operation->status = ThirdGameRecycle::STATUS_COMPLETED;
  273. $operation->credited_at = now();
  274. $operation->save();
  275. return $this->recycleResponse($operation, (float) $after);
  276. });
  277. }
  278. private function recycleResponse(ThirdGameRecycle $operation, float $walletBalance): array
  279. {
  280. return [
  281. 'operation_id' => $operation->operation_id,
  282. 'member_id' => $operation->member_id,
  283. 'recovered_game_balance' => (float) $operation->game_balance,
  284. 'recovered_balance' => (float) $operation->wallet_balance,
  285. 'wallet_balance' => $walletBalance,
  286. ];
  287. }
  288. /**
  289. * 查询三方游戏回收流水,用于核对 pending/uncertain 状态。
  290. */
  291. public function thirdGameRecycleRecords(): JsonResponse
  292. {
  293. try {
  294. $params = request()->validate([
  295. 'page' => ['nullable', 'integer', 'min:1'],
  296. 'limit' => ['nullable', 'integer', 'min:1', 'max:100'],
  297. 'member_id' => ['nullable', 'string', 'min:1'],
  298. 'status' => ['nullable', 'string', 'in:pending,provider_succeeded,completed,failed,uncertain'],
  299. ]);
  300. $page = (int) ($params['page'] ?? 1);
  301. $limit = (int) ($params['limit'] ?? 15);
  302. $query = ThirdGameRecycle::query()
  303. ->when(!empty($params['member_id']), function ($query) use ($params) {
  304. $query->where('member_id', $params['member_id']);
  305. })
  306. ->when(!empty($params['status']), function ($query) use ($params) {
  307. $query->where('status', $params['status']);
  308. });
  309. $total = (clone $query)->count();
  310. $list = $query->orderByDesc('id')->forPage($page, $limit)->get();
  311. return $this->success(['total' => $total, 'data' => $list]);
  312. } catch (ValidationException $e) {
  313. return $this->error(HttpStatus::CUSTOM_ERROR, $e->validator->errors()->first());
  314. } catch (Exception $e) {
  315. return $this->error(HttpStatus::CUSTOM_ERROR, $e->getMessage());
  316. }
  317. }
  318. /**
  319. * 人工核对待确认流水:确认未回收,或按三方实际金额补入账。
  320. */
  321. public function resolveThirdGameRecycle(ThirdGameBalanceService $service): JsonResponse
  322. {
  323. $lock = null;
  324. $lockAcquired = false;
  325. try {
  326. $params = request()->validate([
  327. 'operation_id' => ['required', 'uuid'],
  328. 'action' => ['required', 'string', 'in:failed,credit'],
  329. 'game_balance' => ['nullable', 'required_if:action,credit', 'numeric', 'min:0'],
  330. 'remark' => ['nullable', 'string', 'max:500'],
  331. ]);
  332. $operation = ThirdGameRecycle::where('operation_id', $params['operation_id'])->first();
  333. if (!$operation) {
  334. throw new Exception('三方回收流水不存在', HttpStatus::CUSTOM_ERROR);
  335. }
  336. $lock = Cache::lock('admin_third_game_recycle:' . $operation->member_id, 120);
  337. $lockAcquired = $lock->get();
  338. if (!$lockAcquired) {
  339. throw new Exception('该用户正在处理三方回收,请稍后再试', HttpStatus::CUSTOM_ERROR);
  340. }
  341. $operation = DB::transaction(function () use ($operation, $params, $service) {
  342. $operation = ThirdGameRecycle::where('id', $operation->id)->lockForUpdate()->firstOrFail();
  343. if (!in_array($operation->status, [
  344. ThirdGameRecycle::STATUS_PENDING,
  345. ThirdGameRecycle::STATUS_UNCERTAIN,
  346. ], true)) {
  347. throw new Exception('当前流水状态无需人工处理', HttpStatus::CUSTOM_ERROR);
  348. }
  349. $remark = trim((string) ($params['remark'] ?? ''));
  350. if ($params['action'] === 'failed') {
  351. $operation->status = ThirdGameRecycle::STATUS_FAILED;
  352. $operation->resolution_remark = '后台人工核对:确认三方未回收'
  353. . ($remark !== '' ? ';' . $remark : '');
  354. } else {
  355. $gameBalance = (float) $params['game_balance'];
  356. $operation->status = ThirdGameRecycle::STATUS_PROVIDER_SUCCEEDED;
  357. $operation->game_balance = $gameBalance;
  358. $operation->wallet_balance = $service->toWalletBalance($gameBalance);
  359. $operation->resolution_remark = '后台人工核对:确认三方已回收'
  360. . ($remark !== '' ? ';' . $remark : '');
  361. }
  362. $operation->save();
  363. return $operation;
  364. });
  365. if ($params['action'] === 'failed') {
  366. return $this->success([
  367. 'operation_id' => $operation->operation_id,
  368. 'member_id' => $operation->member_id,
  369. 'status' => $operation->status,
  370. ]);
  371. }
  372. try {
  373. $credited = $this->creditThirdGameRecycle($operation->id);
  374. } catch (Exception $e) {
  375. throw new Exception(
  376. '核对金额已保存但钱包入账失败,请再次提交回收操作补入账,流水号:' . $operation->operation_id,
  377. HttpStatus::CUSTOM_ERROR
  378. );
  379. }
  380. $credited['resolved_manually'] = true;
  381. return $this->success($credited);
  382. } catch (ValidationException $e) {
  383. return $this->error(HttpStatus::CUSTOM_ERROR, $e->validator->errors()->first());
  384. } catch (Exception $e) {
  385. return $this->error(HttpStatus::CUSTOM_ERROR, $e->getMessage());
  386. } finally {
  387. if ($lockAcquired && $lock) {
  388. $lock->release();
  389. }
  390. }
  391. }
  392. public function merge(): JsonResponse
  393. {
  394. DB::beginTransaction();
  395. try {
  396. $params = request()->validate([
  397. 'member_id' => ['required', 'string', 'min:1'],
  398. 'secret_key' => ['required', 'string', 'min:1'],
  399. ]);
  400. $res = SecretService::migration($params['member_id'], $params['secret_key']);
  401. if (!$res) {
  402. throw new Exception(lang("迁移失败"), HttpStatus::CUSTOM_ERROR);
  403. }
  404. $oldUser = UserModel::where('secret_key', $params['secret_key'])->first();
  405. $newUser = UserModel::where('member_id', $params['member_id'])->first();
  406. App::setLocale($oldUser->language);
  407. $text = lang('账户转移通知') . ":\n";
  408. $text .= lang('管理员已将您的账户转移至新用户') . "\n\n";
  409. $text .= lang('新用户信息') . "\n";
  410. $text .= lang('用户ID') . ":{$newUser->getMemberId()}\n";
  411. if ($newUser->getUsername()) {
  412. $text .= lang("用户名") . ":@{$newUser->getUsername()}\n";
  413. }
  414. $text .= lang('昵称') . ":{$newUser->getFirstName()}\n";
  415. TopUpService::notifyTransferSuccess($oldUser->getMemberId(), $text);
  416. App::setLocale($newUser->language);
  417. $text = lang("账户转移通知") . ":\n";
  418. $text .= lang("管理员已将指定账户转移至您的账户") . "\n\n";
  419. $text .= lang('原账户信息') . "\n\n";
  420. $text .= lang('用户ID') . ":{$oldUser->getMemberId()}\n";
  421. if ($oldUser->getUsername()) {
  422. $text .= lang('用户名') . ":@{$oldUser->getUsername()}\n";
  423. }
  424. $text .= lang('昵称') . ":{$oldUser->getFirstName()}\n";
  425. TopUpService::notifyTransferSuccess($newUser->getMemberId(), $text);
  426. DB::commit();
  427. } catch (ValidationException $e) {
  428. DB::rollBack();
  429. return $this->error(HttpStatus::CUSTOM_ERROR, $e->validator->errors()->first());
  430. } catch (Exception $e) {
  431. DB::rollBack();
  432. if ($e->getCode() == HttpStatus::CUSTOM_ERROR) {
  433. return $this->error(HttpStatus::CUSTOM_ERROR, $e->getMessage());
  434. }
  435. return $this->error(intval($e->getCode()));
  436. }
  437. return $this->success(msg: '已完成迁移');
  438. }
  439. public function address()
  440. {
  441. try {
  442. request()->validate([
  443. 'member_id' => ['required', 'integer', 'min:1'],
  444. ]);
  445. $search = request()->all();
  446. $result = AddressService::findAll($search);
  447. } catch (ValidationException $e) {
  448. return $this->error(HttpStatus::CUSTOM_ERROR, $e->validator->errors()->first());
  449. } catch (Exception $e) {
  450. return $this->error(intval($e->getCode()));
  451. }
  452. return $this->success($result);
  453. }
  454. /**
  455. * 用户登录日志
  456. */
  457. public function loginLog()
  458. {
  459. try {
  460. $params = request()->validate([
  461. 'page' => ['nullable', 'integer', 'min:1'],
  462. 'limit' => ['nullable', 'integer', 'min:1'],
  463. 'user_id' => ['nullable'],
  464. 'member_id' => ['nullable'],
  465. 'first_name' => ['nullable'],
  466. 'start_time' => ['nullable', 'date', 'date_format:Y-m-d', 'required_with:end_time'],
  467. 'end_time' => ['nullable', 'date', 'date_format:Y-m-d', 'required_with:start_time'],
  468. ]);
  469. $page = request()->input('page', 1);
  470. $limit = request()->input('limit', 15);
  471. $query = UserLogin::join('users', 'user_login.user_id', '=', 'users.user_id');
  472. if (!empty($params['user_id'])) {
  473. $query = $query->where('user_login.user_id', $params['user_id']);
  474. }
  475. if (!empty($params['member_id'])) {
  476. $query = $query->where('user_login.user_id', $params['member_id']);
  477. }
  478. if (!empty($params['first_name'])) {
  479. $query = $query->where('users.first_name', 'like', "%{$params['first_name']}%");
  480. }
  481. if (!empty($params['start_time'])) {
  482. $startTime = $params['start_time'] . " 00:00:00";
  483. $query = $query->where('user_login.created_at', '>=', $startTime);
  484. }
  485. if (!empty($params['end_time'])) {
  486. $endTime = $params['end_time'] . " 23:59:59";
  487. $query = $query->where('user_login.updated_at', '<=', $endTime);
  488. }
  489. $count = $query->count();
  490. $list = $query
  491. ->forPage($page, $limit)
  492. ->orderByDesc('user_login.created_at')
  493. ->get();
  494. } catch (Exception $e) {
  495. return $this->error(HttpStatus::CUSTOM_ERROR,$e->getMessage());
  496. }
  497. return $this->success(['total' => $count, 'data' => $list]);
  498. }
  499. function setRechargeChannelGroup()
  500. {
  501. try {
  502. $params = request()->validate([
  503. 'member_id' => ['required', 'array'],
  504. 'recharge_channel_group_id' => ['required', 'integer', 'min:1'],
  505. ]);
  506. UserModel::whereIn('member_id', $params['member_id'])->update(['recharge_channel_group_id' => $params['recharge_channel_group_id']]);
  507. } catch (ValidationException $e) {
  508. return $this->error(HttpStatus::CUSTOM_ERROR, $e->validator->errors()->first());
  509. } catch (Exception $e) {
  510. return $this->error(HttpStatus::CUSTOM_ERROR, $e->getMessage());
  511. }
  512. return $this->success();
  513. }
  514. }