Merge pull request 'dev' (#87) from dev into main

Reviewed-on: #87
This commit is contained in:
mkm 2024-08-02 20:55:50 +08:00
commit 652b4ba9fb

View File

@ -94,7 +94,7 @@ class OrderLogic extends BaseLogic
$find['top_cate_id']=$find['cate_id'];
if($StoreCategory && $StoreCategory['pid']>0){
$StoreCategory2=StoreCategory::where('id',$StoreCategory['pid'])->find();
if($StoreCategory2 && $StoreCategory['pid']>0){
if($StoreCategory2 && $StoreCategory2['pid']>0){
$find['top_cate_id']=$StoreCategory2['pid'];
}else{
$find['top_cate_id']=$StoreCategory['pid'];
@ -315,12 +315,12 @@ class OrderLogic extends BaseLogic
throw new \Exception('余额不足');
}
//生成核销码
$generator = new BarcodeGeneratorPNG();
$barcode = $generator->getBarcode($verify_code, $generator::TYPE_CODE_128);
$findPath = '/image/barcode/' . time() . '.png';
$savePath = public_path() . $findPath;
file_put_contents($savePath, $barcode);
$_order['verify_img'] = $findPath;
// $generator = new BarcodeGeneratorPNG();
// $barcode = $generator->getBarcode($verify_code, $generator::TYPE_CODE_128);
// $findPath = '/image/barcode/' . time() . '.png';
// $savePath = public_path() . $findPath;
// file_put_contents($savePath, $barcode);
// $_order['verify_img'] = $findPath;
Db::startTrans();
try {
$order = StoreOrder::create($_order);