后台添加支付测试功能

This commit is contained in:
技术老胡
2024-11-02 17:59:36 +08:00
parent 82e0f8e04c
commit bab5fa4f53
5 changed files with 166 additions and 2 deletions

View File

@@ -6,6 +6,7 @@ namespace app\controller;
use app\BaseController;
use app\model\Order;
use app\model\User;
use think\facade\View;
class OrderController extends BaseController
@@ -27,4 +28,18 @@ class OrderController extends BaseController
return '订单不存在';
}
}
public function testPay()
{
$pid = 1000;
if (session('?pid')) {
$pid = session('pid');
}
View::assign('pid', $pid);
$key = User::where('pid', $pid)->where('state', 1)->value('secret_key');
if (!$key) {
return '用户禁用或不存在';
}
View::assign('key', $key);
return View::fetch();
}
}