海南旅游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

<?php
namespace App\AdminSettled\Controllers;
use App\Http\Controllers\Controller;
use App\Models\SettledOrder;
/**
* ajax回调,判断是否已经支付
* Class IsPayController
* @package App\AdminSettled\Controllers
*/
class IsPayController extends Controller
{
//ajax回调,判断是否已支付
public function index(): int
{
$username = request()->input('username');
$type = request()->input('type');
$user_type = ['supplier' => 1, 'agent' => 2, 'guide' => 3][$type] ?? die('错误的type');
$order = SettledOrder::where(['username' => $username, 'user_type' => $user_type])->first();
if (!$order) {
return 0;
}
return (int)$order->status;
}
}