shish 3 лет назад
Родитель
Сommit
8ed89f8144

+ 2 - 4
app-ghs/controllers/ShopController.php

@@ -53,10 +53,8 @@ class ShopController extends BaseController
     public function actionBookSet()
     {
         $get = Yii::$app->request->get();
-        $kiloFee = $get['kiloFee'] ?? 0;
-        $miniKilo = $get['miniKilo'] ?? 0;
-        $this->shop->kiloFee = $kiloFee;
-        $this->shop->miniKilo = $miniKilo;
+        $presell = $get['presell'] ?? 0;
+        $this->shop->presell = $presell;
         $this->shop->save();
         util::complete();
     }

+ 18 - 2
app-hd/controllers/PurchaseController.php

@@ -93,12 +93,20 @@ class PurchaseController extends BaseController
             //判断product数据是不是同个供货商的
             $ghsShopInfo = ShopClass::getById($ghsShopId, true);
             $ghsMainId = $ghsShopInfo->mainId ?? 0;
-
             $isOpen = ShopClass::isOpen($ghsShopInfo);
-            if ($isOpen == 0 && $post['book'] == 0) {
+            if ($isOpen == 0 && $book == 0) {
                 util::fail('本店已休息,请选择其它门店');
             }
 
+            $book = $post['book'] ?? 0;
+            $sendTimeWant = isset($post['sendTimeWant']) && !empty($post['sendTimeWant']) ? $post['sendTimeWant'] : date("Y-m-d");
+            $future = date("Y-m-d", strtotime('+2 day'));
+            if ($book == 1) {
+                if (strtotime($sendTimeWant) < strtotime($future)) {
+                    util::fail('请选择未来二天或更后时间');
+                }
+            }
+
             ProductClass::valid($productList, $ghsMainId);
 
             //供货商预订单最低公斤数要求和每公斤服务费
@@ -152,6 +160,9 @@ class PurchaseController extends BaseController
         if ($info->status != 1) {
             util::fail('订单不是待付款状态');
         }
+        if ($info->book == 1) {
+            util::fail('预售不能记欠款');
+        }
 
         $ghsId = $info->ghsId;
         $ghs = GhsClass::getGhsInfo($ghsId);
@@ -264,6 +275,11 @@ class PurchaseController extends BaseController
         $customId = $info['customId'] ?? 0;
         $custom = CustomClass::getById($customId);
         $hasDebtPay = $custom['debt'] ?? 0;
+        $book = $info['book'] ?? 0;
+        //预售不能记欠款
+        if ($book == 1) {
+            $hasDebtPay = 0;
+        }
         $info['hasDebtPay'] = $hasDebtPay;
         $info['balance'] = $this->shop->balance ?? 0;
 

+ 1 - 1
app-hd/controllers/ShopExtController.php

@@ -41,7 +41,7 @@ class ShopExtController extends BaseController
         $ghsMainId = $ghs->mainId ?? 0;
         $itemInfo = ItemClass::getByCondition(['mainId' => $ghsMainId, 'itemId' => $ptItemId], true);
         if (empty($itemInfo)) {
-            util::fail('找不到花材');
+            util::fail('没有花材');
         }
         $list = XjClass::getAllByCondition(['mainId' => $ghsMainId, 'ptItemId' => $ptItemId, 'delStatus' => 0, 'status' => 1], null, '*');
         if (!empty($list)) {

+ 3 - 3
biz-ghs/order/classes/OrderClass.php

@@ -619,7 +619,7 @@ class OrderClass extends BaseClass
         $modifyProduct = ['type' => 'modifyProduct', 'show' => 0, 'disable' => 0, 'name' => '修改花材'];
         $confirm = ['type' => 'confirm', 'show' => 0, 'disable' => 1, 'name' => '确认'];
         $cancel = ['type' => 'cancel', 'show' => 0, 'disable' => 0, 'name' => '取消'];
-        $arrival = ['type' => 'arrival', 'show' => 0, 'disable' => 0, 'name' => '到货'];
+        $arrival = ['type' => 'arrival', 'show' => 0, 'disable' => 0, 'name' => '确认数量'];
 
         if ($isList) {
             //订单列表页显示的按钮
@@ -970,10 +970,10 @@ class OrderClass extends BaseClass
         if (isset($orderInfo['sendType'])) {
             $sendName = '出车';
             if ($orderInfo['sendType'] == 1) {
-                $sendName = '自取';
+                $sendName = '到店自取';
             }
             if ($orderInfo['sendType'] == 2) {
-                $sendName = '发快递';
+                $sendName = '请跑腿送';
             }
             $content .= '<BR><B>' . $sendName . '</B><BR>';
         }

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

@@ -195,6 +195,7 @@ class GhsClass extends BaseClass
             $list[$key]['tjFlAmount'] = $tjFlAmount;
             $list[$key]['miniKilo'] = $shopInfo[$currentShopId]['miniKilo'] ?? 0;
             $list[$key]['kiloFee'] = $shopInfo[$currentShopId]['kiloFee'] ?? 0;
+            $list[$key]['presell'] = $shopInfo[$currentShopId]['presell'] ?? 0;
             $isOpen = 0;
             if (isset($shopInfo[$currentShopId])) {
                 $isOpen = ShopClass::isOpen($shopInfo[$currentShopId]);