海南旅游SAAS
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

28 lines
682 B

  1. <?php
  2. namespace App\AdminSettled\Controllers;
  3. use App\Http\Controllers\Controller;
  4. use App\Models\SettledOrder;
  5. /**
  6. * ajax回调,判断是否已经支付
  7. * Class IsPayController
  8. * @package App\AdminSettled\Controllers
  9. */
  10. class IsPayController extends Controller
  11. {
  12. //ajax回调,判断是否已支付
  13. public function index(): int
  14. {
  15. $username = request()->input('username');
  16. $type = request()->input('type');
  17. $user_type = ['supplier' => 1, 'agent' => 2, 'guide' => 3][$type] ?? die('错误的type');
  18. $order = SettledOrder::where(['username' => $username, 'user_type' => $user_type])->first();
  19. if (!$order) {
  20. return 0;
  21. }
  22. return (int)$order->status;
  23. }
  24. }