Jelajahi Sumber

Merge branch 'master' into zhongqi-itemUpdate

shish 4 bulan lalu
induk
melakukan
6a51f52c45

+ 1 - 1
.gitignore

@@ -17,4 +17,4 @@ app-hd/web/assets/
 app-pt/web/assets/
 app-ghs/web/assets/
 app-mall/web/assets/
-.aider*
+.aider*

+ 1 - 1
app-ghs/controllers/ConsoleController.php

@@ -223,7 +223,7 @@ class ConsoleController extends BaseController
                 ["name" => "商城", "img" => "ghs/home/shop3.png", "url" => "/admin/home/mall"],
                 ["name" => "改价", "img" => "ghs/home/gj.png", "url" => "/admin/changePrice/list2"],
                 ["name" => "花材", "img" => "ghs/home/hcgl.png", "url" => "/admin/item/list2"],
-                ["name" => "今日访客", "img" => "ghs/home/yggl.png", "url" => "/admin/custom/visit"],
+                ["name" => "配送片区", "img" => "ghs/home/kcyjs.png", "url" => "/admin/order/orderListByDist"],
                 //["name" => "预订客户", "img" => "ghs/home/yggl.png", "url" => "/admin/book/custom"],
                 ["name" => "改库存", "img" => "ghs/home/kcyjs.png", "url" => "/admin/changePrice/changeStock2"],
                 ["name" => "采购", "img" => "ghs/home/icon_ghs.png", "url" => "/pagesPurchase/supplier"],

+ 1 - 1
app-ghs/controllers/CustomController.php

@@ -702,7 +702,7 @@ class CustomController extends BaseController
     {
         //限制请求次数
         $shopId = $this->shopId;
-        util::perDayCommitTimeLimit($shopId, 3);
+        //util::perDayCommitTimeLimit($shopId, 3);
 
         //限制频繁请求
         util::checkRepeatCommit($this->adminId, 6);

+ 39 - 0
app-ghs/controllers/OrderController.php

@@ -947,6 +947,28 @@ class OrderController extends BaseController
         util::success($respond);
     }
 
+    //按片区排列的订单列表
+    public function actionListByDist()
+    {
+        $get = Yii::$app->request->get();
+        $where = [];
+        $where['o.mainId'] = $this->mainId;
+        $searchTime = $get['searchTime'] ?? '';
+        if (!empty($searchTime)) {
+            $startTime = $get['startTime'] ?? '';
+            $endTime = $get['endTime'] ?? '';
+            // 时间跨度不能超过7天
+            if (strtotime($endTime) - strtotime($startTime) > 7 * 24 * 3600) {
+                util::fail('最多查询7天的订单');
+            }
+            $period = dateUtil::formatTime($searchTime, $startTime, $endTime);
+            $where['payTime'] = ['between', [$period['startTime'], $period['endTime']]];
+        }
+        $respond = OrderClass::getDistOrderList($where);
+
+        util::success($respond);
+    }
+
     // 新订单列表详情 -- 可能与 actionList 很相似,但为不影响 actionList,重新创建个方法 shizhongqi 2022.06.23
     public function actionNewOrderList()
     {
@@ -1110,6 +1132,23 @@ class OrderController extends BaseController
         $post['getStaffId'] = $shopAdminId;
         $post['getStaffName'] = $shopAdminName;
 
+        if (getenv('YII_ENV') == 'production') {
+            //南粤选了别的开单人,也只能变成本人开单
+            if ($this->mainId == 22388) {
+                $post['shopAdminName'] = $shopAdmin->name;
+                $post['shopAdminId'] = $shopAdmin->id;
+                $post['getStaffId'] = $shopAdmin->id;
+                $post['getStaffName'] = $shopAdmin->name;
+            }
+        } else {
+            if ($this->mainId == 644) {
+                $post['shopAdminName'] = $shopAdmin->name;
+                $post['shopAdminId'] = $shopAdmin->id;
+                $post['getStaffId'] = $shopAdmin->id;
+                $post['getStaffName'] = $shopAdmin->name;
+            }
+        }
+
         $post['sjId'] = $this->sjId;
         $post['shopId'] = $shopId;
         $post['mainId'] = $this->mainId;

+ 3 - 1
app-ghs/controllers/ProductController.php

@@ -223,6 +223,8 @@ class ProductController extends BaseController
         $hyPrice = floatval($hyPrice);
 
         $name = $info->name ?? '';
+        $name = preg_replace('/\s{2,}/', ' ', $name ?? '');
+        
         $ptItemId = $info->itemId ?? 0;
         $mainId = $info->mainId ?? 0;
         $ext = $this->shopExt;
@@ -251,7 +253,7 @@ class ProductController extends BaseController
             }
         } else {
             if (stringUtil::getWordNum($name) > 8) {
-                $content = '<TEXT x="30" y="30" font="12" w="1" h="1" r="0">' . $name . '</TEXT>';
+                $content = '<TEXT x="30" y="30" font="12" w="1" h="2" r="0">' . $name . '</TEXT>';
             } else {
                 $content = '<TEXT x="30" y="30" font="12" w="2" h="2" r="0">' . $name . '</TEXT>';
             }

+ 10 - 5
app-ghs/controllers/TestController.php

@@ -467,7 +467,12 @@ class TestController extends BaseController
             //['name' => '昆明木鱼花草堂', 'merchantNo' => '8227310599200ZU', 'wx' => [874780341, 874779360], 'zfb' => '2088480009915486'],
             //['name' => '永城花鲜谷鲜花批发', 'merchantNo' => '82250605992008V', 'wx' => [874955479, 874955569], 'zfb' => '2088480025639193'],
             //['name' => '任丘蓝色雨鲜花批发', 'merchantNo' => '82214305992007M', 'wx' => [875610544, 875611929], 'zfb' => '2088480065124374'],
-            ['name' => '云南熙朵花卉', 'merchantNo' => '82273105992010C', 'wx' => [876755672, 876755475], 'zfb' => '2088480109605151'],
+            //['name' => '云南熙朵花卉', 'merchantNo' => '82273105992010C', 'wx' => [876755672, 876755475], 'zfb' => '2088480109605151'],
+            //['name' => '宿州温馨鲜花批发', 'merchantNo' => '82237405992003T', 'wx' => [880834087, 880834521], 'zfb' => '2088480300332087'],
+            //['name' => '济南万花田', 'merchantNo' => '8224510599200NN', 'wx' => [881205017, 881205264], 'zfb' => '2088480339301423'],
+            //['name' => '济南万花田鲜花', 'merchantNo' => '8224510599200NP', 'wx' => [881375592, 881375991], 'zfb' => '2088480345092520'],
+            //['name' => '温州易批花', 'merchantNo' => '8223330599200E0', 'wx' => [882196314, 882196905], 'zfb' => '2088480379232415'],
+            //['name' => '莆田我要花辉皇店', 'merchantNo' => '82239405992007T', 'wx' => [884613202, 884611698], 'zfb' => '2088480542516472'],
             //['name' => '藏花林', 'merchantNo' => '8227310599200ZC', 'wx' => [868558224, 868558410], 'zfb' => '2088380587657250'],
             //['name' => '昆明藏花林花卉', 'merchantNo' => '8227310599200ZN', 'wx' => [869670880, 869668881], 'zfb' => '2088380691198135'],
             //['name' => '昆明藏花林鲜花', 'merchantNo' => '8227310599200ZJ', 'wx' => [869361939, 869362520], 'zfb' => '2088380669365761'],
@@ -475,7 +480,7 @@ class TestController extends BaseController
             //['name' => '昆明藏花林', 'merchantNo' => '8227310599200ZC', 'wx' => [868558224, 868558410], 'zfb' => '2088380587657250'],
             //['name' => '三明易批花', 'merchantNo' => '82239505992001X', 'wx' => [868630425, 868628086], 'zfb' => '2088380594855142'],
             //['name' => '厦门都市鲜花批发', 'merchantNo' => '8223930599200HZ', 'wx' => [854245016, 854244735], 'zfb' => '2088280333454097'],
-            //['name' => '深圳鼎盛皇室花卉', 'merchantNo' => '8225840599201MF', 'wx' => [807078304, 807076486], 'zfb' => '2088970117746334'],
+            ['name' => '深圳鼎盛皇室花卉', 'merchantNo' => '8225840599201MF', 'wx' => [807078304, 807076486], 'zfb' => '2088970117746334'],
             //['name' => '东莞惠雅鲜花(莞城店)', 'merchantNo' => '8226020599200GJ', 'wx' => [796953190, 796976959], 'zfb' => '2088770940104912'],
             //['name' => '东莞惠雅鲜花(南城店)', 'merchantNo' => '8226020599200JK', 'wx' => [802315656, 802315755], 'zfb' => '2088870583889365'],
             //['name' => '沈阳市云花鲜花批发-专业化扫码', 'merchantNo' => '8222210599200BT', 'wx' => [796180053], 'zfb' => '2088770820458908'],
@@ -988,7 +993,7 @@ class TestController extends BaseController
     //交易查询 ssh 20231021
     public function actionTradeQuery()
     {
-        $shopId = 7855;
+        $shopId = 15289;
         $shop = ShopClass::getById($shopId, true);
         if (empty($shop)) {
             util::stop('没有找到门店,编号677230');
@@ -1004,13 +1009,13 @@ class TestController extends BaseController
             'lklCertificatePath' => $lklCertificatePath,
         ];
         $laResource = new Lakala($params);
-        $orderSn = 'CG30574681';
+        $orderSn = 'CG30760064';
         $tradeNo = '66223936904050';
         $queryParams = [
             'orderSn' => $orderSn,
             'tradeNo' => $tradeNo,
         ];
-        $response = $laResource->query($queryParams, 1);
+        $response = $laResource->query($queryParams, 0);
         echo "<pre>";
         print_r($response);
         util::stop();

+ 5 - 0
app-hd/controllers/OrderController.php

@@ -754,6 +754,7 @@ class OrderController extends BaseController
                 $priceMap = \bizGhs\custom\classes\CustomClass::$levelPriceKeyMap;
                 $addPriceMap = \bizGhs\custom\classes\CustomClass::$levelAddPriceKeyMap;
                 $level = 0;
+                $totalNum = 0;
                 foreach ($productList as $currentProduct) {
                     $property = $currentProduct['property'] ?? 0;
                     $currentPrice = $currentProduct['unitPrice'] ?? 0;
@@ -789,6 +790,9 @@ class OrderController extends BaseController
                             }
                         }
                     }
+
+                    $num = $currentProduct['num'];
+                    $totalNum = bcadd($totalNum, $num);
                 }
 
                 if (!empty($diff)) {
@@ -828,6 +832,7 @@ class OrderController extends BaseController
                 }
             }
 
+            $post['bigNum'] = $totalNum;
             //多处调用这个方法,注意同步修改,搜索关键词 createHdNewOrder
             $return = OrderService::createHdOrder($post, $custom, $hasPay);
 

+ 39 - 1
app-hd/controllers/PurchaseController.php

@@ -657,7 +657,7 @@ class PurchaseController extends BaseController
 
                     //广州鑫源花卉,选择送货上门必须选必选商品
                     if ($ghsShopId == 12439) {
-                        $hasMust = array_intersect($ids, [3446945, 3446970, 3446973, 3446979, 3446995, 3447010, 3447023, 3459983]);
+                        $hasMust = array_intersect($ids, [3446945, 3446970, 3446973, 3446979, 3446995, 3447010, 3447023, 3459983, 4333184, 4317745, 1585738]);
                         if (empty($hasMust)) {
                             util::fail('请返回选择 必选商品');
                         }
@@ -732,6 +732,44 @@ class PurchaseController extends BaseController
                 }
 
             }
+
+            if ($sendType == 2) {
+                //温州易批花,跑腿,不满100,要选10元的补运费商品
+                if ($ghsShopId == 91115) {
+                    if ($respond->actPrice < 100) {
+                        $transaction->rollBack();
+                        $hasMust = array_intersect($ids, [4449812, 4449811]);
+                        if (empty($hasMust)) {
+                            util::fail('不满100,必选商品 补运费10元');
+                        }
+                    }
+                }
+            }
+            if ($sendType == 4) {
+                //温州易批花,快递,不满100,要选10元的补运费商品
+                if ($ghsShopId == 91115) {
+                    if ($respond->actPrice < 100) {
+                        $transaction->rollBack();
+                        $hasMust = array_intersect($ids, [4449812, 4449811]);
+                        if (empty($hasMust)) {
+                            util::fail('不满100,必选商品 补运费10元');
+                        }
+                    }
+                }
+            }
+            if ($sendType == 3) {
+                //温州易批花,物流,不满200,要选10元的补运费商品
+                if ($ghsShopId == 91115) {
+                    if ($respond->actPrice < 200) {
+                        $transaction->rollBack();
+                        $hasMust = array_intersect($ids, [4449812, 4449811]);
+                        if (empty($hasMust)) {
+                            util::fail('不满200,必选商品 补运费10元');
+                        }
+                    }
+                }
+            }
+
             $transaction->commit();
             $transactionFinished = true;
             ProductClass::clearLimitBuyRollbackSnapshot();

+ 5 - 9
app-hd/controllers/ShopController.php

@@ -149,10 +149,13 @@ class ShopController extends BaseController
         $data['sjId'] = $this->sjId;
         $id = isset($data['id']) ? $data['id'] : 0;
         unset($data['id']);
+        $data['meetNum'] = isset($data['meetNum']) ? intval($data['meetNum']) : 0;
+        $data['meetAmount'] = isset($data['meetAmount']) ? floatval($data['meetAmount']) : 0;
+        $data['cutAmount'] = isset($data['cutAmount']) ? floatval($data['cutAmount']) : 0;
+
         $shop = ShopService::getById($id);
-        ShopService::valid($shop, $this->sjId);
+        ShopClass::valid($shop, $this->sjId);
         $data['img'] = isset($data['img']) && is_array($data['img']) ? json_encode($data['img']) : '';
-        $mobile = $data['mobile'];
         //手机号具有唯一性,暂时不允许修改 --- 同批发端 app-ghs/controllers/ShopController.php 保持一致
         unset($data['mobile']);
 
@@ -161,13 +164,6 @@ class ShopController extends BaseController
         $transaction = $connection->beginTransaction();
         try {
             ShopClass::updateShop($shop, $data);
-
-            // 找出附近批发店,之后自动给建立关系,然后补充二个店之间的距离(计算距离使用高德接口)
-            // if(isset($data['openLocation']) && $data['openLocation'] == 1){
-            //     $toLat = $data['lat'] ?? null;
-            //     $toLnt = $data['long'] ?? null;
-            //     \biz\ghs\classes\GhsClass::buildNearbyGhsRelations($id, $this->shop->pfShopId, $toLat, $toLnt);
-            // }
             $transaction->commit();
             util::complete();
         } catch (\Exception $exception) {

+ 1 - 0
app-mall/controllers/OrderController.php

@@ -466,6 +466,7 @@ class OrderController extends BaseController
                 }
             }
 
+            $post['bigNum'] = $totalNum;
             $post['modifyPrice'] = $modifyPrice;
             //多处调用这个方法,注意同步修改,搜索关键词 createHdNewOrder
             $return = \bizHd\order\services\OrderService::createHdOrder($post, $custom, $hasPay);

+ 1 - 2
app-pt/views/main/app.php

@@ -227,7 +227,6 @@
                 tip.remove();
             }
         }
-        
         function downloadApp(appType) {
             // 检测是否在微信浏览器中
             if (isWeChatBrowser()) {
@@ -237,7 +236,7 @@
             // 这里可以根据appType跳转到对应的下载链接
             const downloadUrls = {
                 'xiaohuabao': 'https://api.shop.hzghd.com/1279.apk', // 销花宝APP下载链接
-                'huazhanggui': 'https://api.shop.hzghd.com/229.apk', // 花掌柜APP下载链接
+                'huazhanggui': 'https://api.shop.hzghd.com/234.apk', // 花掌柜APP下载链接
                 'huazhanggui_cashier': 'https://api.shop.hzghd.com/199.apk', // 花掌柜收银下载链接
                 'xiaohuabao_cashier': 'https://api.shop.hzghd.com/157.apk' // 销花宝收银下载链接
             };

+ 0 - 1
biz-ghs/custom/classes/DistClass.php

@@ -4,7 +4,6 @@ namespace bizGhs\custom\classes;
 
 use bizGhs\shop\classes\ShopClass;
 use bizHd\base\classes\BaseClass;
-use Yii;
 
 class DistClass extends BaseClass
 {

+ 58 - 17
biz-ghs/order/classes/OrderClass.php

@@ -2,6 +2,7 @@
 
 namespace bizGhs\order\classes;
 
+use bizGhs\custom\classes\DistClass;
 use bizGhs\item\classes\ItemClassClass;
 use bizHd\purchase\classes\PurchaseItemClass;
 use common\components\arrayUtil;
@@ -21,9 +22,11 @@ use biz\stat\classes\StatRefundClass;
 use biz\stat\classes\StatSaleClass;
 use bizGhs\express\services\DadaExpressServices;
 use bizGhs\order\traits\OrderTrait;
+use bizGhs\order\models\Order;
 use bizGhs\product\classes\ProductClass;
 use bizGhs\admin\classes\AdminClass;
 use bizGhs\custom\classes\CustomClass;
+use bizGhs\custom\models\Custom;
 use bizGhs\shop\classes\MainClass;
 use bizGhs\stock\classes\StockRecordClass;
 use bizHd\purchase\classes\PurchaseClass;
@@ -450,7 +453,7 @@ class OrderClass extends BaseClass
         $customId = $order->customId ?? 0;
         $custom = CustomClass::getById($customId, true);
         if (empty($custom)) {
-            util::fail('没有找到客户信息,编号:'.$customId);
+            util::fail('没有找到客户信息,编号:' . $customId);
         }
         $shopId = $custom->shopId ?? 0;
         $customShop = ShopClass::getById($shopId, true);
@@ -1398,6 +1401,49 @@ class OrderClass extends BaseClass
         return $data;
     }
 
+    //按片区排列的订单列表
+    public static function getDistOrderList($where)
+    {
+        /** @var Order $model */
+        $model = self::getActiveRecord();
+
+        $query = $model->conditionQuery($where)
+            ->alias('o')
+            ->leftJoin(['c' => Custom::tableName()], 'c.id = o.customId')
+            ->select(['o.id', 'o.mainId', 'o.customId', 'o.customName', 'o.customAvatar', 'o.fullAddress', 'o.remark', 'c.name', 'c.mobile', 'c.distId', 'distId' => 'c.distId']);
+
+        // $clone = clone $query;
+        // $count = intval($clone->count('o.id'));
+
+        $orderList = $query
+            ->orderBy(['c.distId' => SORT_ASC, 'o.addTime' => SORT_DESC]) // ->offset($offset)->limit($pageSize)
+            ->asArray()
+            ->all();
+
+        $distIds = array_unique(array_filter(array_column($orderList, 'distId')));
+        $distMap = [];
+        if (!empty($distIds)) {
+            $distMap = DistClass::getByIds($distIds, null, 'id');
+        }
+
+        $grouped = [];
+        foreach ($orderList as $orderInfo) {
+            $distId = intval($orderInfo['distId']);
+            if (!isset($grouped[$distId]) && isset($distMap[$distId])) {
+                $grouped[$distId] = [
+                    'distId' => $distId,
+                    'distName' => $distMap[$distId]['name'],
+                    'list' => [],
+                ];
+            }
+            $grouped[$distId]['list'][$orderInfo['customId']][] = $orderInfo;
+        }
+
+        return [
+            'list' => array_values($grouped),
+        ];
+    }
+
     //整合订单员工和供货商等信息 ssh 2021.1.19
     //$isList 是否列表页
     public static function groupOrder($list, $showButton = false, $showItem = false, $showExpress = false, $isList = false)
@@ -1514,7 +1560,7 @@ class OrderClass extends BaseClass
             } else {
                 $content .= $productNum . ' = ' . $productPrice . '元  ' . ($ratioType == 0 ? $ratio . '支装' : ($ratioType == 1 ? '若干支装' : '')) . '<BR>';
             }
-        }else{
+        } else {
             $content .= ' ' . ($ratioType == 0 ? $ratio . '支装' : ($ratioType == 1 ? '若干支装' : '')) . '<BR>';
         }
         $content .= '--------------------------------<BR>';
@@ -1899,7 +1945,7 @@ class OrderClass extends BaseClass
         /**************************如果是好多花的云仓还要再打一下标签纸,多处要同步修改,关键词 hdh_yc *****************************/
         $orderMainId = $orderInfo['mainId'] ?? 0;
         if (getenv('YII_ENV') == 'production') {
-            $map = [65726, 58, 25119];
+            $map = [65726, 58, 25119, 28500, 1294,12925];
         } else {
             $map = [828];
         }
@@ -2958,7 +3004,7 @@ XL;
         /**************************如果是好多花的云仓还要再打一下标签纸,多处要同步修改,关键词 hdh_yc *****************************/
         $orderMainId = $order->mainId;
         if (getenv('YII_ENV') == 'production') {
-            $map = [65726, 58, 25119];
+            $map = [65726, 58, 25119, 28500, 1294,12925];
         } else {
             $map = [828];
         }
@@ -2972,8 +3018,7 @@ XL;
                 return false;
             }
         }
-        $shortName = $custom->shortName ?? '';
-
+        $shortName = $custom->shortName ?? '未命名';
         $shortName = stringUtil::subStringUtf8($shortName, 5);
         $customMobile = $order->customMobile ?? '';
         if (empty($customMobile)) {
@@ -2992,6 +3037,9 @@ XL;
         if (empty($wlName)) {
             $wlName = $shortRemark;
         }
+        $distId = $custom->distId ?? '';
+        $dist = DistClass::getById($distId, true);
+        $distName = $dist->name ?? '未分区';
 
         $address = $order->address ?? '';
         $floor = $order->floor ?? '';
@@ -3013,9 +3061,6 @@ XL;
         $p = new printUtil($wlLabelSn);
 
         if (!in_array($orderMainId, $map)) {
-            if (empty($shortName)) {
-                util::fail('客户短名没有设置');
-            }
             $p->times = 1;
             //安庆三叶鲜花批发,比较特殊
             if ($orderMainId == 2071) {
@@ -3052,14 +3097,10 @@ XL;
             $itemNum = floatval($itemNum);
             $payTime = $order->payTime ?? '';
             $payDate = date('m-d H:i', strtotime($payTime));
-            $content = '<TEXT x="400" y="30" font="12" w="4" h="4" r="90">' . $shortName . '</TEXT>';
-            $content .= '<TEXT x="290" y="30" font="12" w="2" h="3" r="90">' . $customName . '</TEXT>';
-            $content .= '<TEXT x="195" y="30" font="12" w="1" h="2" r="90">' . $fullAddress . '</TEXT>';
-            $content .= '<TEXT x="128" y="30" font="12" w="2" h="2" r="90">' . $customMobile . ' ' . $itemNum . '扎</TEXT>';
-            //福州易批花,不仅要自动打印,还要打印出物流名称
-            if ($orderMainId == 25119) {
-                $content .= '<TEXT x="70" y="30" font="12" w="2" h="2" r="90">物流 ' . $wlName .' '.$payDate. '</TEXT>';
-            }
+            $content = '<TEXT x="400" y="30" font="12" w="3" h="3" r="90">' . $customName . '</TEXT>';
+            $content .= '<TEXT x="280" y="30" font="12" w="2" h="2" r="90">' . $fullAddress . '</TEXT>';
+            $content .= '<TEXT x="180" y="30" font="12" w="2" h="2" r="90">' . $customMobile . '  ' . $itemNum . '扎</TEXT>';
+            $content .= '<TEXT x="86" y="30" font="12" w="2" h="2" r="90">' . $distName . ' ' . $payDate . '</TEXT>';
             /**************************如果是好多花的云仓还要再打一下标签纸,多处要同步修改,关键词 hdh_yc *****************************/
         }
         $p->printLabelMsg($content);

+ 37 - 1
biz-hd/order/classes/OrderClass.php

@@ -273,6 +273,35 @@ class OrderClass extends BaseClass
         }
         $data['reachTime'] = strtotime($data['reachDate'] . ' ' . $data['reachPeriod']);
 
+        $book = $data['book'] ?? 0;
+        if ($book == 0) {
+            $actPrice = $data['actPrice'];
+            $meetNum = $shop->meetNum ?? 0;
+            $meetAmount = $shop->meetAmount ?? 0;
+            $cutOption = $shop->cutAmount ?? 0;
+            $cutStyle = $shop->cutStyle ?? 0;
+
+            if ($cutStyle == 0) {
+                $cutAmount = $cutOption;
+            } else {
+                $miniOption = bcsub(1, $cutOption, 2);
+                $cutAmount = bcmul($actPrice, $miniOption, 2);
+            }
+            if ($cutAmount > 0 && $meetNum >= 0 && $meetAmount > 0) {
+                if (isset($data['bigNum']) && $data['bigNum'] >= $meetNum && $data['actPrice'] >= $meetAmount) {
+                    if ($cutAmount < $actPrice) {
+                        $actPrice = bcsub($actPrice, $cutAmount, 2);
+                        $data['orderReachDiscountPrice'] = $cutAmount;
+                        $data['actPrice'] = $actPrice;
+                        $data['realPrice'] = $actPrice;
+                        $data['mainPay'] = $actPrice;
+                    } else {
+                        noticeUtil::push('订单金额不足满减金额,customId:' . $data['customId'], '15280215347');
+                    }
+                }
+            }
+        }
+
         //将花店每月的总订单数作为编号
         $riseNum = StatOrderCountClass::addOrder($shop, $main);
         $data['sendNum'] = date("j") . $riseNum;
@@ -921,6 +950,8 @@ class OrderClass extends BaseClass
             $content .= '--------------------------------<BR>';
             $content .= date("Y-m-d", strtotime($order->addTime)) . '<BR>';
         } else {
+            $content .= '<CB>' . $currentName . '</CB><BR>';
+            $content .= '<CB>销售单</CB><BR><BR>';
             $content .= '<CB>' . $fromTypeName . ' ' . $respond['sendNum'] . '</CB><BR>';
             $content .= '--------------------------------<BR>';
         }
@@ -1054,11 +1085,16 @@ class OrderClass extends BaseClass
         }
 
         $content .= '--------------------------------<BR>';
+        $balance = $custom['balance'] ?? 0;
+        $balance = floatval($balance);
+        if ($balance > 0) {
+            $content .= '当前账户余额:' . $balance . '元<BR>';
+        }
         $content .= '订单日期:' . $order->addTime . '<BR>';
         $content .= '订单编号:' . $respond['orderSn'] . '<BR>';
         $content .= '门店名称:' . $currentName . '<BR>';
         $content .= "<BR>";
-
+        //noticeUtil::push($content, '15280215347');
         $p = new printUtil($printSn);
 
         $orderSn = $order->orderSn ?? '';

+ 5 - 0
biz-hd/order/services/OrderService.php

@@ -114,6 +114,11 @@ class OrderService extends BaseService
             $currentId = $val['productId'] ?? 0;
             $num = $val['num'] ?? 0;
 
+			//修改订单会出现数量为0的情况
+            if ($num <= 0) {
+                continue;
+            }
+
             $currentPrice = bcmul($unitPrice, $num, 2);
             $goodsPrice = bcadd($goodsPrice, $currentPrice, 2);
 

+ 1 - 1
biz/ghs/classes/GhsClass.php

@@ -348,7 +348,7 @@ class GhsClass extends BaseClass
         }
 
         //要排除的批发店
-        $exclude = [64112, 62304, 42385, 56611, 38143, 15373, 42946, 15375, 15734, 15736, 15738, 15740, 24132, 29044, 29161, 30902, 44724, 48608, 48642, 82971, 38231, 1105, 3, 154, 208, 23580, 24713, 8249, 16070, 83690, 86726, 1596, 2167];
+        $exclude = [64112, 62304, 42385, 56611, 38143, 15373, 42946, 15375, 15734, 15736, 15738, 15740, 24132, 29044, 29161, 30902, 44724, 48608, 48642, 82971, 38231, 1105, 3, 154, 208, 23580, 24713, 8249, 16070, 83690, 86726, 1596, 2167, 15007, 88085, 91064, 413, 62421];
         foreach ($nearbyShops as $key => $nearbyShop) {
             if (in_array($nearbyShop['id'], $exclude)) {
                 unset($nearbyShops[$key]);