Selaa lähdekoodia

Merge branch 'master' of git.huaml.com:zhh/huahuibao

shizhongqi 7 kuukautta sitten
vanhempi
commit
06f5faaec9

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

@@ -165,7 +165,7 @@ class ConsoleController extends BaseController
             }
         }
 
-        //$notice[] = ['title' => '急事请连打二次客服电话 15280215347', 'action' => '', 'page' => ''];
+        //$notice[] = ['title' => '早上有急事请连打二次小石电话', 'action' => '', 'page' => ''];
         //$notice[] = ['title' => '新功能:客户端和后台使用跑腿的流程', 'action' => '', 'page' => '/admin/book/detail?id=use_pt'];
         //$notice[] = ['title' => '快速设置:客户下单自动计算跑腿费', 'action' => '查看', 'page' => '/admin/book/detail?id=auto_calc_pt_fee'];
         //$notice[] = ['title' => '订单上如何一键呼叫跑腿', 'action' => '查看', 'page' => '/admin/book/detail?id=one_call_pt'];

+ 8 - 7
app-ghs/controllers/ItemClassController.php

@@ -21,6 +21,7 @@ class ItemClassController extends BaseController
         $mainId = $this->mainId;
         $itemList = ProductClass::getAllByCondition(['mainId' => $mainId, 'delStatus' => 0, 'status' => 1], null, 'id,name,reachNum,reachNumDiscount,presell,discountPrice', null, true);
         $arr = [];
+        //有多处需要同步修改,show_my_item_class_list ssh 20260107
         if (!empty($itemList)) {
             foreach ($itemList as $item) {
                 $reachNum = $item->reachNum ?? 0;
@@ -70,6 +71,13 @@ class ItemClassController extends BaseController
         util::success(['class' => $classInfo, 'classIndex' => $index, 'defaultClassId' => $defaultClassId]);
     }
 
+    //花材列表页的分类,这里收银机上分类使用的,show_my_item_class_list ssh 20260107
+    public function actionShowClass()
+    {
+        $list = ItemClassClass::getShopClass($this->mainId);
+        util::success($list);
+    }
+
     //采购选分类有变化通知
     public function actionGetClassRemind()
     {
@@ -94,13 +102,6 @@ class ItemClassController extends BaseController
         util::success($list);
     }
 
-    //花材列表页的分类,包含今日特价分类 ssh 20220315
-    public function actionShowClass()
-    {
-        $list = ItemClassClass::getShopClass($this->mainId);
-        util::success($list);
-    }
-
     public function actionGetAllClass()
     {
         //中央ID

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

@@ -1005,9 +1005,7 @@ class OrderController extends BaseController
     //商城下单操作 ssh 2021.1.14
     public function actionCreateOrder()
     {
-        $form = new CreateOrderForm();
-        $form->loadAndValidate();
-        $post = $form->getAttributes();
+        $post = Yii::$app->request->post();
 
         $shopId = $this->shopId;
         $customId = $post['customId'];

+ 43 - 127
app-hd/controllers/ConsoleController.php

@@ -11,6 +11,7 @@ use bizGhs\item\classes\ItemClass;
 use common\components\dateUtil;
 use common\components\dict;
 use common\components\util;
+use bizHd\stat\classes\StatOrderClass;
 
 class ConsoleController extends BaseController
 {
@@ -51,135 +52,48 @@ class ConsoleController extends BaseController
 		util::success(['overview' => $overview]);
     }
 
-    //概况
+    //概况 ssh 2019.12.19
     public function actionProfile()
     {
-        //查看财务的权限
-        $lookMoney = \bizGhs\shop\classes\ShopAdminClass::lookMoneyPower($this->shopAdmin, $this->shop);
-
-        $lsIncome = 0;
-        $orderCount = 0;
-        $yesterdayIncome = 0;
-
-        if ($lookMoney == 1) {
-            $mainId = $this->mainId;
-            $todayStr = date('Y-m-d');
-
-            // 今天零售订单总数与收入
-            $cacheKey = 'hd_console_profile:' . 'today_'.$todayStr.'_income_' . $this->shopId;
-            $cache = \Yii::$app->redis->executeCommand('GET', [$cacheKey]);
-            if ($cache) {
-                $cacheData = json_decode($cache, true);
-                $lsIncome = $cacheData['lsIncome'];
-                $orderCount = $cacheData['orderCount'];
-            } else {
-                $period = dateUtil::formatTime('today', '', '', true);
-                $start = $period['startTime'];
-                $end = $period['endTime'];
-                $currentStartDate = date('Y-m-d', strtotime($start));
-                $currentEndDate = date('Y-m-d', strtotime($end));
-                $currentStartTime = $currentStartDate . ' 00:00:00';
-                $currentEndTime = $currentEndDate . ' 23:59:59';
-
-                $where['time'] = ['between', [$start, $end]];
-                $where = ['mainId' => $mainId, 'status' => ['in', [OrderClass::ORDER_STATUS_UN_SEND, OrderClass::ORDER_STATUS_SENDING, OrderClass::ORDER_STATUS_COMPLETE]]];
-                $where['payTime'] = ['between', [$currentStartTime, $currentEndTime]];
-                $orderCount = OrderClass::getCount($where);
-
-                // $lsIncome = 0;
-                // $hdOrderList = OrderClass::getAllByCondition($where, null, 'mainPay, forward, cash');
-                // foreach ($hdOrderList as $hdKey => $hdOrder) {
-                //     $actPrice = $hdOrder['mainPay'] ?? 0;
-                //     $forward = $hdOrder['forward'] ?? 0;
-
-                //     if ($forward == 1) { //零售售后付款
-                //         // $lsAfterSale = bcadd($lsAfterSale, $actPrice, 2);
-                //     } else {
-                //         $cash = $hdOrder['cash'] ?? 0;
-                //         $lsIncome = bcadd($actPrice, $lsIncome, 2);
-                //         $lsIncome = bcadd($lsIncome, $cash, 2);
-                //     }
-                // }
-                $mainId = $this->mainId;
-                $respond = StatSaleClass::profile($mainId);
-                $incomeList = $respond['income'] ?? [];
-                $todaySale = 0;
-                if (!empty($incomeList)) {
-                    //这里有二个地方同时要修改,请搜索关键词:index_show_income
-                    foreach ($incomeList as $item) {
-                        if (isset($item['id']) && $item['id'] == 'allot') {
-                            continue;
-                        }
-                        $todaySale = bcadd($todaySale, $item['amount'], 2);
-                    }
+        //$get = Yii::$app->request->get();
+        $notice = [];
+        $mainId = $this->mainId;
+        $respond = \bizGhs\stat\classes\StatSaleClass::profile($mainId);
+        $incomeList = $respond['income'] ?? [];
+        $todaySale = 0;
+		$yesterdayIncome = 0;
+        if (!empty($incomeList)) {
+            //这里有二个地方同时要修改,请搜索关键词:index_show_income
+            foreach ($incomeList as $item) {
+                if (isset($item['id']) && $item['id'] == 'allot') {
+                    continue;
                 }
-                $cacheData = [
-                    'lsIncome' => $todaySale,
-                    'orderCount' => $orderCount,
-                ];
-                \Yii::$app->redis->executeCommand('SETEX', [$cacheKey, 1800, json_encode($cacheData, JSON_UNESCAPED_UNICODE)]);
+                $todaySale = bcadd($todaySale, $item['amount'], 2);
             }
+        }
 
-            // 昨天零售收入
-            $cacheKey = 'hd_console_profile:' . 'yesterday_'.$todayStr.'_income_' . $this->shopId;
-            $cache = \Yii::$app->redis->executeCommand('GET', [$cacheKey]);
-            if ($cache) {
-                $cacheData = json_decode($cache, true);
-                $yesterdayIncome = $cacheData['yesterdayIncome'];
-            } else {
-                // $period = dateUtil::formatTime('yesterday', '', '', true);
-                // $start = $period['startTime'];
-                // $end = $period['endTime'];
-                // $currentStartDate = date('Y-m-d', strtotime($start));
-                // $currentEndDate = date('Y-m-d', strtotime($end));
-                // $currentStartTime = $currentStartDate . ' 00:00:00';
-                // $currentEndTime = $currentEndDate . ' 23:59:59';
-                // $where['time'] = ['between', [$start, $end]];
-                // $where = ['mainId' => $mainId, 'status' => ['in', [OrderClass::ORDER_STATUS_UN_SEND, OrderClass::ORDER_STATUS_SENDING, OrderClass::ORDER_STATUS_COMPLETE]]];
-                // $where['payTime'] = ['between', [$currentStartTime, $currentEndTime]];
-                // $yesterdayIncome = 0;
-                // $hdOrderList = OrderClass::getAllByCondition($where, null, 'mainPay, forward, cash');
-                // foreach ($hdOrderList as $hdKey => $hdOrder) {
-                //     $actPrice = $hdOrder['mainPay'] ?? 0;
-                //     $forward = $hdOrder['forward'] ?? 0;
-
-                //     if ($forward == 1) { //零售售后付款
-                //         // $lsAfterSale = bcadd($lsAfterSale, $actPrice, 2);
-                //     } else {
-                //         $cash = $hdOrder['cash'] ?? 0;
-                //         $yesterdayIncome = bcadd($actPrice, $yesterdayIncome, 2);
-                //         $yesterdayIncome = bcadd($yesterdayIncome, $cash, 2);
-                //     }
-                // }
+        $orderNum = $respond['totalOrderNum'] ?? 0;
 
-                $mainId = $this->mainId;
-                $_GET['searchTime'] = 'yesterday'; // 必须要有的,让其获取昨天的收入
-                $respond = StatSaleClass::profile($mainId);
-                $incomeList = $respond['income'] ?? [];
-                $yesterdayIncome = 0;
-                if (!empty($incomeList)) {
-                    //这里有二个地方同时要修改,请搜索关键词:index_show_income
-                    foreach ($incomeList as $item) {
-                        if (isset($item['id']) && $item['id'] == 'allot') {
-                            continue;
-                        }
-                        $yesterdayIncome = bcadd($yesterdayIncome, $item['amount'], 2);
-                    }
+        //访客数
+        $visitCustom = StatVisitClass::getVisitNum($this->mainId);
+        $wastage = \bizGhs\order\classes\StockWastageOrderClass::getTodayWaste($this->mainId);
+
+        $hsReturn = StatOrderClass::statHsNum($this->mainId);
+        $hsNum = $hsReturn['num'] ?? 0;
+        $mainId = $this->mainId;
+        $_GET['searchTime'] = 'yesterday'; // 必须要有的,让其获取昨天的收入
+        $respond = StatSaleClass::profile($mainId);
+        $incomeList = $respond['income'] ?? [];
+        $yesterdayIncome = 0;
+        if (!empty($incomeList)) {
+            //这里有二个地方同时要修改,请搜索关键词:index_show_income
+            foreach ($incomeList as $item) {
+                if (isset($item['id']) && $item['id'] == 'allot') {
+                    continue;
                 }
-
-                $cacheData = [
-                    'yesterdayIncome' => $yesterdayIncome,
-                ];
-                \Yii::$app->redis->executeCommand('SETEX', [$cacheKey, 86400, json_encode($cacheData, JSON_UNESCAPED_UNICODE)]);
+                $yesterdayIncome = bcadd($yesterdayIncome, $item['amount'], 2);
             }
         }
-
-        //访客数
-        $visitCustom = StatVisitClass::getVisitNum($this->shopId);
-        // $wastage = \bizGhs\order\classes\StockWastageOrderClass::getTodayWaste($this->mainId);
-        // $hsReturn = StatOrderClass::statHsNum($this->mainId);
-        // $hsNum = $hsReturn['num'] ?? 0;
-
         $menu = [
             ["name" => "商城", "img" => "ghs/home/shop2.png", "url" => "/admin/cg/mall", 'pf' => 1,],
             ["name" => "改价", "img" => "ghs/home/gj2.png", "url" => "/admin/changePrice/list2", 'pf' => 1,],
@@ -193,17 +107,19 @@ class ConsoleController extends BaseController
             ["name" => "花束", "img" => "ghs/home/kcyjs2.png", "url" => "/admin/goods/list", 'pf' => 1,],
             ["name" => "客户充值", "img" => "ghs/home/kcyjs2.png", "url" => "/admin/recharge/rechargeCode", 'pf' => 1,],
         ];
+
+        //查看财务的权限
+        $lookMoney = \bizGhs\shop\classes\ShopAdminClass::lookMoneyPower($this->shopAdmin, $this->shop);
+
         $warning = '';
         //$warning = '本月4号凌晨4点~5点系统升级,暂停使用';
+
         util::success([
+            'asset' => $this->main,
+            'notice' => $notice,
             'warning' => $warning,
-            'todayData' => [
-                'visit' => $visitCustom,
-                'income' => $lsIncome, //$todaySale,
-                'order' => $orderCount, //$orderNum,
-                // 'wastage' => $wastage,
-                // 'bouquet' => $hsNum
-            ],
+            'todayData' => ['visit' => $visitCustom, 'income' => $todaySale, 'order' => $orderNum, 'wastage' => $wastage, 'bouquet' => $hsNum],
+            'incomeStat' => [],
             'yesterdayIncome' => $yesterdayIncome,
             'menu' => $menu,
             'lookMoney' => $lookMoney,

+ 1 - 3
app-hd/controllers/OrderController.php

@@ -570,9 +570,7 @@ class OrderController extends BaseController
     //开单操作 ssh 20220316
     public function actionCreateOrder()
     {
-        $form = new CreateOrderForm();
-        $form->loadAndValidate();
-        $post = $form->getAttributes();
+        $post = Yii::$app->request->post();
 
         $post['sjId'] = $this->sjId;
         $post['shopId'] = $this->shopId;

+ 3 - 4
app-mall/controllers/UserController.php

@@ -127,7 +127,7 @@ class UserController extends BaseController
                 $userId = $this->userId;
                 $birthdayMonth = $user->birthdayMonth ?? 0;
                 $birthdayDate = $user->birthdayDate ?? 0;
-                if ($lunar == 1) {
+                if ($lunar == 1 && $birthdayMonth > 0 && $birthdayDate > 0) {
                     try {
                         //农历转阳历,有多处使用,需要同步修改,关键词change_my_birthday
                         $calendar = new Calendar();
@@ -141,7 +141,6 @@ class UserController extends BaseController
                     } catch (\InvalidArgumentException $e) {
                         $msg = $e->getMessage();
                         noticeUtil::push("更新生日出错了呢,userId:" . $userId . ' ' . $msg, '15280215347');
-                        $birthday = '0000-00-00 00:00:00';
                     }
                 } else {
                     $birthday = date("Y") . '-' . $birthdayMonth . '-' . $birthdayDate;
@@ -163,13 +162,13 @@ class UserController extends BaseController
 
         // 补充店铺信息
         $shop = [];
-        if(!empty($this->shop)){
+        if (!empty($this->shop)) {
             $intraCityRet = ShopClass::hasIntraCity($this->shop);
             $shop['openIntraCity'] = $intraCityRet['openIntraCity'];
             $shop['hcFreeKm'] = $intraCityRet['hcFreeKm'];
             $shop['hcMap'] = $intraCityRet['hcMap'];
         }
-        
+
         util::success(['info' => $user, 'shop' => $shop]);
     }
 

+ 39 - 28
biz-ghs/item/classes/ItemClass.php

@@ -210,65 +210,65 @@ class ItemClass extends BaseClass
                     $lsKeyName = str_replace("a级", "-零售", $name);
                     $dkKeyName = str_replace("a级", "-大客", $name);
                     $keyLevel = 'a';
-                    $map[$pfKeyName.$keyLevel] = $productId;
-                    $map[$lsKeyName.$keyLevel] = $productId;
-                    $map[$dkKeyName.$keyLevel] = $productId;
+                    $map[$pfKeyName . $keyLevel] = $productId;
+                    $map[$lsKeyName . $keyLevel] = $productId;
+                    $map[$dkKeyName . $keyLevel] = $productId;
                 } elseif (strstr($name, "b级")) {
                     $pfKeyName = str_replace("b级", "-批发", $name);
                     $lsKeyName = str_replace("b级", "-零售", $name);
                     $dkKeyName = str_replace("b级", "-大客", $name);
                     $keyLevel = 'b';
-                    $map[$pfKeyName.$keyLevel] = $productId;
-                    $map[$lsKeyName.$keyLevel] = $productId;
-                    $map[$dkKeyName.$keyLevel] = $productId;
+                    $map[$pfKeyName . $keyLevel] = $productId;
+                    $map[$lsKeyName . $keyLevel] = $productId;
+                    $map[$dkKeyName . $keyLevel] = $productId;
                 } elseif (strstr($name, "c级")) {
                     $pfKeyName = str_replace("c级", "-批发", $name);
                     $lsKeyName = str_replace("c级", "-零售", $name);
                     $dkKeyName = str_replace("c级", "-大客", $name);
                     $keyLevel = 'c';
-                    $map[$pfKeyName.$keyLevel] = $productId;
-                    $map[$lsKeyName.$keyLevel] = $productId;
-                    $map[$dkKeyName.$keyLevel] = $productId;
+                    $map[$pfKeyName . $keyLevel] = $productId;
+                    $map[$lsKeyName . $keyLevel] = $productId;
+                    $map[$dkKeyName . $keyLevel] = $productId;
                 } elseif (strstr($name, "d级")) {
                     $pfKeyName = str_replace("d级", "-批发", $name);
                     $lsKeyName = str_replace("d级", "-零售", $name);
                     $dkKeyName = str_replace("d级", "-大客", $name);
                     $keyLevel = 'd';
-                    $map[$pfKeyName.$keyLevel] = $productId;
-                    $map[$lsKeyName.$keyLevel] = $productId;
-                    $map[$dkKeyName.$keyLevel] = $productId;
+                    $map[$pfKeyName . $keyLevel] = $productId;
+                    $map[$lsKeyName . $keyLevel] = $productId;
+                    $map[$dkKeyName . $keyLevel] = $productId;
                 } elseif (strstr($name, "a")) {
                     $pfKeyName = str_replace("a", "-批发", $name);
                     $lsKeyName = str_replace("a", "-零售", $name);
                     $dkKeyName = str_replace("a", "-大客", $name);
                     $keyLevel = 'a';
-                    $map[$pfKeyName.$keyLevel] = $productId;
-                    $map[$lsKeyName.$keyLevel] = $productId;
-                    $map[$dkKeyName.$keyLevel] = $productId;
+                    $map[$pfKeyName . $keyLevel] = $productId;
+                    $map[$lsKeyName . $keyLevel] = $productId;
+                    $map[$dkKeyName . $keyLevel] = $productId;
                 } elseif (strstr($name, "b")) {
                     $pfKeyName = str_replace("b", "-批发", $name);
                     $lsKeyName = str_replace("b", "-零售", $name);
                     $dkKeyName = str_replace("b", "-大客", $name);
                     $keyLevel = 'b';
-                    $map[$pfKeyName.$keyLevel] = $productId;
-                    $map[$lsKeyName.$keyLevel] = $productId;
-                    $map[$dkKeyName.$keyLevel] = $productId;
+                    $map[$pfKeyName . $keyLevel] = $productId;
+                    $map[$lsKeyName . $keyLevel] = $productId;
+                    $map[$dkKeyName . $keyLevel] = $productId;
                 } elseif (strstr($name, "c")) {
                     $pfKeyName = str_replace("c", "-批发", $name);
                     $lsKeyName = str_replace("c", "-零售", $name);
                     $dkKeyName = str_replace("c", "-大客", $name);
                     $keyLevel = 'c';
-                    $map[$pfKeyName.$keyLevel] = $productId;
-                    $map[$lsKeyName.$keyLevel] = $productId;
-                    $map[$dkKeyName.$keyLevel] = $productId;
+                    $map[$pfKeyName . $keyLevel] = $productId;
+                    $map[$lsKeyName . $keyLevel] = $productId;
+                    $map[$dkKeyName . $keyLevel] = $productId;
                 } elseif (strstr($name, "d")) {
                     $pfKeyName = str_replace("d", "-批发", $name);
                     $lsKeyName = str_replace("d", "-零售", $name);
                     $dkKeyName = str_replace("d", "-大客", $name);
                     $keyLevel = 'd';
-                    $map[$pfKeyName.$keyLevel] = $productId;
-                    $map[$lsKeyName.$keyLevel] = $productId;
-                    $map[$dkKeyName.$keyLevel] = $productId;
+                    $map[$pfKeyName . $keyLevel] = $productId;
+                    $map[$lsKeyName . $keyLevel] = $productId;
+                    $map[$dkKeyName . $keyLevel] = $productId;
                 } else {
                     $hasLevel = false;
                 }
@@ -441,20 +441,31 @@ class ItemClass extends BaseClass
 
     public static function getShowList($where, $custom)
     {
-        $level = isset($custom->level) ? $custom->level : 1;
-        $field = 'id,cover,name,cost,itemId,classId,property,skPrice,variety,price,hjPrice,discountPrice,skDiscountPrice,hjDiscountPrice,stock,stockWarning,presell,ratioType,smallRatio,smallUnit,bigUnit,ratio,hjAddPrice,addPrice';
+        $level = $custom->level ?? 1;
+        $field = 'id,cover,name,cost,itemId,classId,property,skPrice,variety,price,hjPrice,discountPrice,skDiscountPrice,hjDiscountPrice,stock,stockWarning,presell,reachNum,reachNumDiscount,ratioType,smallRatio,smallUnit,bigUnit,ratio,hjAddPrice,addPrice';
         $list = self::getAllByCondition($where, ['inTurn' => SORT_DESC, 'actualSold' => SORT_DESC], $field);
         if (empty($list)) {
             return $list;
         }
         $list = ProductClass::groupProductInfo($list, $level);
         $data = [];
-        $data[ItemClassClass::TJ_CLASS_ID] = [];
+        $data['-1'] = [];
         foreach ($list as $it) {
             $classId = $it['classId'] ?? 0;
             $data[$classId][] = $it;
+            //特价,今日推荐
             if (isset($it['discountPrice']) && $it['discountPrice'] > 0) {
-                $data[ItemClassClass::TJ_CLASS_ID][] = $it;
+                $data['-1'][] = $it;
+            }
+            //预售
+            if (isset($it['presell']) && $it['presell'] == 1) {
+                $data['-3'][] = $it;
+            }
+            //满减
+            $reachNum = $it['reachNum'] ?? 0;
+            $reachNumDiscount = $it['reachNumDiscount'] ?? 0;
+            if ($reachNum > 0 && $reachNumDiscount > 0) {
+                $data['-2'][] = $it;
             }
         }
         return $data;

+ 37 - 4
biz-ghs/item/classes/ItemClassClass.php

@@ -8,6 +8,7 @@ namespace bizGhs\item\classes;
 
 
 use bizGhs\base\classes\BaseClass;
+use bizGhs\product\classes\ProductClass;
 use bizGhs\shop\classes\ShopClass;
 use common\components\imgUtil;
 use common\components\util;
@@ -108,11 +109,43 @@ class ItemClassClass extends BaseClass
     //花材列表页分类,包含今日特价分类 ssh 20220315
     public static function getShopClass($mainId)
     {
-        $class = [['id' => self::TJ_CLASS_ID, 'name' => '今日推荐', 'cover' => 'item_class/tj.jpg']];
-        $data = self::getAllList('id,name,cover', ['mainId' => $mainId], 'inTurn desc');
-        if (!empty($data)) {
-            $class = array_merge($data, $class);
+        $class = self::getAllList('id,name,cover', ['mainId' => $mainId], 'inTurn desc');
+        $itemList = ProductClass::getAllByCondition(['mainId' => $mainId, 'delStatus' => 0, 'status' => 1], null, 'id,name,reachNum,reachNumDiscount,presell,discountPrice', null, true);
+        if (!empty($itemList)) {
+            $arr = [];
+            //有多处需要同步修改,show_my_item_class_list ssh 20260107
+            foreach ($itemList as $item) {
+                $reachNum = $item->reachNum ?? 0;
+                $reachNumDiscount = $item->reachNumDiscount ?? 0;
+                if (isset($item->presell) && $item->presell == 1) {
+                    $arr[3] = [
+                        'id' => -3,
+                        'name' => '预售专区',
+                        'shortCover' => 'item_class/mrfl.png',
+                        'cover' => imgUtil::groupImg('item_class/mrfl.png') . "?x-oss-process=image/resize,m_fill,h_130,w_130"
+                    ];
+                }
+                if (isset($item->discountPrice) && $item->discountPrice > 0) {
+                    $arr[1] = [
+                        'id' => -1,
+                        'name' => '今日推荐',
+                        'shortCover' => 'item_class/tj.jpg',
+                        'cover' => imgUtil::groupImg('item_class/tj.jpg') . "?x-oss-process=image/resize,m_fill,h_130,w_130"
+                    ];
+                }
+                if ($reachNum > 0 && $reachNumDiscount > 0) {
+                    $arr[2] = [
+                        'id' => -2,
+                        'name' => '满减活动',
+                        'shortCover' => 'item_class/mrfl.png',
+                        'cover' => imgUtil::groupImg('item_class/mrfl.png') . "?x-oss-process=image/resize,m_fill,h_130,w_130"
+                    ];
+                }
+            }
+            $arr = array_values($arr);
+            $class = array_merge($arr, $class);
         }
+
         foreach ($class as $key => $item) {
             $class[$key]['cover'] = imgUtil::groupImg($item['cover']) . "?x-oss-process=image/resize,m_fill,h_130,w_130";
         }

+ 19 - 2
biz-ghs/product/services/ProductService.php

@@ -20,7 +20,7 @@ class ProductService extends BaseService
 
     //特价
     const TJ_CLASS_ID = '-1';
-    //常用
+    //满减活动
     const OFTEN_CLASS_ID = '-2';
     //预售
     const PRESELL_CLASS_ID = '-3';
@@ -129,13 +129,20 @@ class ProductService extends BaseService
     {
         //今日特价
         $tjItem = [];
+        $mjItem = [];
         $itemGroup = [];
         $preSellItem = [];
         if ($itemInfoData) {
             foreach ($itemInfoData as $v) {
                 $reachNum = $v['reachNum'] ?? 0;
                 $reachNumDiscount = $v['reachNumDiscount'] ?? 0;
-                if ((isset($v['discountPrice']) && $v['discountPrice'] > 0) || ($reachNum > 0 && $reachNumDiscount > 0)) {
+                if ($reachNum > 0 && $reachNumDiscount > 0) {
+                    $v['classId'] = self::OFTEN_CLASS_ID;
+                    $v['className'] = '满减活动';
+                    $mjItem[] = $v;
+                    $itemGroup[] = $v;
+                }
+                if ((isset($v['discountPrice']) && $v['discountPrice'] > 0)) {
                     $v['classId'] = self::TJ_CLASS_ID;
                     $v['className'] = '今日推荐';
                     $tjItem[] = $v;
@@ -192,6 +199,16 @@ class ProductService extends BaseService
                 $classData[] = $tmp;
             }
         }
+        if ($showTodayDiscount && !empty($mjItem)) {
+            $mjClass = [[
+                'classId' => self::OFTEN_CLASS_ID,
+                'className' => '满减活动',
+                'print' => 0,
+                'classCover' => imgUtil::groupImg('item_class/mrfl.jpg'),
+                'child' => $mjItem,
+            ]];
+            $classData = array_merge($mjClass, $classData);
+        }
         if ($showTodayDiscount && !empty($tjItem)) {
             //限购的排在最前面,多处同步修改limit_ahead
             $tjItem = arrayUtil::arraySort($tjItem, 'limitBuy');