feat(order): 修正订单验证码图片保存路径及采购款不足错误

This commit is contained in:
mkm 2024-06-17 15:12:03 +08:00
parent 1432a29f05
commit 9dde487cb9
2 changed files with 2 additions and 2 deletions

View File

@ -194,7 +194,7 @@ class OrderLogic extends BaseLogic
$generator = new BarcodeGeneratorPNG();
$barcode = $generator->getBarcode($verify_code, $generator::TYPE_CODE_128);
$findPath = '/image/barcode/'.time().'.png';
$savePath = 'public'.$findPath;
$savePath = public_path().$findPath;
file_put_contents($savePath, $barcode);
$_order['verify_img'] = $findPath;
Db::startTrans();

View File

@ -97,7 +97,7 @@ class PayNotifyLogic extends BaseLogic
public static function purchase_funds($orderSn, $extra = [])
{
$order = StoreOrder::where('order_id', $orderSn)->findOrEmpty();
$user = User::where('id', $extra['uid'])->find();
$user = User::where('id', $order['uid'])->find();
if ($user['purchase_funds'] < $order['pay_price']) {
throw new \Exception('采购款不足');
}