Explorar el Código

Merge branch 'zhongqi-delivery' of git.huaml.com:zhh/huahuibao into zhongqi-delivery

shizhongqi hace 8 meses
padre
commit
c12d38636c

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

@@ -165,7 +165,7 @@ class ConsoleController extends BaseController
             }
         }
 
-        $notice[] = ['title' => '跑腿已经支持达达和滴滴,花材免跑腿费设置已经区分批发和零售,有问题请与小石联系,小程序已经更新,APP这二天更新', 'action' => '', 'page' => ''];
+        //$notice[] = ['title' => '跑腿已经支持达达和滴滴,花材免跑腿费设置已经区分批发和零售,使用上有问题请与小石联系,小程序已经更新,APP这二天更新', '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'];

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

@@ -147,7 +147,7 @@ class CustomController extends BaseController
         if (getenv('YII_ENV') == 'production') {
             //小向花卉
             if (in_array($this->shopId, [23580, 24713])) {
-                if (!in_array($this->adminId, [24043, 23960, 4])) {
+                if (!in_array($this->adminId, [24043, 23960, 4,77951])) {
                     util::fail('不能销单哦!!');
                 }
             }

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

@@ -201,7 +201,7 @@ class GhsController extends BaseController
             }
             //小向花卉采购控制
             if ($this->mainId == 23390) {
-                if (!in_array($this->adminId, [24586, 24115, 24759, 26390, 23960, 25011, 25004, 24655, 28521, 4, 24043])) {
+                if (!in_array($this->adminId, [24586, 24115, 24759, 26390, 23960, 25011, 25004, 24655, 28521, 4, 24043,77951])) {
                     util::fail('没有数据哦,编号35');
                 }
             }

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

@@ -151,7 +151,7 @@ class OrderClearController extends BaseController
         if (getenv('YII_ENV') == 'production') {
             //小向花卉
             if (in_array($this->shopId, [23580, 24713])) {
-                if (!in_array($this->adminId, [24043, 23960])) {
+                if (!in_array($this->adminId, [24043, 23960,77951])) {
                     util::fail('不能销单哈!');
                 }
             }

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

@@ -1088,7 +1088,7 @@ class OrderController extends BaseController
         if (getenv('YII_ENV') == 'production') {
             //小向花卉开单售后控制
             if ($this->mainId == 23390) {
-                if (!in_array($this->adminId, [24043, 24585, 24586, 24654, 24115, 23960, 28456, 31105, 28456, 31105, 52528, 25011, 61449])) {
+                if (!in_array($this->adminId, [24043, 24585, 24586, 24654, 24115, 23960, 28456, 31105, 28456, 31105, 52528, 25011, 61449,77951])) {
                     util::fail('你不能开单哦');
                 }
             }

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

@@ -1370,7 +1370,7 @@ class ProductController extends BaseController
         }
 
         $shopAdmin = $this->shopAdmin;
-        if (isset($shopAdmin->super) == false || $shopAdmin->super != 1) {
+        if (!isset($shopAdmin->super) || $shopAdmin->super != 1) {
             util::fail('管理员才能添加花材');
         }
         $post['sjId'] = $this->sjId;
@@ -1481,6 +1481,7 @@ class ProductController extends BaseController
         unset($post['itemId']);
         unset($post['id']);
         unset($post['delStatus']);
+        unset($post['variety']);
 
         ProductClass::addProduct($post, $this->shop);
         util::complete('复制成功');

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

@@ -37,7 +37,7 @@ class PurchaseClearController extends BaseController
         if (getenv('YII_ENV') == 'production') {
             //小向花卉采购的结账确认,有多处,关键词ghs_cg_clear_confirm
             if (in_array($this->mainId, [23390, 24516])) {
-                if (!in_array($this->adminId, [24655])) {
+                if (!in_array($this->adminId, [24655,77951])) {
                     util::fail('不能操作哈');
                 }
             }

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

@@ -47,7 +47,7 @@ class PurchaseController extends BaseController
         if (getenv('YII_ENV') == 'production') {
             //小向花卉采购的结账确认,有多处,关键词ghs_cg_clear_confirm
             if (in_array($this->mainId, [23390, 24516])) {
-                if (!in_array($this->adminId, [24655])) {
+                if (!in_array($this->adminId, [24655,77951])) {
                     util::fail('不能操作哦');
                 }
             }

+ 3 - 3
app-ghs/controllers/PurchaseOrderController.php

@@ -437,7 +437,7 @@ class PurchaseOrderController extends BaseController
         if (getenv('YII_ENV') == 'production') {
             //小向花卉采购控制
             if ($this->mainId == 23390) {
-                if (!in_array($this->adminId, [24586, 24115, 24759, 26390, 23960, 25011, 25004, 24655, 28521, 4,24043])) {
+                if (!in_array($this->adminId, [24586, 24115, 24759, 26390, 23960, 25011, 25004, 24655, 28521, 4,24043,77951])) {
                     util::fail('你不能采购哦');
                 }
             }
@@ -748,7 +748,7 @@ class PurchaseOrderController extends BaseController
             }
             //小向花卉采购控制
             if ($this->mainId == 23390) {
-                if (!in_array($this->adminId, [24586, 24115, 24759, 26390, 23960, 25011, 25004, 24655, 28521, 4, 24043])) {
+                if (!in_array($this->adminId, [24586, 24115, 24759, 26390, 23960, 25011, 25004, 24655, 28521, 4, 24043,77951])) {
                     util::fail('没有数据哦,编号2292');
                 }
             }
@@ -1125,7 +1125,7 @@ class PurchaseOrderController extends BaseController
                 if (getenv('YII_ENV') == 'production') {
                     //小向花卉采购控制
                     if ($this->mainId == 23390) {
-                        if (!in_array($this->adminId, [24586, 24115, 24759, 26390, 23960, 25011, 25004, 24655, 28521, 4,24043])) {
+                        if (!in_array($this->adminId, [24586, 24115, 24759, 26390, 23960, 25011, 25004, 24655, 28521, 4,24043,77951])) {
                             util::fail('你不能采购哦');
                         }
                     }

+ 3 - 3
app-ghs/controllers/RefundController.php

@@ -136,7 +136,7 @@ class RefundController extends BaseController
         if (getenv('YII_ENV') == 'production') {
             //小向花卉开单售后控制
             if ($this->mainId == 23390) {
-                if (!in_array($this->adminId, [24043, 24585, 24586, 24654, 24115, 23960])) {
+                if (!in_array($this->adminId, [24043, 24585, 24586, 24654, 24115, 23960,77951])) {
                     util::fail('你不能售后哦');
                 }
                 //小向花卉售后必须备注
@@ -230,7 +230,7 @@ class RefundController extends BaseController
         if (getenv('YII_ENV') == 'production') {
             //小向花卉开单售后控制
             if ($this->mainId == 23390) {
-                if (!in_array($this->adminId, [24043, 24585, 24586, 24654, 24115, 23960])) {
+                if (!in_array($this->adminId, [24043, 24585, 24586, 24654, 24115, 23960,77951])) {
                     util::fail('你不能售后哦。。');
                 }
                 //小向花卉售后必须备注
@@ -616,7 +616,7 @@ class RefundController extends BaseController
         if (getenv('YII_ENV') == 'production') {
             //小向花卉开单售后控制
             if ($this->mainId == 23390) {
-                if (!in_array($this->adminId, [24043, 24585, 24586, 24654, 24115, 23960])) {
+                if (!in_array($this->adminId, [24043, 24585, 24586, 24654, 24115, 23960,77951])) {
                     util::fail('你不能售后哈。。');
                 }
                 //小向花卉售后必须备注

+ 8 - 28
app-mall/controllers/OrderController.php

@@ -174,20 +174,10 @@ class OrderController extends BaseController
         $userId = $this->userId;
         util::checkRepeatCommit($userId, 3);
 
-        // 判断是否在营业时间窗口
-        $openTime = $this->shop->openStartTime;
-        $closeTime = $this->shop->openEndTime;
-        if ($openTime != '' && $closeTime != '') {
-            $openHourMinute = explode(':', $openTime);
-            $closeHourMinute = explode(':', $closeTime);
-            $currentHour = date('H');
-            $currentMinute = date('i');
-            if ($currentHour < intval($openHourMinute[0]) || ($currentHour == intval($openHourMinute[0]) && $currentMinute < intval($openHourMinute[1]))) {
-                util::fail('不在营业时间窗口');
-            }
-            if ($currentHour > intval($closeHourMinute[0]) || ($currentHour == intval($closeHourMinute[0]) && $currentMinute > intval($closeHourMinute[1]))) {
-                util::fail('不在营业时间窗口');
-            }
+        $shop = $this->shop;
+        $openShop = \bizHd\shop\classes\ShopClass::getOpenShop($shop);
+        if ($openShop == 0) {
+            util::fail('已休店');
         }
 
         //普莲花艺、叶上花、丰行、小武鲜花、九江云朵、源花汇、紫荆不能在花卉宝下单,多处要同步修改,关键词ls_mall_not_open
@@ -460,20 +450,10 @@ class OrderController extends BaseController
         $userId = $this->userId;
         util::checkRepeatCommit($userId, 3);
 
-        // 判断是否在营业时间窗口
-        $openTime = $this->shop->openStartTime; // 示例:09:10
-        $closeTime = $this->shop->openEndTime; // 示例:18:30
-        if ($openTime != '' && $closeTime != '') {
-            $openHourMinute = explode(':', $openTime);
-            $closeHourMinute = explode(':', $closeTime);
-            $currentHour = date('H');
-            $currentMinute = date('i');
-            if ($currentHour < intval($openHourMinute[0]) || ($currentHour == intval($openHourMinute[0]) && $currentMinute < intval($openHourMinute[1]))) {
-                util::fail('不在营业时间窗口');
-            }
-            if ($currentHour > intval($closeHourMinute[0]) || ($currentHour == intval($closeHourMinute[0]) && $currentMinute > intval($closeHourMinute[1]))) {
-                util::fail('不在营业时间窗口');
-            }
+        $shop = $this->shop;
+        $openShop = \bizHd\shop\classes\ShopClass::getOpenShop($shop);
+        if ($openShop == 0) {
+            util::fail('已休店');
         }
 
         $goodsId = $post['goodsId'] ?? 0;

+ 23 - 0
biz-hd/shop/classes/ShopClass.php

@@ -22,6 +22,29 @@ class ShopClass extends BaseClass
 
     public static $baseFile = '\bizHd\shop\models\Shop';
 
+    //是否营业状态 ssh 20251219
+    public static function getOpenShop($shop)
+    {
+        $openShop = 1;
+        if ($shop['open'] == 0) {
+            $openShop = 0;
+        } else {
+            $openStartTime = $shop['openStartTime'] ?? '';
+            $openEndTime = $shop['openEndTime'] ?? '';
+            if (!empty($openStartTime) && !empty($openEndTime)) {
+                $start = date('Y-m-d') . ' ' . $openStartTime;
+                $startTime = strtotime($start);
+                $end = date('Y-m-d') . ' ' . $openEndTime;
+                $endTime = strtotime($end);
+                $currentTime = time();
+                if ($currentTime < $startTime || $currentTime > $endTime) {
+                    $openShop = 0;
+                }
+            }
+        }
+        return $openShop;
+    }
+
     //需要算上包装费
     public static function needAddPackCost($ghsShop, $customId, $orderAmount = 0)
     {

+ 4 - 1
biz-mall/hd/classes/HdClass.php

@@ -25,7 +25,7 @@ class HdClass extends BaseClass
             return $list;
         }
         $ids = array_column($list, 'shopId');
-        $shopList = ShopClass::getAllByCondition(['id' => ['in', $ids]], null, 'id,shopName,rechargeWeal', 'id');
+        $shopList = ShopClass::getAllByCondition(['id' => ['in', $ids]], null, 'id,shopName,rechargeWeal,open,openStartTime,openEndTime', 'id');
         foreach ($list as $key => $val) {
             $shortAvatar = $val['avatar'] ?? '';
             $smallAvatar = imgUtil::groupImg($shortAvatar) . "?x-oss-process=image/resize,m_fill,h_130,w_130";
@@ -38,6 +38,9 @@ class HdClass extends BaseClass
             //是否设置了充值福利 ssh 2025031
             $rechargeWeal = $currentShop['rechargeWeal'] ?? 0;
             $list[$key]['rechargeWeal'] = $rechargeWeal;
+            //是否营业状态
+            $openShop = ShopClass::getOpenShop($currentShop);
+            $list[$key]['openShop'] = $openShop;
         }
         return $list;
     }

+ 1 - 1
common/components/jwt.php

@@ -33,7 +33,7 @@ class jwt
 		->identifiedBy($jwtId, true)//该jwt的唯一ID编号
 		->issuedAt($time)//该jwt的发布时间
 		->canOnlyBeUsedAfter($time)//该jwt的使用时间不能早于该时间
-		->expiresAt($time + 8640000)//该jwt销毁的时间
+		->expiresAt($time + 31536000)//该jwt销毁的时间(1年)
 		->set('uniqueId', $uniqueId)
 			->set('sourceId', $sourceId)
 			->sign($signer, $key)->getToken();