Browse Source

Merge branch 'master' of http://git.jhcs888.com/ph/zh_food

DESKTOP-70VPDLK\Administrator 7 months ago
parent
commit
4da33b9e56

+ 5 - 0
.idea/laravel-idea.xml

@@ -1,5 +1,10 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?xml version="1.0" encoding="UTF-8"?>
 <project version="4">
 <project version="4">
+  <component name="InertiaPackage">
+    <option name="directoryPaths">
+      <list />
+    </option>
+  </component>
   <component name="LaravelIdeaMainSettings">
   <component name="LaravelIdeaMainSettings">
     <option name="codeGeneration">
     <option name="codeGeneration">
       <LaravelCodeGeneration>
       <LaravelCodeGeneration>

+ 5 - 5
.idea/php.xml

@@ -131,16 +131,16 @@
       <path value="$PROJECT_DIR$/vendor/markbaker/matrix" />
       <path value="$PROJECT_DIR$/vendor/markbaker/matrix" />
       <path value="$PROJECT_DIR$/vendor/intervention/image" />
       <path value="$PROJECT_DIR$/vendor/intervention/image" />
       <path value="$PROJECT_DIR$/vendor/phpoffice/phpspreadsheet" />
       <path value="$PROJECT_DIR$/vendor/phpoffice/phpspreadsheet" />
-      <path value="$PROJECT_DIR$/vendor/doctrine/cache" />
-      <path value="$PROJECT_DIR$/vendor/doctrine/event-manager" />
       <path value="$PROJECT_DIR$/vendor/doctrine/dbal" />
       <path value="$PROJECT_DIR$/vendor/doctrine/dbal" />
-      <path value="$PROJECT_DIR$/vendor/doctrine/deprecations" />
+      <path value="$PROJECT_DIR$/vendor/phpdocumentor/reflection-common" />
+      <path value="$PROJECT_DIR$/vendor/phpdocumentor/type-resolver" />
       <path value="$PROJECT_DIR$/vendor/phpstan/phpdoc-parser" />
       <path value="$PROJECT_DIR$/vendor/phpstan/phpdoc-parser" />
       <path value="$PROJECT_DIR$/vendor/barryvdh/laravel-ide-helper" />
       <path value="$PROJECT_DIR$/vendor/barryvdh/laravel-ide-helper" />
       <path value="$PROJECT_DIR$/vendor/barryvdh/reflection-docblock" />
       <path value="$PROJECT_DIR$/vendor/barryvdh/reflection-docblock" />
-      <path value="$PROJECT_DIR$/vendor/phpdocumentor/reflection-common" />
-      <path value="$PROJECT_DIR$/vendor/phpdocumentor/type-resolver" />
       <path value="$PROJECT_DIR$/vendor/psr/cache" />
       <path value="$PROJECT_DIR$/vendor/psr/cache" />
+      <path value="$PROJECT_DIR$/vendor/doctrine/cache" />
+      <path value="$PROJECT_DIR$/vendor/doctrine/event-manager" />
+      <path value="$PROJECT_DIR$/vendor/doctrine/deprecations" />
     </include_path>
     </include_path>
   </component>
   </component>
   <component name="PhpProjectSharedConfiguration" php_language_level="7.3">
   <component name="PhpProjectSharedConfiguration" php_language_level="7.3">

+ 6 - 0
.idea/phpspec.xml

@@ -20,6 +20,12 @@
       <PhpSpecSuiteConfiguration>
       <PhpSpecSuiteConfiguration>
         <option name="myPath" value="$PROJECT_DIR$" />
         <option name="myPath" value="$PROJECT_DIR$" />
       </PhpSpecSuiteConfiguration>
       </PhpSpecSuiteConfiguration>
+      <PhpSpecSuiteConfiguration>
+        <option name="myPath" value="$PROJECT_DIR$" />
+      </PhpSpecSuiteConfiguration>
+      <PhpSpecSuiteConfiguration>
+        <option name="myPath" value="$PROJECT_DIR$" />
+      </PhpSpecSuiteConfiguration>
     </suites>
     </suites>
   </component>
   </component>
 </project>
 </project>

+ 65 - 0
app/Console/Commands/CheckOrderExpire.php

@@ -0,0 +1,65 @@
+<?php
+
+namespace App\Console\Commands;
+
+use App\Models\Goods;
+use App\Models\Order;
+use App\Models\OrderItem;
+use Illuminate\Console\Command;
+use Illuminate\Support\Facades\DB;
+
+class CheckOrderExpire extends Command
+{
+    /**
+     * The name and signature of the console command.
+     *
+     * @var string
+     */
+    protected $signature = 'check:orderExpire';
+
+    /**
+     * The console command description.
+     *
+     * @var string
+     */
+    protected $description = '检查订单到期未支付';
+
+    /**
+     * Create a new command instance.
+     *
+     * @return void
+     */
+    public function __construct()
+    {
+        parent::__construct();
+    }
+
+    /**
+     * Execute the console command.
+     *
+     * @return int
+     */
+    public function handle()
+    {
+        $date = date('Y-m-d H:i:s', time() - 1800);//30分钟
+
+        Order::where('order_status', 1)
+            ->where('created_at', '<=', $date)
+            ->chunkById(100,function ($list){
+                foreach ($list as $item){
+                    DB::beginTransaction();
+                    try {
+                        //取消订单
+                        Order::where('id',$item->{'id'})->update(['order_status'=>3]);
+
+                        DB::commit();
+                    }catch (\Exception $e){
+                        DB::rollBack();
+                    }
+
+                }
+            });
+
+        return true;
+    }
+}

+ 54 - 0
app/Console/Commands/Test.php

@@ -0,0 +1,54 @@
+<?php
+
+namespace App\Console\Commands;
+
+use App\Models\ShopPrinter;
+use App\Servers\JobServer;
+use App\Servers\printer\PrinterServer;
+use Carbon\Carbon;
+use Illuminate\Console\Command;
+
+class Test extends Command
+{
+    /**
+     * The name and signature of the console command.
+     *
+     * @var string
+     */
+    protected $signature = 'test';
+
+    /**
+     * The console command description.
+     *
+     * @var string
+     */
+    protected $description = 'Command description';
+
+    /**
+     * Create a new command instance.
+     *
+     * @return void
+     */
+    public function __construct()
+    {
+        parent::__construct();
+    }
+
+    /**
+     * Execute the console command.
+     *
+     * @return int
+     */
+    public function handle()
+    {
+//        $printer = ShopPrinter::where('shop_id',111)->where('is_del',0)->get();
+//        foreach ($printer as $value){
+//            $res = PrinterServer::creatServer()->sendPrints($value->{'brand_id'},$value->{'sn'},1);
+//            var_dump($res);
+//        }
+//        dd(111);
+        // 投递打印消息
+        JobServer::creatServer()->shopOrderPrintJob(1,111);
+        return 0;
+    }
+}

+ 16 - 5
app/Http/Controllers/Api/GoodsController.php

@@ -58,7 +58,7 @@ class GoodsController extends ApiController
                 ->where('status',1)
                 ->where('status',1)
                 ->where('shop_id',$shop_id)
                 ->where('shop_id',$shop_id)
                 ->where('category_id',$value['type'])
                 ->where('category_id',$value['type'])
-                ->select(['id as goods_id','category_id','goods_name','goods_desc','goods_image','price','spec_type','line_price','sales'])
+                ->select(['id as goods_id','category_id','goods_name','goods_desc','goods_image','price','pack_price','spec_type','line_price','sales'])
                 ->orderBy('sort','desc')
                 ->orderBy('sort','desc')
                 ->get();
                 ->get();
             foreach ($list as $goods){
             foreach ($list as $goods){
@@ -80,14 +80,25 @@ class GoodsController extends ApiController
         $goods_id = $commonServer->filtrationStr('goods_id');//商品id
         $goods_id = $commonServer->filtrationStr('goods_id');//商品id
         if (empty($goods_id)) return $this->apiResponseError('请选择商品');
         if (empty($goods_id)) return $this->apiResponseError('请选择商品');
 
 
-        $spec_type = Goods::where('id',$goods_id)->where('is_del',0)->value('spec_type');
-        if ($spec_type == 2){
+        $goods = Goods::where('is_del',0)
+            ->where('status',1)
+            ->where('id',$goods_id)
+            ->select(['id as goods_id','category_id','goods_name','goods_desc','goods_image','price','pack_price','spec_type','line_price','sales'])
+            ->first();
+
+        if (empty($goods)){
+            return $this->apiResponseError('商品不存在');
+        }
+
+        if ($goods->{'spec_type'} == 2){
             $sku = GoodsSpecServer::creatServer()->getGoodsSku($goods_id);
             $sku = GoodsSpecServer::creatServer()->getGoodsSku($goods_id);
         }else{
         }else{
             $sku = [];
             $sku = [];
         }
         }
+        $data['goods'] = $goods;
+        $data['sku'] = $sku;
 
 
-        return $this->apiResponseSuccess('成功',$sku);
+        return $this->apiResponseSuccess('成功',$data);
     }
     }
 
 
 
 
@@ -111,7 +122,7 @@ class GoodsController extends ApiController
             ->where('status',1)
             ->where('status',1)
             ->where('shop_id',$shop_id)
             ->where('shop_id',$shop_id)
             ->where('goods_name','like',"%$search%")
             ->where('goods_name','like',"%$search%")
-            ->select(['id as goods_id','category_id','goods_name','goods_desc','goods_image','price','spec_type','line_price','sales'])
+            ->select(['id as goods_id','category_id','goods_name','goods_desc','goods_image','price','pack_price','spec_type','line_price','sales'])
             ->orderBy('sort','desc')
             ->orderBy('sort','desc')
             ->paginate(10);
             ->paginate(10);
         return $this->apiResponseSuccess('获取成功', [
         return $this->apiResponseSuccess('获取成功', [

+ 61 - 10
app/Http/Controllers/Api/OrderController.php

@@ -100,6 +100,60 @@ class OrderController extends ApiController
         return $this->apiResponseSuccess('订单创建成功', $res['data']);
         return $this->apiResponseSuccess('订单创建成功', $res['data']);
     }
     }
 
 
+    /**
+     * 下单
+     */
+    function createV2Order()
+    {
+        $m_id = $this->getMemberId();//用户id
+        $commonServer = CommonServer::creatServer();
+        $shop_id = $commonServer->filtrationStr('shop_id');//商家id
+        $order_type = $commonServer->filtrationStr('order_type',1);//订单类型 1堂食订单 2打包订单
+        $table_number = $commonServer->filtrationStr('table_number');//桌号
+        $diner_number = $commonServer->filtrationStr('diner_number');//就餐人数
+        $note = $commonServer->filtrationStr('note');//备注
+        $shopping_cart = request()->input('shopping_cart',[]);//商品规格数组
+
+        if (empty($shop_id)) return $this->apiResponseError('商家错误');
+        if (!in_array($order_type,[1,2])){
+            return $this->apiResponseError('就餐方式错误');
+        }
+        if (empty($table_number) || $table_number < 0) return $this->apiResponseError('桌号错误');
+        if (empty($diner_number) || $diner_number < 0) return $this->apiResponseError('就餐人数错误');
+        if (empty($shopping_cart)) return $this->apiResponseError('请添加购物车');
+
+        if ($table_number > 1000) return $this->apiResponseError('桌号最大1000');
+        if ($diner_number > 1000) return $this->apiResponseError('就餐人数最大1000');
+        if (!empty($note) && mb_strlen($note) > 50 ) return $this->apiResponseError('备注最大50');
+
+        //获取商家信息
+        $shop = ShopServer::creatServer()->getShopInfo($shop_id);
+        if (empty($shop)) return $this->apiResponseError('该商家不存在');
+        if ($shop['status'] != 1) return $this->apiResponseError('商家闭店休息中');
+        //获取购买的商品信息
+        $cartResult = ShoppingCartServer::creatServer()->getCartList($shopping_cart);
+        if ($cartResult['code'] == 0) {
+            return $this->apiResponseError($cartResult['msg']);
+        }
+        $goods = $cartResult['data'];
+        //加锁
+        $lock_key = $shop_id.'lockOrderCreate';
+        $lock_value = uniqid(bin2hex(random_bytes(10)), true);
+        $lock = RedisDataServer::creatServer()->lockKey($lock_key,$lock_value,500);
+        if (!$lock){
+            return $this->apiResponseError('下单人数过多,请稍候');
+        }
+        //下单
+        $res = OrderServer::creatServer()->createOrder($m_id,$shop_id,$order_type,$table_number,$diner_number,$note,$goods,$shopping_cart);
+
+        //删除锁key-防止死锁
+        RedisDataServer::creatServer()->unLockKey($lock_key,$lock_value);
+        if ($res['code'] == 0) {
+            return $this->apiResponseError($res['msg']);
+        }
+
+        return $this->apiResponseSuccess('订单创建成功', $res['data']);
+    }
 
 
     /**
     /**
      * 支付订单
      * 支付订单
@@ -110,11 +164,9 @@ class OrderController extends ApiController
         $commonServer = CommonServer::creatServer();
         $commonServer = CommonServer::creatServer();
         $order_id = $commonServer->filtrationStr('order_id');//订单id
         $order_id = $commonServer->filtrationStr('order_id');//订单id
         $pay_type = $commonServer->filtrationStr('pay_type',1);//支付方式 1微信 2支付宝
         $pay_type = $commonServer->filtrationStr('pay_type',1);//支付方式 1微信 2支付宝
-        $system_type = request()->input('system_type',2);//1微信h5 2微信小程序 3qq小程序
 
 
         if (empty($order_id)) return $this->apiResponseError('请选择订单');
         if (empty($order_id)) return $this->apiResponseError('请选择订单');
         if (!in_array($pay_type, [1, 2, 3])) return $this->apiResponseError('支付方式错误');
         if (!in_array($pay_type, [1, 2, 3])) return $this->apiResponseError('支付方式错误');
-        if (!in_array($system_type, [1, 2, 3])) return $this->apiResponseError('来源平台错误');
         $order_info = Order::where('id', $order_id)
         $order_info = Order::where('id', $order_id)
             ->where('m_id', $m_id)
             ->where('m_id', $m_id)
             ->where('order_status', 1)
             ->where('order_status', 1)
@@ -133,11 +185,11 @@ class OrderController extends ApiController
         if($pay_type == 1) {
         if($pay_type == 1) {
             //微信支付
             //微信支付
             $notify_url = route('notify.order_wx');
             $notify_url = route('notify.order_wx');
-            $wx_openid = MemberOpenId::where('m_id', $m_id)->where('type', $system_type)->value('openid');
+            $wx_openid = MemberOpenId::where('m_id', $m_id)->where('type', 4)->value('openid');
             if (empty($wx_openid)) {
             if (empty($wx_openid)) {
                 return $this->apiResponseError('用户信息错误');
                 return $this->apiResponseError('用户信息错误');
             }
             }
-            $wx_pay = WeixinServer::creatServer()->wxJsPay($order_info->{'order_sn'}, $order_info->{'pay_money'}, $notify_url, '外卖订单', $wx_openid);
+            $wx_pay = WeixinServer::creatServer()->wxJsPay($order_info->{'order_sn'}, $order_info->{'pay_money'}, $notify_url, '订单', $wx_openid);
             $data['wx_pay'] = $wx_pay;
             $data['wx_pay'] = $wx_pay;
         }elseif ($pay_type == 2) {
         }elseif ($pay_type == 2) {
             $data['zfb_pay'] = [];
             $data['zfb_pay'] = [];
@@ -167,7 +219,7 @@ class OrderController extends ApiController
                     $q->where('order_status',$status);
                     $q->where('order_status',$status);
                 }
                 }
             })
             })
-            ->select(['id','order_sn','order_status','pay_money','goods_number','created_at','shop_id'])
+            ->select(['id','order_sn','order_type','order_status','pay_money','goods_number','created_at','shop_id','note','shopping_cart'])
             ->orderBy('id','desc')
             ->orderBy('id','desc')
             ->paginate(10);
             ->paginate(10);
         foreach ($list as $value){
         foreach ($list as $value){
@@ -177,7 +229,7 @@ class OrderController extends ApiController
             $value->{'item'} = OrderItem::from('order_item as o')
             $value->{'item'} = OrderItem::from('order_item as o')
                 ->leftJoin('goods as g', 'o.goods_id', '=', 'g.id')
                 ->leftJoin('goods as g', 'o.goods_id', '=', 'g.id')
                 ->where('o.order_id',$value->{'id'})
                 ->where('o.order_id',$value->{'id'})
-                ->select(['o.id','o.goods_id','o.goods_name','o.goods_img','g.status'])
+                ->select(['o.id','o.goods_id','o.goods_name','o.goods_img','o.goods_number','g.status'])
                 ->orderBy('o.id','asc')
                 ->orderBy('o.id','asc')
                 ->get();
                 ->get();
             $value->initializeModel();
             $value->initializeModel();
@@ -235,9 +287,8 @@ class OrderController extends ApiController
 
 
         $where = [['m_id',$m_id], ['is_del',0], ['id',$order_id]];
         $where = [['m_id',$m_id], ['is_del',0], ['id',$order_id]];
 
 
-        $order = Order::from('order as o')
-            ->where($where)
-            ->select(['id','order_sn','pay_type','m_id','note','order_status','pay_money','goods_number','shop_id','created_at','pack_price','table_number','diner_number','number'])
+        $order = Order::where($where)
+            ->select(['id','order_sn','order_type','pay_type','m_id','note','order_status','pay_money','goods_number','shop_id','created_at','pack_price','table_number','diner_number','number','note','shopping_cart'])
             ->first();
             ->first();
         if (empty($order)) return $this->apiResponseError('订单不存在');
         if (empty($order)) return $this->apiResponseError('订单不存在');
         if ($order->{'order_type'} == 1) {//堂食打包费为0
         if ($order->{'order_type'} == 1) {//堂食打包费为0
@@ -247,7 +298,7 @@ class OrderController extends ApiController
         $order->{'item'} = OrderItem::from('order_item as o')
         $order->{'item'} = OrderItem::from('order_item as o')
             ->leftJoin('goods as g', 'o.goods_id', '=', 'g.id')
             ->leftJoin('goods as g', 'o.goods_id', '=', 'g.id')
             ->where('o.order_id',$order_id)
             ->where('o.order_id',$order_id)
-            ->select(['o.id','o.goods_id','o.goods_name','o.goods_img','o.goods_attr','o.goods_number','o.goods_price','o.goods_spec_list','g.status'])
+            ->select(['o.id','o.goods_id','o.goods_name','o.goods_img','o.goods_attr','o.goods_number','o.goods_price','o.goods_money','o.goods_spec_list','g.status'])
             ->orderBy('o.id','asc')
             ->orderBy('o.id','asc')
             ->get();
             ->get();
 
 

+ 32 - 0
app/Http/Controllers/Api/ShopController.php

@@ -0,0 +1,32 @@
+<?php
+
+namespace App\Http\Controllers\Api;
+
+
+
+use App\Http\Controllers\ApiController;
+use App\Servers\CommonServer;
+use App\Servers\ShopServer;
+
+/**
+ * 外卖商家管理
+ */
+class ShopController extends ApiController
+{
+    /**
+     * 获取店铺详情
+     */
+    function getShopInfo()
+    {
+        $m_id = $this->getMemberId();//用户id
+        $commonServer = CommonServer::creatServer();
+        $shop_id = $commonServer->filtrationStr('shop_id');//商家id
+        if (empty($shop_id)) return $this->apiResponseError('请选择商家');
+
+        $info = ShopServer::creatServer()->getShopInfo($shop_id);
+
+        if (empty($info)) return $this->apiResponseError('商家不存在');
+
+        return $this->apiResponseSuccess('成功',$info);
+    }
+}

+ 3 - 2
app/Http/Controllers/Api/ShoppingController.php

@@ -39,7 +39,8 @@ class ShoppingController extends ApiController
         $goods_id = $commonServer->filtrationStr('goods_id');//商品id
         $goods_id = $commonServer->filtrationStr('goods_id');//商品id
         $shop_id = $commonServer->filtrationStr('shop_id');//商家id
         $shop_id = $commonServer->filtrationStr('shop_id');//商家id
         $category_id = $commonServer->filtrationStr('category_id');//分类id
         $category_id = $commonServer->filtrationStr('category_id');//分类id
-        $goods_spec_id = $commonServer->filtrationStr('goods_spec_id',0);//商品规格id
+        $goods_spec_id = $commonServer->filtrationStr('goods_spec_id');//规格id,删除时需要
+        $goods_spec = request()->input('goods_spec',[]);//商品规格数组
         $number = $commonServer->filtrationStr('number',0);//数量
         $number = $commonServer->filtrationStr('number',0);//数量
 
 
         if (empty($goods_id)) return $this->apiResponseError('请选择商品');
         if (empty($goods_id)) return $this->apiResponseError('请选择商品');
@@ -47,7 +48,7 @@ class ShoppingController extends ApiController
 
 
         if (empty($shop_id)) return $this->apiResponseError('请选择商家');
         if (empty($shop_id)) return $this->apiResponseError('请选择商家');
         if (empty($category_id)) return $this->apiResponseError('类目错误');
         if (empty($category_id)) return $this->apiResponseError('类目错误');
-        $result = ShoppingCartServer::creatServer()->saveShopping($m_id,$shop_id,$category_id,$goods_id,$goods_spec_id,$number);
+        $result = ShoppingCartServer::creatServer()->saveShopping($m_id,$shop_id,$category_id,$goods_id,$goods_spec_id,$goods_spec,$number);
 
 
         if ($result['code'] == 0) {
         if ($result['code'] == 0) {
             return $this->apiResponseError($result['msg']);
             return $this->apiResponseError($result['msg']);

+ 5 - 1
app/Jobs/PrintOrderJob.php

@@ -2,6 +2,7 @@
 
 
 namespace App\Jobs;
 namespace App\Jobs;
 
 
+use App\Models\Order;
 use App\Models\ShopPrinter;
 use App\Models\ShopPrinter;
 use App\Servers\printer\PrinterServer;
 use App\Servers\printer\PrinterServer;
 use Illuminate\Bus\Queueable;
 use Illuminate\Bus\Queueable;
@@ -35,13 +36,16 @@ class PrintOrderJob implements ShouldQueue
     public function handle()
     public function handle()
     {
     {
         $order_id = $this->order_id;
         $order_id = $this->order_id;
-        var_dump('外卖订单打印消息队列处理',$order_id);
+        var_dump('订单打印消息队列处理',$order_id);
         $shop_id = $this->shop_id;
         $shop_id = $this->shop_id;
         //获取商家打印机
         //获取商家打印机
         $printer = ShopPrinter::where('shop_id',$shop_id)->where('is_del',0)->get();
         $printer = ShopPrinter::where('shop_id',$shop_id)->where('is_del',0)->get();
         foreach ($printer as $value){
         foreach ($printer as $value){
             $res = PrinterServer::creatServer()->sendPrints($value->{'brand_id'},$value->{'sn'},$order_id);
             $res = PrinterServer::creatServer()->sendPrints($value->{'brand_id'},$value->{'sn'},$order_id);
             var_dump($res);
             var_dump($res);
+            if ($res){
+                Order::where('id',$order_id)->where('shop_id',$shop_id)->update(['is_print'=>1]);
+            }
         }
         }
         return true;
         return true;
     }
     }

+ 12 - 4
app/Models/Order.php

@@ -82,6 +82,15 @@ class Order extends Model
      */
      */
     public $timestamps = true;
     public $timestamps = true;
 
 
+    /**
+     * 类型转换
+     *
+     * @var array
+     */
+    protected $casts = [
+        'shopping_cart' => 'array',
+    ];
+
 
 
     /**
     /**
      * 不能被批量赋值的属性
      * 不能被批量赋值的属性
@@ -92,10 +101,9 @@ class Order extends Model
 
 
     private $orderStatusEnum=[
     private $orderStatusEnum=[
         1=>'待支付',
         1=>'待支付',
-        2=>'制作中',
-        3=>'已完成',
-        4=>'已取消',
-        5=>'退款',
+        2=>'已完成',
+        3=>'已取消',
+        4=>'退款',
     ];
     ];
     private $refundStatusEnum=[
     private $refundStatusEnum=[
         1=>'等待商家同意',
         1=>'等待商家同意',

+ 5 - 3
app/Servers/OrderServer.php

@@ -40,7 +40,7 @@ class OrderServer
         return self::$server;
         return self::$server;
     }
     }
 
 
-    function createOrder($m_id,$shop_id,$order_type,$table_number,$diner_number,$note,$goods_data)
+    function createOrder($m_id,$shop_id,$order_type,$table_number,$diner_number,$note,$goods_data,$shopping_cart)
     {
     {
         DB::beginTransaction();
         DB::beginTransaction();
         try {
         try {
@@ -53,8 +53,9 @@ class OrderServer
             $goods_money = $goods_data['total_goods_money'];//商品总价
             $goods_money = $goods_data['total_goods_money'];//商品总价
             $goods_number = $goods_data['total_num'];//商品总数
             $goods_number = $goods_data['total_num'];//商品总数
             $pack_price = $goods_data['pack_price'];//打包费
             $pack_price = $goods_data['pack_price'];//打包费
-            if ($order_type == 1){//堂食不算打包费
+            if ($order_type == 1){//堂食不算打包费,并且打包费为0
                 $order_money = $goods_money;
                 $order_money = $goods_money;
+                $pack_price = 0;
             }else{//打包
             }else{//打包
                 $order_money = bcadd($goods_money, $pack_price, 2);//订单金额 =(商品金额 + 打包费)
                 $order_money = bcadd($goods_money, $pack_price, 2);//订单金额 =(商品金额 + 打包费)
             }
             }
@@ -67,7 +68,7 @@ class OrderServer
             $shop_money = bcsub($order_money,$service_money,2);
             $shop_money = bcsub($order_money,$service_money,2);
             //信息入库
             //信息入库
             $order_info = [
             $order_info = [
-                'order_sn' => CommonServer::creatServer()->createOrderNo('WDO'),
+                'order_sn' => CommonServer::creatServer()->createOrderNo('382FDC'),
                 'order_type' => $order_type,
                 'order_type' => $order_type,
                 'm_id' => $m_id,
                 'm_id' => $m_id,
                 'shop_id' => $shop_id,
                 'shop_id' => $shop_id,
@@ -81,6 +82,7 @@ class OrderServer
                 'service_money' => $service_money,
                 'service_money' => $service_money,
                 'pack_price' => $pack_price,
                 'pack_price' => $pack_price,
                 'shop_money' => $shop_money,
                 'shop_money' => $shop_money,
+                'shopping_cart' => $shopping_cart,
             ];
             ];
             //主表信息入库
             //主表信息入库
             $order = Order::create($order_info);
             $order = Order::create($order_info);

+ 316 - 76
app/Servers/ShoppingCartServer.php

@@ -53,7 +53,7 @@ class ShoppingCartServer
         $shopping =  Shopping::from('shopping as p')
         $shopping =  Shopping::from('shopping as p')
             ->leftJoin('goods as g','g.id','=','p.goods_id')
             ->leftJoin('goods as g','g.id','=','p.goods_id')
             ->where($where)
             ->where($where)
-            ->select(['p.id as shopping_id','p.number','g.id as goods_id','g.shop_id','g.goods_name','g.goods_image','g.price','g.spec_type','g.category_id','g.pack_price'])
+            ->select(['p.id as shopping_id','p.number','p.goods_spec_id','g.id as goods_id','g.shop_id','g.goods_name','g.goods_image','g.price','g.spec_type','g.category_id','g.pack_price'])
             ->orderBy('p.id','asc')
             ->orderBy('p.id','asc')
             ->get();
             ->get();
 
 
@@ -105,7 +105,8 @@ class ShoppingCartServer
                 'spec_type' => $value['spec_type'],
                 'spec_type' => $value['spec_type'],
                 'price' => $goods_price,
                 'price' => $goods_price,
                 'pack_price' => $value['pack_price'],
                 'pack_price' => $value['pack_price'],
-                'goods_attr' => $goods_attr,
+                'goods_spec_id' => $value['goods_spec_id'],
+                'goods_attr' => trim($goods_attr,','),
                 'status_str' => $status_str,
                 'status_str' => $status_str,
                 'spec_list' => $goods_spec_list,
                 'spec_list' => $goods_spec_list,
             ];
             ];
@@ -131,21 +132,13 @@ class ShoppingCartServer
         return $data;
         return $data;
     }
     }
 
 
-    /**
-     * 添加购物车
-     * @param $m_id
-     * @param $shop_id
-     * @param $category_id
-     * @param $goods_id
-     * @param $goods_spec_id
-     * @param $number
-     * @return array
-     */
-    function saveShopping($m_id,$shop_id,$category_id,$goods_id,$goods_spec_id,$number)
+    function saveShopping($m_id,$shop_id,$category_id,$goods_id,$goods_spec_id,$goods_spec,$number)
     {
     {
-        if (empty($goods_spec_id)){
-            $goods_spec_id = '';
+        if (empty($goods_spec)){
+            $goods_spec = [];
         }
         }
+        $goods_spec_ids = [];
+        $goods_spec_data = [];
         //获取商品
         //获取商品
         $goods = Goods::where('is_del',0)
         $goods = Goods::where('is_del',0)
             ->where('id',$goods_id)
             ->where('id',$goods_id)
@@ -156,108 +149,264 @@ class ShoppingCartServer
         if (empty($goods)) return ['code' => 0, 'msg' => '当前商品不存在'];
         if (empty($goods)) return ['code' => 0, 'msg' => '当前商品不存在'];
         if ($goods->{'status'} != 1) return ['code' => 0, 'msg' => '当前商品已下架'];
         if ($goods->{'status'} != 1) return ['code' => 0, 'msg' => '当前商品已下架'];
         //如果是单规格但是选择了规格
         //如果是单规格但是选择了规格
-        if ($goods->{'spec_type'} == 1 && !empty($goods_spec_id)){
+        if ($goods->{'spec_type'} == 1 && !empty($goods_spec)){
             return ['code' => 0, 'msg' => '该商品没有规格'];
             return ['code' => 0, 'msg' => '该商品没有规格'];
         }
         }
-        if (!empty($goods_spec_id)){
-            $sku_id = GoodsSpec::where('goods_id',$goods_id)->where('id',$goods_spec_id)->where('is_del',0)->value('sku_id');
-            if (empty($sku_id)){
-                return ['code' => 0, 'msg' => '商品规格错误'];
-            }
-            $skuInfo = GoodsSku::where('goods_id',$goods_id)->where('id',$sku_id)->where('is_del',0)->first();
-            if (empty($skuInfo)){
-                return ['code' => 0, 'msg' => '商品规格不存在'];
+        if (!empty($goods_spec)){
+            foreach ($goods_spec as $spec){
+                $spec_number = $spec['number'];
+                $sku_id = GoodsSpec::where('goods_id',$goods_id)->where('id',$spec['id'])->where('is_del',0)->value('sku_id');
+                if (empty($sku_id)){
+                    return ['code' => 0, 'msg' => '商品规格错误'];
+                }
+                $skuInfo = GoodsSku::where('goods_id',$goods_id)->where('id',$sku_id)->where('is_del',0)->first();
+                if (empty($skuInfo)){
+                    return ['code' => 0, 'msg' => '商品规格不存在'];
+                }
+                if ($skuInfo->{'sku_type'} == 1){//商品只能单选
+                    $spec_number = 1;//单选购物数量只能为1
+                }elseif ($skuInfo->{'sku_type'} == 2 && $skuInfo->{'affect_quantity'} == 0){//可多选规格但是不能多添加购物车数量
+                    $spec_number = 1;//数量只能为1
+                }
+                $goods_spec_ids[] = $spec['id'];
+                $goods_spec_data[] = [
+                    'id' => $spec['id'],
+                    'number' => $spec_number,
+                ];
             }
             }
+
+            sort($goods_spec_ids);
+            $goods_spec_id = implode('_',$goods_spec_ids);
         }
         }
+
         DB::beginTransaction();
         DB::beginTransaction();
+        //获取购物车是否存在此商品
+        $where = [['m_id',$m_id], ['shop_id',$shop_id], ['category_id',$category_id], ['goods_id',$goods_id]];
+        if ($goods_spec_id) $where[] = ['goods_spec_id',$goods_spec_id];
+        //查询此商品购物车数量
+        $shopping_info = Shopping::where($where)->select(['id', 'goods_id', 'number'])->first();
         try {
         try {
-            //获取购物车是否存在此商品
-            $where = [['m_id',$m_id], ['shop_id',$shop_id], ['category_id',$category_id], ['goods_id',$goods_id]];
-            //查询此商品购物车数量
-            $shopping_info = Shopping::where($where)->select(['id', 'goods_id', 'number'])->first();
-
-            if (empty($shopping_info)) {//没用购物车信息
-                //如果商品是多规格但是没选规格
-                if ($goods->{'spec_type'} == 2 && empty($goods_spec_id)){
-                    return ['code' => 0, 'msg' => '请选择商品规格'];
-                }
+            if (empty($shopping_info)) {//没购物车信息
                 if ($number <= 0){
                 if ($number <= 0){
                     DB::rollBack();
                     DB::rollBack();
                     return ['code' => 0, 'msg' => '请选择数量'];
                     return ['code' => 0, 'msg' => '请选择数量'];
                 }
                 }
+                //如果商品是多规格但是没选规格
+                if ($goods->{'spec_type'} == 2 && empty($goods_spec)){
+                    return ['code' => 0, 'msg' => '请选择商品规格'];
+                }
                 //入库
                 //入库
                 $shopping = Shopping::create([
                 $shopping = Shopping::create([
                     'm_id' => $m_id,
                     'm_id' => $m_id,
                     'shop_id' => $shop_id,
                     'shop_id' => $shop_id,
                     'category_id' => $category_id,
                     'category_id' => $category_id,
                     'goods_id' => $goods_id,
                     'goods_id' => $goods_id,
+                    'goods_spec_id' => $goods_spec_id,
                     'number' => $number,
                     'number' => $number,
                 ]);
                 ]);
                 $shopping_id = $shopping->{'id'};
                 $shopping_id = $shopping->{'id'};
                 if (empty($shopping_id)) {
                 if (empty($shopping_id)) {
                     DB::rollBack();
                     DB::rollBack();
-                    return ['code' => 0, 'msg' => '添加失败'];
+                    return ['code' => 0, 'msg' => '操作失败'];
                 }
                 }
-                //如果有规则就入库规则信息
-                if (!empty($goods_spec_id)){
-                    if ($skuInfo->{'sku_type'} == 1){//商品只能单选
-                        $number = 1;//单选购物数量只能为1
-                    }elseif ($skuInfo->{'sku_type'} == 2 && $skuInfo->{'affect_quantity'} == 0){//可多选规格但是不能多添加购物车数量
-                        $number = 1;//数量只能为1
+
+                if (!empty($goods_spec_data)){//规则明细存入
+                    foreach ($goods_spec_data as $spec){
+                        ShoppingDetail::create([
+                            'shopping_id' => $shopping_id,
+                            'goods_id' => $goods_id,
+                            'goods_spec_id' => $spec['id'],
+                            'number' => $spec['number'],
+                        ]);
                     }
                     }
-                    ShoppingDetail::create([
-                        'shopping_id' => $shopping_id,
-                        'goods_id' => $goods_id,
-                        'goods_spec_id' => $goods_spec_id,
-                        'number' => $number,
-                    ]);
                 }
                 }
-            }else{//有购物车信息,更新
-                $shopping_id = $shopping_info->{'id'};
-
-                if (!empty($goods_spec_id)){//选择了规则就是更新购物车详情表
-                    if ($number <= 0){//数量为0直接删除
-                        ShoppingDetail::where('shopping_id',$shopping_info->{'id'})->where('goods_id',$goods_id)->where('goods_spec_id',$goods_spec_id)->delete();//删除详情表
-                    }else{
-                        //检查该规格信息是否讯息
-                        $details = ShoppingDetail::where('shopping_id',$shopping_info->{'id'})->where('goods_id',$goods_id)->where('goods_spec_id',$goods_spec_id)->select(['id'])->first();
-
-                        if ($skuInfo->{'sku_type'} == 1){//商品只能单选
-                            $number = 1;//单选购物数量只能为1
-                        }elseif ($skuInfo->{'sku_type'} == 2 && $skuInfo->{'affect_quantity'} == 0){//可多选规格但是不能多添加购物车数量
-                            $number = 1;//数量只能为1
+            }else{
+                if ($number <= 0){//数量为0直接删除
+                    Shopping::where('id',$shopping_info->{'id'})->delete();//删除主表
+                    ShoppingDetail::where('shopping_id',$shopping_info->{'id'})->delete();//删除详情表
+                }else{
+                    //如果存在购物车
+                    if (!empty($goods_spec)){//多规格商品
+                        $is_create = false;
+                        foreach ($goods_spec as $spec){
+                            $shopping_spec_number = ShoppingDetail::where('shopping_id',$shopping_info->{'id'})
+                                ->where('goods_id',$goods_id)
+                                ->where('goods_spec_id',$spec['id'])
+                                ->value('number');
+                            if ($shopping_spec_number != $spec['number']){
+                                $is_create = true;
+                            }
                         }
                         }
-                        if (empty($details)){
-                            ShoppingDetail::create([
-                                'shopping_id' => $shopping_id,
+                        if ($is_create){//规格数量不一样,创建新的
+                            //入库
+                            $shopping = Shopping::create([
+                                'm_id' => $m_id,
+                                'shop_id' => $shop_id,
+                                'category_id' => $category_id,
                                 'goods_id' => $goods_id,
                                 'goods_id' => $goods_id,
                                 'goods_spec_id' => $goods_spec_id,
                                 'goods_spec_id' => $goods_spec_id,
                                 'number' => $number,
                                 'number' => $number,
                             ]);
                             ]);
-                        }elseif ($skuInfo->{'sku_type'} == 2 && $skuInfo->{'affect_quantity'} == 1){//可多选规格并且能多添加购物车数量
-                            ShoppingDetail::where('shopping_id',$shopping_info->{'id'})->where('goods_id',$goods_id)->where('goods_spec_id',$goods_spec_id)->update(['number' => $number]);//跟新购物车
+                            $shopping_id = $shopping->{'id'};
+                            if (empty($shopping_id)) {
+                                DB::rollBack();
+                                return ['code' => 0, 'msg' => '操作失败'];
+                            }
+
+                            if (!empty($goods_spec_data)){//规则明细存入
+                                foreach ($goods_spec_data as $spec){
+                                    ShoppingDetail::create([
+                                        'shopping_id' => $shopping_id,
+                                        'goods_id' => $goods_id,
+                                        'goods_spec_id' => $spec['id'],
+                                        'number' => $spec['number'],
+                                    ]);
+                                }
+                            }
+                        }else{//规格数量一样,在原来基础上增加
+                            Shopping::where('id',$shopping_info->{'id'})->increment('number',$number);
                         }
                         }
-                    }
-                }else{//没选规则就是更新主表
-                    if ($number <= 0){//数量为0直接删除
-                        Shopping::where('id',$shopping_info->{'id'})->delete();//删除主表
-                        ShoppingDetail::where('shopping_id',$shopping_info->{'id'})->delete();//删除详情表
+
                     }else{
                     }else{
                         Shopping::where('id',$shopping_info->{'id'})->update(['number' => $number]);
                         Shopping::where('id',$shopping_info->{'id'})->update(['number' => $number]);
                     }
                     }
                 }
                 }
-
             }
             }
 
 
-
             DB::commit();
             DB::commit();
-            return ['code' => 1, 'msg' => '添加成功'];
+            return ['code' => 1, 'msg' => '操作成功'];
         }catch (\Exception $e){
         }catch (\Exception $e){
             DB::rollBack();
             DB::rollBack();
-            return ['code' => 0, 'msg' => '添加失败'];
+            return ['code' => 0, 'msg' => '操作失败'];
         }
         }
-
     }
     }
+//    /**
+//     * 添加购物车
+//     * @param $m_id
+//     * @param $shop_id
+//     * @param $category_id
+//     * @param $goods_id
+//     * @param $goods_spec_id
+//     * @param $number
+//     * @return array
+//     */
+//    function saveShopping($m_id,$shop_id,$category_id,$goods_id,$goods_spec_id,$number)
+//    {
+//        if (empty($goods_spec_id)){
+//            $goods_spec_id = '';
+//        }
+//        //获取商品
+//        $goods = Goods::where('is_del',0)
+//            ->where('id',$goods_id)
+//            ->where('shop_id',$shop_id)
+//            ->where('category_id',$category_id)
+//            ->select(['id as goods_id','status','spec_type'])
+//            ->first();
+//        if (empty($goods)) return ['code' => 0, 'msg' => '当前商品不存在'];
+//        if ($goods->{'status'} != 1) return ['code' => 0, 'msg' => '当前商品已下架'];
+//        //如果是单规格但是选择了规格
+//        if ($goods->{'spec_type'} == 1 && !empty($goods_spec_id)){
+//            return ['code' => 0, 'msg' => '该商品没有规格'];
+//        }
+//        if (!empty($goods_spec_id)){
+//            $sku_id = GoodsSpec::where('goods_id',$goods_id)->where('id',$goods_spec_id)->where('is_del',0)->value('sku_id');
+//            if (empty($sku_id)){
+//                return ['code' => 0, 'msg' => '商品规格错误'];
+//            }
+//            $skuInfo = GoodsSku::where('goods_id',$goods_id)->where('id',$sku_id)->where('is_del',0)->first();
+//            if (empty($skuInfo)){
+//                return ['code' => 0, 'msg' => '商品规格不存在'];
+//            }
+//        }
+//        DB::beginTransaction();
+//        try {
+//            //获取购物车是否存在此商品
+//            $where = [['m_id',$m_id], ['shop_id',$shop_id], ['category_id',$category_id], ['goods_id',$goods_id]];
+//            //查询此商品购物车数量
+//            $shopping_info = Shopping::where($where)->select(['id', 'goods_id', 'number'])->first();
+//
+//            if (empty($shopping_info)) {//没用购物车信息
+//                //如果商品是多规格但是没选规格
+//                if ($goods->{'spec_type'} == 2 && empty($goods_spec_id)){
+//                    return ['code' => 0, 'msg' => '请选择商品规格'];
+//                }
+//                if ($number <= 0){
+//                    DB::rollBack();
+//                    return ['code' => 0, 'msg' => '请选择数量'];
+//                }
+//                //入库
+//                $shopping = Shopping::create([
+//                    'm_id' => $m_id,
+//                    'shop_id' => $shop_id,
+//                    'category_id' => $category_id,
+//                    'goods_id' => $goods_id,
+//                    'number' => $number,
+//                ]);
+//                $shopping_id = $shopping->{'id'};
+//                if (empty($shopping_id)) {
+//                    DB::rollBack();
+//                    return ['code' => 0, 'msg' => '添加失败'];
+//                }
+//                //如果有规则就入库规则信息
+//                if (!empty($goods_spec_id)){
+//                    if ($skuInfo->{'sku_type'} == 1){//商品只能单选
+//                        $number = 1;//单选购物数量只能为1
+//                    }elseif ($skuInfo->{'sku_type'} == 2 && $skuInfo->{'affect_quantity'} == 0){//可多选规格但是不能多添加购物车数量
+//                        $number = 1;//数量只能为1
+//                    }
+//                    ShoppingDetail::create([
+//                        'shopping_id' => $shopping_id,
+//                        'goods_id' => $goods_id,
+//                        'goods_spec_id' => $goods_spec_id,
+//                        'number' => $number,
+//                    ]);
+//                }
+//            }else{//有购物车信息,更新
+//                $shopping_id = $shopping_info->{'id'};
+//
+//                if (!empty($goods_spec_id)){//选择了规则就是更新购物车详情表
+//                    if ($number <= 0){//数量为0直接删除
+//                        ShoppingDetail::where('shopping_id',$shopping_info->{'id'})->where('goods_id',$goods_id)->where('goods_spec_id',$goods_spec_id)->delete();//删除详情表
+//                    }else{
+//                        //检查该规格信息是否讯息
+//                        $details = ShoppingDetail::where('shopping_id',$shopping_info->{'id'})->where('goods_id',$goods_id)->where('goods_spec_id',$goods_spec_id)->select(['id'])->first();
+//
+//                        if ($skuInfo->{'sku_type'} == 1){//商品只能单选
+//                            $number = 1;//单选购物数量只能为1
+//                        }elseif ($skuInfo->{'sku_type'} == 2 && $skuInfo->{'affect_quantity'} == 0){//可多选规格但是不能多添加购物车数量
+//                            $number = 1;//数量只能为1
+//                        }
+//                        if (empty($details)){
+//                            ShoppingDetail::create([
+//                                'shopping_id' => $shopping_id,
+//                                'goods_id' => $goods_id,
+//                                'goods_spec_id' => $goods_spec_id,
+//                                'number' => $number,
+//                            ]);
+//                        }elseif ($skuInfo->{'sku_type'} == 2 && $skuInfo->{'affect_quantity'} == 1){//可多选规格并且能多添加购物车数量
+//                            ShoppingDetail::where('shopping_id',$shopping_info->{'id'})->where('goods_id',$goods_id)->where('goods_spec_id',$goods_spec_id)->update(['number' => $number]);//跟新购物车
+//                        }
+//                    }
+//                }else{//没选规则就是更新主表
+//                    if ($number <= 0){//数量为0直接删除
+//                        Shopping::where('id',$shopping_info->{'id'})->delete();//删除主表
+//                        ShoppingDetail::where('shopping_id',$shopping_info->{'id'})->delete();//删除详情表
+//                    }else{
+//                        Shopping::where('id',$shopping_info->{'id'})->update(['number' => $number]);
+//                    }
+//                }
+//
+//            }
+//
+//
+//            DB::commit();
+//            return ['code' => 1, 'msg' => '添加成功'];
+//        }catch (\Exception $e){
+//            DB::rollBack();
+//            return ['code' => 0, 'msg' => '添加失败'];
+//        }
+//
+//    }
 
 
 
 
     /**
     /**
@@ -288,4 +437,95 @@ class ShoppingCartServer
 
 
     }
     }
 
 
+    /**
+     * 本地购物车数据组装获取
+     * @param $cartInfo
+     * @return array
+     */
+    function getCartList($cartInfo)
+    {
+        $total_num = 0;//总商品数
+        $total_goods_money = '0.00';//总商品费用
+        $total_pack_price = 0;//打包费
+        $goods_list = [];
+        foreach ($cartInfo['goods_list'] as $value){
+            $goods = Goods::where('id',$value['goods_id'])
+                ->select(['id as goods_id','shop_id','status','goods_name','goods_image','price','spec_type','category_id','pack_price'])
+                ->orderBy('id','asc')
+                ->first();
+            if (empty($goods)){
+                return ['code' => 0, 'msg' => '商品不存在'];
+            }
+            if ($goods->{'status'} != 1){
+                return ['code' => 0, 'msg' => '商品已下架'];
+            }
+            $goods_price = $goods->{'price'};//商品价格
+            $goods_number = $value['goods_number'];//商品购买数量
+            $goods_spec_list = [];
+            $goods_spec_price = 0;
+            $goods_attr = '';
+            if ($goods->{'spec_type'} == 2 && !empty($value['goods_spec'])){//存在规格
+                foreach ($value['goods_spec'] as $spec){
+                    $specInfo = GoodsSpec::where('goods_id',$value['goods_id'])
+                        ->where('id',$spec['id'])
+                        ->where('is_del',0)
+                        ->select(['spec_name','spec_price'])
+                        ->first();
+                    if (empty($specInfo)){
+                        return ['code' => 0, 'msg' => '规则不存在'];
+                    }
+                    if ($spec['number'] > 1){
+                        $goods_attr .= $specInfo['spec_name'].'x'.$spec['number'] . ',';
+                    }else{
+                        $goods_attr .= $specInfo['spec_name'] . ',';
+                    }
+                    $goods_spec_price =  bcadd($goods_spec_price,bcmul($spec['number'],$specInfo['spec_price'],2),2);//规格数量乘以价格等于 规格总价
+
+                    $goods_spec_list[] = [
+                        'goods_id' => $value['goods_id'],
+                        'goods_spec_id' => $spec['id'],
+                        'spec_price' => $specInfo['spec_price'],
+                        'spec_name' => $specInfo['spec_name'],
+                        'number' => $spec['number'],
+                    ];
+                }
+            }
+            //计算价格
+            $goods_money = bcmul($goods_number,bcadd($goods_price,$goods_spec_price,2),2);//商品价格等于 商品数量X(商品底价+商品规格总价)
+
+
+            $goods_list[] = [
+                'shop_id' => $goods['shop_id'],
+                'category_id' => $goods['category_id'],
+                'goods_id' => $goods['goods_id'],
+                'goods_money' => rtrim(rtrim($goods_money, '0'),'.'),
+                'goods_number' => $goods_number,
+                'goods_name' => $goods['goods_name'],
+                'goods_image' => $goods['goods_image'],
+                'spec_type' => $goods['spec_type'],
+                'price' => $goods_price,
+                'pack_price' => $goods['pack_price'],
+                'goods_spec_id' => $goods['goods_spec_id'],
+                'goods_attr' => trim($goods_attr,','),
+                'spec_list' => $goods_spec_list,
+            ];
+            //计算打包费
+            $total_pack_price = bcadd($total_pack_price,bcmul($goods_number,$goods['pack_price'],2),2);
+            //计算总数量
+            $total_num += $goods_number;
+            //计算总商品费用
+            $total_goods_money = bcadd($total_goods_money,$goods_money,2);
+        }
+
+        //订单总价-商品总价+总包装费
+        $total_price = bcadd($total_goods_money,$total_pack_price,2);
+
+        $data['total_price'] = rtrim(rtrim($total_price, '0'),'.');
+        $data['total_num'] = (int)$total_num;
+        $data['total_goods_money'] = rtrim(rtrim($total_goods_money, '0'),'.');
+        $data['pack_price'] = $total_pack_price;
+        $data['goods_list'] = $goods_list;
+
+        return ['code' => 1, 'msg' => '成功', 'data'=>$data];
+    }
 }
 }

+ 1 - 1
app/Servers/WeixinServer.php

@@ -361,7 +361,7 @@ class WeixinServer
 //        var_dump($conf);
 //        var_dump($conf);
         $order = new Unifiedorder($conf);
         $order = new Unifiedorder($conf);
         $request = $order->getOrder($this->private_key);
         $request = $order->getOrder($this->private_key);
-//        var_dump($request);
+
         if ($request['code'] == 1) {
         if ($request['code'] == 1) {
             $datas["appId"] = $request['data']['appid'];
             $datas["appId"] = $request['data']['appid'];
             $datas["nonceStr"] = $order->getNonceStr();
             $datas["nonceStr"] = $order->getNonceStr();

+ 0 - 1
app/Servers/printer/NoteFormatterServer.php

@@ -90,7 +90,6 @@ class NoteFormatterServer
         $result = $result . $quantityStr . str_repeat(" ", self::MAX_QUANTITY_CHAR_LEN - $quantityLen);
         $result = $result . $quantityStr . str_repeat(" ", self::MAX_QUANTITY_CHAR_LEN - $quantityLen);
         $result = $result . $priceStr . str_repeat(" ", self::MAX_PRICE_CHAR_LEN - $priceLen);
         $result = $result . $priceStr . str_repeat(" ", self::MAX_PRICE_CHAR_LEN - $priceLen);
 
 
-//        $result = '<L><HB>'.$result . "</L></HB><BR>";
 
 
         return $result;
         return $result;
     }
     }

+ 1 - 1
app/Servers/printer/PrinterServer.php

@@ -116,7 +116,7 @@ class PrinterServer
             $order = Order::where('id',$order_id)
             $order = Order::where('id',$order_id)
                 ->where('is_del',0)
                 ->where('is_del',0)
                 ->where('order_status',2)
                 ->where('order_status',2)
-                ->select(['id','order_sn','m_id','order_type','number','note','pay_money','goods_number','pack_price','created_at','shop_id'])
+                ->select(['id','order_sn','m_id','order_type','number','note','pay_money','goods_number','pack_price','created_at','shop_id','table_number','diner_number'])
                 ->first();
                 ->first();
             if (empty($order)) {
             if (empty($order)) {
                 ErrorRecord::create(['msg' => '订单不存在打印失败:', 'data' => $order_id]);
                 ErrorRecord::create(['msg' => '订单不存在打印失败:', 'data' => $order_id]);

+ 15 - 23
app/Servers/printer/SpyunServer.php

@@ -175,17 +175,17 @@ class SpyunServer
     function getSpyunContent($order)
     function getSpyunContent($order)
     {
     {
         $orderItem = $order->{'item'};
         $orderItem = $order->{'item'};
-
+        if ($order->{'order_type'} == 1){
+            $str = '堂食';
+        }else{
+            $str = '打包';
+        }
         $NoteFormatterServer = NoteFormatterServer::creatServer();
         $NoteFormatterServer = NoteFormatterServer::creatServer();
-        $content = '<CB>#' . $order->{'number'} . ' 君子校园</CB><BR>';
-        $content .= '<C>' . $order->{'shop_name'} . '<C><BR>';
+        $content = '<CB>#' . $order->{'number'} .$str.'</CB><BR>';
+        $content .= '<C>桌号:' . $order->{'table_number'} . '</C><BR>';
         $content .= str_repeat('-', 32) . "<BR>";
         $content .= str_repeat('-', 32) . "<BR>";
-
-        $content .= '<CB>建议制作时间:' . $order->{'time_str'} . '</CB><BR>';
-        $content .= '期望送达时间:' . $order->{'time'} . '<BR>';
         //下单时间
         //下单时间
 
 
-        $content .= str_repeat('-', 32) . "<BR>";
         $content .= '下单时间:'.$order->{'created_at'}. '<BR>';
         $content .= '下单时间:'.$order->{'created_at'}. '<BR>';
         $content .= '订单编号:'.$order->{'order_sn'}. '<BR>';
         $content .= '订单编号:'.$order->{'order_sn'}. '<BR>';
         $content .= str_repeat('-', 32) . "<BR>";
         $content .= str_repeat('-', 32) . "<BR>";
@@ -194,19 +194,13 @@ class SpyunServer
             $goods_name = $value->{'goods_name'} . '(' . $value->{'goods_attr'} . ')';
             $goods_name = $value->{'goods_name'} . '(' . $value->{'goods_attr'} . ')';
             $content .=  '<H>'.$NoteFormatterServer::formatPrintOrderItem($goods_name, $value->{'goods_number'}, $value->{'goods_price'}). '</H><BR>';
             $content .=  '<H>'.$NoteFormatterServer::formatPrintOrderItem($goods_name, $value->{'goods_number'}, $value->{'goods_price'}). '</H><BR>';
         }
         }
+//        dd($content);
         $content .= '<B>共:' . $order->{'goods_number'} . '件</B><BR>';
         $content .= '<B>共:' . $order->{'goods_number'} . '件</B><BR>';
         $content .= '<L1>' . '备注:'.$order->{'note'} . '</L1><BR>';
         $content .= '<L1>' . '备注:'.$order->{'note'} . '</L1><BR>';
         $content .= str_repeat('-', 32) . '<BR>';
         $content .= str_repeat('-', 32) . '<BR>';
         $content .= '打包费:' . $order->{'pack_price'} .  '<BR>';
         $content .= '打包费:' . $order->{'pack_price'} .  '<BR>';
-        $content .= '促销优惠:' . $order->{'coupon_money'} .  '<BR>';
+        $content .= '就餐人数:' . $order->{'diner_number'} .  '<BR>';
         $content .= '<H>' . '合计支付:' . $order->{'pay_money'} .  '</H><BR>';
         $content .= '<H>' . '合计支付:' . $order->{'pay_money'} .  '</H><BR>';
-        $content .= str_repeat('-', 32) . '<BR>';
-
-        $content .= '<L1>' . $order->{'consignee'} . '<L1><BR>';
-        $content .= '<L1>' . $order->{'phone'} . '<L1><BR>';
-        $content .= '<L1>' . $order->{'school_name'} . $order->{'dorm_name'} . $order->{'address'} . '<L1><BR>';
-        $content .= '<QRCODE>'.$order->{'m_id'} . '_' .$order->{'order_sn'}.'</QRCODE>';
-        $content .= '<BR>';
         $content .= '<CB>***结束***</CB><BR><BR>';
         $content .= '<CB>***结束***</CB><BR><BR>';
 
 
         return $content;
         return $content;
@@ -214,8 +208,12 @@ class SpyunServer
 
 
     function getSpyunCancelOrderContent($order)
     function getSpyunCancelOrderContent($order)
     {
     {
-        $content = '<CB>#' . $order->{'number'} . ' XXXX</CB><BR>';
-//        $content .= '<C>' . 店铺名称 . '<C><BR>';
+        if ($order->{'order_type'} == 1){
+            $str = '堂食';
+        }else{
+            $str = '打包';
+        }
+        $content = '<CB>#' . $order->{'number'} . $str.'</CB><BR>';
         $content .= str_repeat('-', 32) . "<BR>";
         $content .= str_repeat('-', 32) . "<BR>";
 
 
         $content .= '<CB>用户申请取消订单并退款,请处理</CB><BR>';
         $content .= '<CB>用户申请取消订单并退款,请处理</CB><BR>';
@@ -224,12 +222,6 @@ class SpyunServer
         $content .= str_repeat('-', 32) . "<BR>";
         $content .= str_repeat('-', 32) . "<BR>";
         $content .= '下单时间:'.$order->{'created_at'}. '<BR>';
         $content .= '下单时间:'.$order->{'created_at'}. '<BR>';
         $content .= '订单编号:'.$order->{'order_sn'}. '<BR>';
         $content .= '订单编号:'.$order->{'order_sn'}. '<BR>';
-        $content .= str_repeat('-', 32) . "<BR>";
-
-        $content .= '<L1>' . $order->{'consignee'} . '<L1><BR>';
-        $content .= '<L1>' . $order->{'phone'} . '<L1><BR>';
-        $content .= '<L1>' . $order->{'school_name'} . $order->{'dorm_name'} . $order->{'address'} . '<L1><BR>';
-        $content .= '<QRCODE>'.$order->{'m_id'} . '_' .$order->{'order_sn'}.'</QRCODE>';
         $content .= '<BR>';
         $content .= '<BR>';
         $content .= '<CB>***结束***</CB><BR><BR>';
         $content .= '<CB>***结束***</CB><BR><BR>';
 
 

+ 1 - 0
app/Servers/weixin/Unifiedorder.php

@@ -225,6 +225,7 @@ class Unifiedorder
         $request=curl_exec($ch);
         $request=curl_exec($ch);
         curl_close($ch);
         curl_close($ch);
         $request=json_decode(json_encode(simplexml_load_string($request, 'SimpleXMLElement', LIBXML_NOCDATA)),true);
         $request=json_decode(json_encode(simplexml_load_string($request, 'SimpleXMLElement', LIBXML_NOCDATA)),true);
+
         if($request['return_code']=='SUCCESS'&&$request['result_code']=='SUCCESS')
         if($request['return_code']=='SUCCESS'&&$request['result_code']=='SUCCESS')
         {
         {
 
 

+ 1 - 1
composer.json

@@ -11,6 +11,7 @@
         "php": "^7.3",
         "php": "^7.3",
         "alibabacloud/sts": "^1.8",
         "alibabacloud/sts": "^1.8",
         "aliyuncs/oss-sdk-php": "^2.7",
         "aliyuncs/oss-sdk-php": "^2.7",
+        "barryvdh/laravel-ide-helper": "*",
         "doctrine/dbal": "^3.9",
         "doctrine/dbal": "^3.9",
         "fideloper/proxy": "^4.2",
         "fideloper/proxy": "^4.2",
         "fruitcake/laravel-cors": "^2.0",
         "fruitcake/laravel-cors": "^2.0",
@@ -21,7 +22,6 @@
         "phpoffice/phpspreadsheet": "^1.29"
         "phpoffice/phpspreadsheet": "^1.29"
     },
     },
     "require-dev": {
     "require-dev": {
-        "barryvdh/laravel-ide-helper": "^2.14",
         "facade/ignition": "^2.3.6",
         "facade/ignition": "^2.3.6",
         "fzaninotto/faker": "^1.9.1",
         "fzaninotto/faker": "^1.9.1",
         "mockery/mockery": "^1.3.1",
         "mockery/mockery": "^1.3.1",

+ 450 - 450
composer.lock

@@ -4,7 +4,7 @@
         "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
         "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
         "This file is @generated automatically"
         "This file is @generated automatically"
     ],
     ],
-    "content-hash": "9d8d617988189a6e8818968f389a1ee1",
+    "content-hash": "e3d402876ae8e91d4d734eee88a555b9",
     "packages": [
     "packages": [
         {
         {
             "name": "adbario/php-dot-notation",
             "name": "adbario/php-dot-notation",
@@ -326,6 +326,164 @@
             },
             },
             "time": "2025-03-13T08:50:04+00:00"
             "time": "2025-03-13T08:50:04+00:00"
         },
         },
+        {
+            "name": "barryvdh/laravel-ide-helper",
+            "version": "v2.14.0",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/barryvdh/laravel-ide-helper.git",
+                "reference": "485c756f6cff408d6b273274c5e86112c3973d98"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/barryvdh/laravel-ide-helper/zipball/485c756f6cff408d6b273274c5e86112c3973d98",
+                "reference": "485c756f6cff408d6b273274c5e86112c3973d98",
+                "shasum": "",
+                "mirrors": [
+                    {
+                        "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
+                        "preferred": true
+                    }
+                ]
+            },
+            "require": {
+                "barryvdh/reflection-docblock": "^2.0.6",
+                "composer/class-map-generator": "^1.0",
+                "doctrine/dbal": "^2.6 || ^3",
+                "ext-json": "*",
+                "illuminate/console": "^8 || ^9 || ^10",
+                "illuminate/filesystem": "^8 || ^9 || ^10",
+                "illuminate/support": "^8 || ^9 || ^10",
+                "nikic/php-parser": "^4.18 || ^5",
+                "php": "^7.3 || ^8.0",
+                "phpdocumentor/type-resolver": "^1.1.0"
+            },
+            "require-dev": {
+                "ext-pdo_sqlite": "*",
+                "friendsofphp/php-cs-fixer": "^2",
+                "illuminate/config": "^8 || ^9 || ^10",
+                "illuminate/view": "^8 || ^9 || ^10",
+                "mockery/mockery": "^1.4",
+                "orchestra/testbench": "^6 || ^7 || ^8",
+                "phpunit/phpunit": "^8.5 || ^9",
+                "spatie/phpunit-snapshot-assertions": "^3 || ^4",
+                "vimeo/psalm": "^5.4"
+            },
+            "suggest": {
+                "illuminate/events": "Required for automatic helper generation (^6|^7|^8|^9|^10)."
+            },
+            "type": "library",
+            "extra": {
+                "laravel": {
+                    "providers": [
+                        "Barryvdh\\LaravelIdeHelper\\IdeHelperServiceProvider"
+                    ]
+                },
+                "branch-alias": {
+                    "dev-master": "2.14-dev"
+                }
+            },
+            "autoload": {
+                "psr-4": {
+                    "Barryvdh\\LaravelIdeHelper\\": "src"
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Barry vd. Heuvel",
+                    "email": "barryvdh@gmail.com"
+                }
+            ],
+            "description": "Laravel IDE Helper, generates correct PHPDocs for all Facade classes, to improve auto-completion.",
+            "keywords": [
+                "autocomplete",
+                "codeintel",
+                "helper",
+                "ide",
+                "laravel",
+                "netbeans",
+                "phpdoc",
+                "phpstorm",
+                "sublime"
+            ],
+            "support": {
+                "issues": "https://github.com/barryvdh/laravel-ide-helper/issues",
+                "source": "https://github.com/barryvdh/laravel-ide-helper/tree/v2.14.0"
+            },
+            "funding": [
+                {
+                    "url": "https://fruitcake.nl",
+                    "type": "custom"
+                },
+                {
+                    "url": "https://github.com/barryvdh",
+                    "type": "github"
+                }
+            ],
+            "time": "2024-02-05T08:16:36+00:00"
+        },
+        {
+            "name": "barryvdh/reflection-docblock",
+            "version": "v2.3.1",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/barryvdh/ReflectionDocBlock.git",
+                "reference": "b6ff9f93603561f50e53b64310495d20b8dff5d8"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/barryvdh/ReflectionDocBlock/zipball/b6ff9f93603561f50e53b64310495d20b8dff5d8",
+                "reference": "b6ff9f93603561f50e53b64310495d20b8dff5d8",
+                "shasum": "",
+                "mirrors": [
+                    {
+                        "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
+                        "preferred": true
+                    }
+                ]
+            },
+            "require": {
+                "php": ">=7.1"
+            },
+            "require-dev": {
+                "phpunit/phpunit": "^8.5.14|^9"
+            },
+            "suggest": {
+                "dflydev/markdown": "~1.0",
+                "erusev/parsedown": "~1.0"
+            },
+            "type": "library",
+            "extra": {
+                "branch-alias": {
+                    "dev-master": "2.3.x-dev"
+                }
+            },
+            "autoload": {
+                "psr-0": {
+                    "Barryvdh": [
+                        "src/"
+                    ]
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Mike van Riel",
+                    "email": "mike.vanriel@naenius.com"
+                }
+            ],
+            "support": {
+                "source": "https://github.com/barryvdh/ReflectionDocBlock/tree/v2.3.1"
+            },
+            "time": "2025-01-18T19:26:32+00:00"
+        },
         {
         {
             "name": "brick/math",
             "name": "brick/math",
             "version": "0.9.3",
             "version": "0.9.3",
@@ -525,6 +683,81 @@
             },
             },
             "time": "2021-05-18T17:55:57+00:00"
             "time": "2021-05-18T17:55:57+00:00"
         },
         },
+        {
+            "name": "composer/class-map-generator",
+            "version": "1.7.0",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/composer/class-map-generator.git",
+                "reference": "2373419b7709815ed323ebf18c3c72d03ff4a8a6"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/composer/class-map-generator/zipball/2373419b7709815ed323ebf18c3c72d03ff4a8a6",
+                "reference": "2373419b7709815ed323ebf18c3c72d03ff4a8a6",
+                "shasum": "",
+                "mirrors": [
+                    {
+                        "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
+                        "preferred": true
+                    }
+                ]
+            },
+            "require": {
+                "composer/pcre": "^2.1 || ^3.1",
+                "php": "^7.2 || ^8.0",
+                "symfony/finder": "^4.4 || ^5.3 || ^6 || ^7 || ^8"
+            },
+            "require-dev": {
+                "phpstan/phpstan": "^1.12 || ^2",
+                "phpstan/phpstan-deprecation-rules": "^1 || ^2",
+                "phpstan/phpstan-phpunit": "^1 || ^2",
+                "phpstan/phpstan-strict-rules": "^1.1 || ^2",
+                "phpunit/phpunit": "^8",
+                "symfony/filesystem": "^5.4 || ^6 || ^7 || ^8"
+            },
+            "type": "library",
+            "extra": {
+                "branch-alias": {
+                    "dev-main": "1.x-dev"
+                }
+            },
+            "autoload": {
+                "psr-4": {
+                    "Composer\\ClassMapGenerator\\": "src"
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Jordi Boggiano",
+                    "email": "j.boggiano@seld.be",
+                    "homepage": "https://seld.be"
+                }
+            ],
+            "description": "Utilities to scan PHP code and generate class maps.",
+            "keywords": [
+                "classmap"
+            ],
+            "support": {
+                "issues": "https://github.com/composer/class-map-generator/issues",
+                "source": "https://github.com/composer/class-map-generator/tree/1.7.0"
+            },
+            "funding": [
+                {
+                    "url": "https://packagist.com",
+                    "type": "custom"
+                },
+                {
+                    "url": "https://github.com/composer",
+                    "type": "github"
+                }
+            ],
+            "time": "2025-11-19T10:41:15+00:00"
+        },
         {
         {
             "name": "composer/pcre",
             "name": "composer/pcre",
             "version": "3.3.2",
             "version": "3.3.2",
@@ -3640,17 +3873,17 @@
             "time": "2022-01-27T09:35:39+00:00"
             "time": "2022-01-27T09:35:39+00:00"
         },
         },
         {
         {
-            "name": "phpoffice/phpspreadsheet",
-            "version": "1.30.1",
+            "name": "phpdocumentor/reflection-common",
+            "version": "2.2.0",
             "source": {
             "source": {
                 "type": "git",
                 "type": "git",
-                "url": "https://github.com/PHPOffice/PhpSpreadsheet.git",
-                "reference": "fa8257a579ec623473eabfe49731de5967306c4c"
+                "url": "https://github.com/phpDocumentor/ReflectionCommon.git",
+                "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b"
             },
             },
             "dist": {
             "dist": {
                 "type": "zip",
                 "type": "zip",
-                "url": "https://api.github.com/repos/PHPOffice/PhpSpreadsheet/zipball/fa8257a579ec623473eabfe49731de5967306c4c",
-                "reference": "fa8257a579ec623473eabfe49731de5967306c4c",
+                "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/1d01c49d4ed62f25aa84a747ad35d5a16924662b",
+                "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b",
                 "shasum": "",
                 "shasum": "",
                 "mirrors": [
                 "mirrors": [
                     {
                     {
@@ -3660,17 +3893,140 @@
                 ]
                 ]
             },
             },
             "require": {
             "require": {
-                "composer/pcre": "^1||^2||^3",
-                "ext-ctype": "*",
-                "ext-dom": "*",
-                "ext-fileinfo": "*",
-                "ext-gd": "*",
-                "ext-iconv": "*",
-                "ext-libxml": "*",
-                "ext-mbstring": "*",
-                "ext-simplexml": "*",
-                "ext-xml": "*",
-                "ext-xmlreader": "*",
+                "php": "^7.2 || ^8.0"
+            },
+            "type": "library",
+            "extra": {
+                "branch-alias": {
+                    "dev-2.x": "2.x-dev"
+                }
+            },
+            "autoload": {
+                "psr-4": {
+                    "phpDocumentor\\Reflection\\": "src/"
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Jaap van Otterdijk",
+                    "email": "opensource@ijaap.nl"
+                }
+            ],
+            "description": "Common reflection classes used by phpdocumentor to reflect the code structure",
+            "homepage": "http://www.phpdoc.org",
+            "keywords": [
+                "FQSEN",
+                "phpDocumentor",
+                "phpdoc",
+                "reflection",
+                "static analysis"
+            ],
+            "support": {
+                "issues": "https://github.com/phpDocumentor/ReflectionCommon/issues",
+                "source": "https://github.com/phpDocumentor/ReflectionCommon/tree/2.x"
+            },
+            "time": "2020-06-27T09:03:43+00:00"
+        },
+        {
+            "name": "phpdocumentor/type-resolver",
+            "version": "1.12.0",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/phpDocumentor/TypeResolver.git",
+                "reference": "92a98ada2b93d9b201a613cb5a33584dde25f195"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/92a98ada2b93d9b201a613cb5a33584dde25f195",
+                "reference": "92a98ada2b93d9b201a613cb5a33584dde25f195",
+                "shasum": "",
+                "mirrors": [
+                    {
+                        "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
+                        "preferred": true
+                    }
+                ]
+            },
+            "require": {
+                "doctrine/deprecations": "^1.0",
+                "php": "^7.3 || ^8.0",
+                "phpdocumentor/reflection-common": "^2.0",
+                "phpstan/phpdoc-parser": "^1.18|^2.0"
+            },
+            "require-dev": {
+                "ext-tokenizer": "*",
+                "phpbench/phpbench": "^1.2",
+                "phpstan/extension-installer": "^1.1",
+                "phpstan/phpstan": "^1.8",
+                "phpstan/phpstan-phpunit": "^1.1",
+                "phpunit/phpunit": "^9.5",
+                "rector/rector": "^0.13.9",
+                "vimeo/psalm": "^4.25"
+            },
+            "type": "library",
+            "extra": {
+                "branch-alias": {
+                    "dev-1.x": "1.x-dev"
+                }
+            },
+            "autoload": {
+                "psr-4": {
+                    "phpDocumentor\\Reflection\\": "src"
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Mike van Riel",
+                    "email": "me@mikevanriel.com"
+                }
+            ],
+            "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names",
+            "support": {
+                "issues": "https://github.com/phpDocumentor/TypeResolver/issues",
+                "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.12.0"
+            },
+            "time": "2025-11-21T15:09:14+00:00"
+        },
+        {
+            "name": "phpoffice/phpspreadsheet",
+            "version": "1.30.1",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/PHPOffice/PhpSpreadsheet.git",
+                "reference": "fa8257a579ec623473eabfe49731de5967306c4c"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/PHPOffice/PhpSpreadsheet/zipball/fa8257a579ec623473eabfe49731de5967306c4c",
+                "reference": "fa8257a579ec623473eabfe49731de5967306c4c",
+                "shasum": "",
+                "mirrors": [
+                    {
+                        "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
+                        "preferred": true
+                    }
+                ]
+            },
+            "require": {
+                "composer/pcre": "^1||^2||^3",
+                "ext-ctype": "*",
+                "ext-dom": "*",
+                "ext-fileinfo": "*",
+                "ext-gd": "*",
+                "ext-iconv": "*",
+                "ext-libxml": "*",
+                "ext-mbstring": "*",
+                "ext-simplexml": "*",
+                "ext-xml": "*",
+                "ext-xmlreader": "*",
                 "ext-xmlwriter": "*",
                 "ext-xmlwriter": "*",
                 "ext-zip": "*",
                 "ext-zip": "*",
                 "ext-zlib": "*",
                 "ext-zlib": "*",
@@ -3833,6 +4189,59 @@
             ],
             ],
             "time": "2024-07-20T21:41:07+00:00"
             "time": "2024-07-20T21:41:07+00:00"
         },
         },
+        {
+            "name": "phpstan/phpdoc-parser",
+            "version": "1.29.0",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/phpstan/phpdoc-parser.git",
+                "reference": "536889f2b340489d328f5ffb7b02bb6b183ddedc"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/536889f2b340489d328f5ffb7b02bb6b183ddedc",
+                "reference": "536889f2b340489d328f5ffb7b02bb6b183ddedc",
+                "shasum": "",
+                "mirrors": [
+                    {
+                        "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
+                        "preferred": true
+                    }
+                ]
+            },
+            "require": {
+                "php": "^7.2 || ^8.0"
+            },
+            "require-dev": {
+                "doctrine/annotations": "^2.0",
+                "nikic/php-parser": "^4.15",
+                "php-parallel-lint/php-parallel-lint": "^1.2",
+                "phpstan/extension-installer": "^1.0",
+                "phpstan/phpstan": "^1.5",
+                "phpstan/phpstan-phpunit": "^1.1",
+                "phpstan/phpstan-strict-rules": "^1.0",
+                "phpunit/phpunit": "^9.5",
+                "symfony/process": "^5.2"
+            },
+            "type": "library",
+            "autoload": {
+                "psr-4": {
+                    "PHPStan\\PhpDocParser\\": [
+                        "src/"
+                    ]
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "description": "PHPDoc parser with support for nullable, intersection and generic types",
+            "support": {
+                "issues": "https://github.com/phpstan/phpdoc-parser/issues",
+                "source": "https://github.com/phpstan/phpdoc-parser/tree/1.29.0"
+            },
+            "time": "2024-05-06T12:04:23+00:00"
+        },
         {
         {
             "name": "psr/cache",
             "name": "psr/cache",
             "version": "1.0.1",
             "version": "1.0.1",
@@ -7265,17 +7674,17 @@
     ],
     ],
     "packages-dev": [
     "packages-dev": [
         {
         {
-            "name": "barryvdh/laravel-ide-helper",
-            "version": "v2.14.0",
+            "name": "doctrine/instantiator",
+            "version": "1.5.0",
             "source": {
             "source": {
                 "type": "git",
                 "type": "git",
-                "url": "https://github.com/barryvdh/laravel-ide-helper.git",
-                "reference": "485c756f6cff408d6b273274c5e86112c3973d98"
+                "url": "https://github.com/doctrine/instantiator.git",
+                "reference": "0a0fa9780f5d4e507415a065172d26a98d02047b"
             },
             },
             "dist": {
             "dist": {
                 "type": "zip",
                 "type": "zip",
-                "url": "https://api.github.com/repos/barryvdh/laravel-ide-helper/zipball/485c756f6cff408d6b273274c5e86112c3973d98",
-                "reference": "485c756f6cff408d6b273274c5e86112c3973d98",
+                "url": "https://api.github.com/repos/doctrine/instantiator/zipball/0a0fa9780f5d4e507415a065172d26a98d02047b",
+                "reference": "0a0fa9780f5d4e507415a065172d26a98d02047b",
                 "shasum": "",
                 "shasum": "",
                 "mirrors": [
                 "mirrors": [
                     {
                     {
@@ -7285,45 +7694,22 @@
                 ]
                 ]
             },
             },
             "require": {
             "require": {
-                "barryvdh/reflection-docblock": "^2.0.6",
-                "composer/class-map-generator": "^1.0",
-                "doctrine/dbal": "^2.6 || ^3",
-                "ext-json": "*",
-                "illuminate/console": "^8 || ^9 || ^10",
-                "illuminate/filesystem": "^8 || ^9 || ^10",
-                "illuminate/support": "^8 || ^9 || ^10",
-                "nikic/php-parser": "^4.18 || ^5",
-                "php": "^7.3 || ^8.0",
-                "phpdocumentor/type-resolver": "^1.1.0"
+                "php": "^7.1 || ^8.0"
             },
             },
             "require-dev": {
             "require-dev": {
-                "ext-pdo_sqlite": "*",
-                "friendsofphp/php-cs-fixer": "^2",
-                "illuminate/config": "^8 || ^9 || ^10",
-                "illuminate/view": "^8 || ^9 || ^10",
-                "mockery/mockery": "^1.4",
-                "orchestra/testbench": "^6 || ^7 || ^8",
-                "phpunit/phpunit": "^8.5 || ^9",
-                "spatie/phpunit-snapshot-assertions": "^3 || ^4",
-                "vimeo/psalm": "^5.4"
-            },
-            "suggest": {
-                "illuminate/events": "Required for automatic helper generation (^6|^7|^8|^9|^10)."
+                "doctrine/coding-standard": "^9 || ^11",
+                "ext-pdo": "*",
+                "ext-phar": "*",
+                "phpbench/phpbench": "^0.16 || ^1",
+                "phpstan/phpstan": "^1.4",
+                "phpstan/phpstan-phpunit": "^1",
+                "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5",
+                "vimeo/psalm": "^4.30 || ^5.4"
             },
             },
             "type": "library",
             "type": "library",
-            "extra": {
-                "laravel": {
-                    "providers": [
-                        "Barryvdh\\LaravelIdeHelper\\IdeHelperServiceProvider"
-                    ]
-                },
-                "branch-alias": {
-                    "dev-master": "2.14-dev"
-                }
-            },
             "autoload": {
             "autoload": {
                 "psr-4": {
                 "psr-4": {
-                    "Barryvdh\\LaravelIdeHelper\\": "src"
+                    "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/"
                 }
                 }
             },
             },
             "notification-url": "https://packagist.org/downloads/",
             "notification-url": "https://packagist.org/downloads/",
@@ -7332,223 +7718,13 @@
             ],
             ],
             "authors": [
             "authors": [
                 {
                 {
-                    "name": "Barry vd. Heuvel",
-                    "email": "barryvdh@gmail.com"
+                    "name": "Marco Pivetta",
+                    "email": "ocramius@gmail.com",
+                    "homepage": "https://ocramius.github.io/"
                 }
                 }
             ],
             ],
-            "description": "Laravel IDE Helper, generates correct PHPDocs for all Facade classes, to improve auto-completion.",
-            "keywords": [
-                "autocomplete",
-                "codeintel",
-                "helper",
-                "ide",
-                "laravel",
-                "netbeans",
-                "phpdoc",
-                "phpstorm",
-                "sublime"
-            ],
-            "support": {
-                "issues": "https://github.com/barryvdh/laravel-ide-helper/issues",
-                "source": "https://github.com/barryvdh/laravel-ide-helper/tree/v2.14.0"
-            },
-            "funding": [
-                {
-                    "url": "https://fruitcake.nl",
-                    "type": "custom"
-                },
-                {
-                    "url": "https://github.com/barryvdh",
-                    "type": "github"
-                }
-            ],
-            "time": "2024-02-05T08:16:36+00:00"
-        },
-        {
-            "name": "barryvdh/reflection-docblock",
-            "version": "v2.3.1",
-            "source": {
-                "type": "git",
-                "url": "https://github.com/barryvdh/ReflectionDocBlock.git",
-                "reference": "b6ff9f93603561f50e53b64310495d20b8dff5d8"
-            },
-            "dist": {
-                "type": "zip",
-                "url": "https://api.github.com/repos/barryvdh/ReflectionDocBlock/zipball/b6ff9f93603561f50e53b64310495d20b8dff5d8",
-                "reference": "b6ff9f93603561f50e53b64310495d20b8dff5d8",
-                "shasum": "",
-                "mirrors": [
-                    {
-                        "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
-                        "preferred": true
-                    }
-                ]
-            },
-            "require": {
-                "php": ">=7.1"
-            },
-            "require-dev": {
-                "phpunit/phpunit": "^8.5.14|^9"
-            },
-            "suggest": {
-                "dflydev/markdown": "~1.0",
-                "erusev/parsedown": "~1.0"
-            },
-            "type": "library",
-            "extra": {
-                "branch-alias": {
-                    "dev-master": "2.3.x-dev"
-                }
-            },
-            "autoload": {
-                "psr-0": {
-                    "Barryvdh": [
-                        "src/"
-                    ]
-                }
-            },
-            "notification-url": "https://packagist.org/downloads/",
-            "license": [
-                "MIT"
-            ],
-            "authors": [
-                {
-                    "name": "Mike van Riel",
-                    "email": "mike.vanriel@naenius.com"
-                }
-            ],
-            "support": {
-                "source": "https://github.com/barryvdh/ReflectionDocBlock/tree/v2.3.1"
-            },
-            "time": "2025-01-18T19:26:32+00:00"
-        },
-        {
-            "name": "composer/class-map-generator",
-            "version": "1.7.0",
-            "source": {
-                "type": "git",
-                "url": "https://github.com/composer/class-map-generator.git",
-                "reference": "2373419b7709815ed323ebf18c3c72d03ff4a8a6"
-            },
-            "dist": {
-                "type": "zip",
-                "url": "https://api.github.com/repos/composer/class-map-generator/zipball/2373419b7709815ed323ebf18c3c72d03ff4a8a6",
-                "reference": "2373419b7709815ed323ebf18c3c72d03ff4a8a6",
-                "shasum": "",
-                "mirrors": [
-                    {
-                        "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
-                        "preferred": true
-                    }
-                ]
-            },
-            "require": {
-                "composer/pcre": "^2.1 || ^3.1",
-                "php": "^7.2 || ^8.0",
-                "symfony/finder": "^4.4 || ^5.3 || ^6 || ^7 || ^8"
-            },
-            "require-dev": {
-                "phpstan/phpstan": "^1.12 || ^2",
-                "phpstan/phpstan-deprecation-rules": "^1 || ^2",
-                "phpstan/phpstan-phpunit": "^1 || ^2",
-                "phpstan/phpstan-strict-rules": "^1.1 || ^2",
-                "phpunit/phpunit": "^8",
-                "symfony/filesystem": "^5.4 || ^6 || ^7 || ^8"
-            },
-            "type": "library",
-            "extra": {
-                "branch-alias": {
-                    "dev-main": "1.x-dev"
-                }
-            },
-            "autoload": {
-                "psr-4": {
-                    "Composer\\ClassMapGenerator\\": "src"
-                }
-            },
-            "notification-url": "https://packagist.org/downloads/",
-            "license": [
-                "MIT"
-            ],
-            "authors": [
-                {
-                    "name": "Jordi Boggiano",
-                    "email": "j.boggiano@seld.be",
-                    "homepage": "https://seld.be"
-                }
-            ],
-            "description": "Utilities to scan PHP code and generate class maps.",
-            "keywords": [
-                "classmap"
-            ],
-            "support": {
-                "issues": "https://github.com/composer/class-map-generator/issues",
-                "source": "https://github.com/composer/class-map-generator/tree/1.7.0"
-            },
-            "funding": [
-                {
-                    "url": "https://packagist.com",
-                    "type": "custom"
-                },
-                {
-                    "url": "https://github.com/composer",
-                    "type": "github"
-                }
-            ],
-            "time": "2025-11-19T10:41:15+00:00"
-        },
-        {
-            "name": "doctrine/instantiator",
-            "version": "1.5.0",
-            "source": {
-                "type": "git",
-                "url": "https://github.com/doctrine/instantiator.git",
-                "reference": "0a0fa9780f5d4e507415a065172d26a98d02047b"
-            },
-            "dist": {
-                "type": "zip",
-                "url": "https://api.github.com/repos/doctrine/instantiator/zipball/0a0fa9780f5d4e507415a065172d26a98d02047b",
-                "reference": "0a0fa9780f5d4e507415a065172d26a98d02047b",
-                "shasum": "",
-                "mirrors": [
-                    {
-                        "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
-                        "preferred": true
-                    }
-                ]
-            },
-            "require": {
-                "php": "^7.1 || ^8.0"
-            },
-            "require-dev": {
-                "doctrine/coding-standard": "^9 || ^11",
-                "ext-pdo": "*",
-                "ext-phar": "*",
-                "phpbench/phpbench": "^0.16 || ^1",
-                "phpstan/phpstan": "^1.4",
-                "phpstan/phpstan-phpunit": "^1",
-                "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5",
-                "vimeo/psalm": "^4.30 || ^5.4"
-            },
-            "type": "library",
-            "autoload": {
-                "psr-4": {
-                    "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/"
-                }
-            },
-            "notification-url": "https://packagist.org/downloads/",
-            "license": [
-                "MIT"
-            ],
-            "authors": [
-                {
-                    "name": "Marco Pivetta",
-                    "email": "ocramius@gmail.com",
-                    "homepage": "https://ocramius.github.io/"
-                }
-            ],
-            "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors",
-            "homepage": "https://www.doctrine-project.org/projects/instantiator.html",
+            "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors",
+            "homepage": "https://www.doctrine-project.org/projects/instantiator.html",
             "keywords": [
             "keywords": [
                 "constructor",
                 "constructor",
                 "instantiate"
                 "instantiate"
@@ -8362,182 +8538,6 @@
             },
             },
             "time": "2022-02-21T01:04:05+00:00"
             "time": "2022-02-21T01:04:05+00:00"
         },
         },
-        {
-            "name": "phpdocumentor/reflection-common",
-            "version": "2.2.0",
-            "source": {
-                "type": "git",
-                "url": "https://github.com/phpDocumentor/ReflectionCommon.git",
-                "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b"
-            },
-            "dist": {
-                "type": "zip",
-                "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/1d01c49d4ed62f25aa84a747ad35d5a16924662b",
-                "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b",
-                "shasum": "",
-                "mirrors": [
-                    {
-                        "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
-                        "preferred": true
-                    }
-                ]
-            },
-            "require": {
-                "php": "^7.2 || ^8.0"
-            },
-            "type": "library",
-            "extra": {
-                "branch-alias": {
-                    "dev-2.x": "2.x-dev"
-                }
-            },
-            "autoload": {
-                "psr-4": {
-                    "phpDocumentor\\Reflection\\": "src/"
-                }
-            },
-            "notification-url": "https://packagist.org/downloads/",
-            "license": [
-                "MIT"
-            ],
-            "authors": [
-                {
-                    "name": "Jaap van Otterdijk",
-                    "email": "opensource@ijaap.nl"
-                }
-            ],
-            "description": "Common reflection classes used by phpdocumentor to reflect the code structure",
-            "homepage": "http://www.phpdoc.org",
-            "keywords": [
-                "FQSEN",
-                "phpDocumentor",
-                "phpdoc",
-                "reflection",
-                "static analysis"
-            ],
-            "support": {
-                "issues": "https://github.com/phpDocumentor/ReflectionCommon/issues",
-                "source": "https://github.com/phpDocumentor/ReflectionCommon/tree/2.x"
-            },
-            "time": "2020-06-27T09:03:43+00:00"
-        },
-        {
-            "name": "phpdocumentor/type-resolver",
-            "version": "1.12.0",
-            "source": {
-                "type": "git",
-                "url": "https://github.com/phpDocumentor/TypeResolver.git",
-                "reference": "92a98ada2b93d9b201a613cb5a33584dde25f195"
-            },
-            "dist": {
-                "type": "zip",
-                "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/92a98ada2b93d9b201a613cb5a33584dde25f195",
-                "reference": "92a98ada2b93d9b201a613cb5a33584dde25f195",
-                "shasum": "",
-                "mirrors": [
-                    {
-                        "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
-                        "preferred": true
-                    }
-                ]
-            },
-            "require": {
-                "doctrine/deprecations": "^1.0",
-                "php": "^7.3 || ^8.0",
-                "phpdocumentor/reflection-common": "^2.0",
-                "phpstan/phpdoc-parser": "^1.18|^2.0"
-            },
-            "require-dev": {
-                "ext-tokenizer": "*",
-                "phpbench/phpbench": "^1.2",
-                "phpstan/extension-installer": "^1.1",
-                "phpstan/phpstan": "^1.8",
-                "phpstan/phpstan-phpunit": "^1.1",
-                "phpunit/phpunit": "^9.5",
-                "rector/rector": "^0.13.9",
-                "vimeo/psalm": "^4.25"
-            },
-            "type": "library",
-            "extra": {
-                "branch-alias": {
-                    "dev-1.x": "1.x-dev"
-                }
-            },
-            "autoload": {
-                "psr-4": {
-                    "phpDocumentor\\Reflection\\": "src"
-                }
-            },
-            "notification-url": "https://packagist.org/downloads/",
-            "license": [
-                "MIT"
-            ],
-            "authors": [
-                {
-                    "name": "Mike van Riel",
-                    "email": "me@mikevanriel.com"
-                }
-            ],
-            "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names",
-            "support": {
-                "issues": "https://github.com/phpDocumentor/TypeResolver/issues",
-                "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.12.0"
-            },
-            "time": "2025-11-21T15:09:14+00:00"
-        },
-        {
-            "name": "phpstan/phpdoc-parser",
-            "version": "1.29.0",
-            "source": {
-                "type": "git",
-                "url": "https://github.com/phpstan/phpdoc-parser.git",
-                "reference": "536889f2b340489d328f5ffb7b02bb6b183ddedc"
-            },
-            "dist": {
-                "type": "zip",
-                "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/536889f2b340489d328f5ffb7b02bb6b183ddedc",
-                "reference": "536889f2b340489d328f5ffb7b02bb6b183ddedc",
-                "shasum": "",
-                "mirrors": [
-                    {
-                        "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
-                        "preferred": true
-                    }
-                ]
-            },
-            "require": {
-                "php": "^7.2 || ^8.0"
-            },
-            "require-dev": {
-                "doctrine/annotations": "^2.0",
-                "nikic/php-parser": "^4.15",
-                "php-parallel-lint/php-parallel-lint": "^1.2",
-                "phpstan/extension-installer": "^1.0",
-                "phpstan/phpstan": "^1.5",
-                "phpstan/phpstan-phpunit": "^1.1",
-                "phpstan/phpstan-strict-rules": "^1.0",
-                "phpunit/phpunit": "^9.5",
-                "symfony/process": "^5.2"
-            },
-            "type": "library",
-            "autoload": {
-                "psr-4": {
-                    "PHPStan\\PhpDocParser\\": [
-                        "src/"
-                    ]
-                }
-            },
-            "notification-url": "https://packagist.org/downloads/",
-            "license": [
-                "MIT"
-            ],
-            "description": "PHPDoc parser with support for nullable, intersection and generic types",
-            "support": {
-                "issues": "https://github.com/phpstan/phpdoc-parser/issues",
-                "source": "https://github.com/phpstan/phpdoc-parser/tree/1.29.0"
-            },
-            "time": "2024-05-06T12:04:23+00:00"
-        },
         {
         {
             "name": "phpunit/php-code-coverage",
             "name": "phpunit/php-code-coverage",
             "version": "9.2.32",
             "version": "9.2.32",
@@ -10159,12 +10159,12 @@
     ],
     ],
     "aliases": [],
     "aliases": [],
     "minimum-stability": "dev",
     "minimum-stability": "dev",
-    "stability-flags": [],
+    "stability-flags": {},
     "prefer-stable": true,
     "prefer-stable": true,
     "prefer-lowest": false,
     "prefer-lowest": false,
     "platform": {
     "platform": {
         "php": "^7.3"
         "php": "^7.3"
     },
     },
-    "platform-dev": [],
+    "platform-dev": {},
     "plugin-api-version": "2.6.0"
     "plugin-api-version": "2.6.0"
 }
 }

+ 1 - 1
config/app.php

@@ -67,7 +67,7 @@ return [
     |
     |
     */
     */
 
 
-    'timezone' => 'UTC',
+    'timezone' => 'Asia/shanghai',
 
 
     /*
     /*
     |--------------------------------------------------------------------------
     |--------------------------------------------------------------------------

+ 1 - 0
routes/api/order.php

@@ -7,6 +7,7 @@ use Illuminate\Support\Facades\Route;
 Route::group(['domain' => env('APP_HOST_API'), 'prefix' => 'order'],function (){
 Route::group(['domain' => env('APP_HOST_API'), 'prefix' => 'order'],function (){
     Route::match(['get','post'],'status', 'OrderController@getOrderStatus')->name('order.status');//订单状态
     Route::match(['get','post'],'status', 'OrderController@getOrderStatus')->name('order.status');//订单状态
     Route::match(['get','post'],'create', 'OrderController@createOrder')->name('order.create');//订单创建
     Route::match(['get','post'],'create', 'OrderController@createOrder')->name('order.create');//订单创建
+    Route::match(['get','post'],'create_v2', 'OrderController@createV2Order')->name('order.create_v2');//订单创建
     Route::match(['get','post'],'pay', 'OrderController@payOrder')->name('order.pay');//订单支付
     Route::match(['get','post'],'pay', 'OrderController@payOrder')->name('order.pay');//订单支付
     Route::match(['get','post'],'list', 'OrderController@getOrderList')->name('order.list');//订单列表
     Route::match(['get','post'],'list', 'OrderController@getOrderList')->name('order.list');//订单列表
     Route::match(['get','post'],'cancel', 'OrderController@cancelOrder')->name('order.cancel');//取消订单
     Route::match(['get','post'],'cancel', 'OrderController@cancelOrder')->name('order.cancel');//取消订单

+ 10 - 0
routes/api/shop.php

@@ -0,0 +1,10 @@
+<?php
+
+use Illuminate\Support\Facades\Route;
+
+
+
+Route::group(['domain' => env('APP_HOST_API'), 'prefix' => 'shop'],function (){
+    Route::match(['get','post'],'info', 'ShopController@getShopInfo')->name('shop.info');//订单详情
+
+});

+ 2 - 2
任务.txt

@@ -1,6 +1,6 @@
 //队列 (编号监测)
 //队列 (编号监测)
-nohup php artisan queue:work redis --queue=register,register_shop,seckill_num,seckill_member_num,seckill_record,member_share,shop_share,goods_share,admin_share,shop_order,template,uploading,verify_img,barrage,purchases,im_group,order_sub,indent_num,del_img,auto_withdraw,couponRange,grantRange,shop_inform,newcomer,loot,farm,verifyFans  --sleep=3 --tries=3 --timeout=120 &
- php artisan queue:work redis --queue=shop_share  --sleep=3 --tries=3 --timeout=120
+nohup php artisan queue:work redis --queue=printOrder  --sleep=3 --tries=3 --timeout=120 &
+ php artisan queue:work redis --queue=printOrder  --sleep=3 --tries=3 --timeout=120
 nohup php artisan order:affirm &
 nohup php artisan order:affirm &
 nohup php artisan order:finish &
 nohup php artisan order:finish &
 nohup php artisan order:repeal &
 nohup php artisan order:repeal &