Explorar o código

Merge branch 'master' into dev

shish hai 3 meses
pai
achega
b325cde2d9

+ 1 - 0
.gitignore

@@ -18,3 +18,4 @@ app-pt/web/assets/
 app-ghs/web/assets/
 app-mall/web/assets/
 .aider*
+AGENTS.md

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

@@ -174,6 +174,7 @@ class ConsoleController extends BaseController
 
         //$notice[] = ['title' => '母亲节订单较多,新订单通知会延迟。', 'action' => '', 'page' => ''];
         //$notice[] = ['title' => '新功能:客户端和后台使用跑腿的流程', 'action' => '', 'page' => '/admin/book/detail?id=use_pt'];
+        $notice[] = ['title' => '过二天,收银机点花材名字可增加数量。', 'action' => '查看', 'page' => '/admin/book/detail?id=casherUpdate'];
 
         $mainId = $this->mainId;
         $respond = StatSaleClass::profile($mainId);

+ 4 - 4
app-hd/controllers/PurchaseController.php

@@ -290,7 +290,7 @@ class PurchaseController extends BaseController
         }
         $ghsShopId = $ghsInfo['shopId'] ?? 0;
 
-        if (isset($ghsInfo['mainId']) && !empty($ghsInfo['mainId']) && $ghsInfo['mainId'] == $ghsInfo['ownMainId']) {
+        if (!empty($ghsInfo['mainId']) && $ghsInfo['mainId'] == $ghsInfo['ownMainId']) {
             util::fail('不能跟自己的店买花');
         }
 
@@ -342,7 +342,7 @@ class PurchaseController extends BaseController
             if (isset($post['transType']) && $post['transType'] == 4) {
                 if (isset($ghsShopInfo->pfLevel) && $ghsShopInfo->pfLevel == 1) {
                     $notSameCity = PurchaseClass::notSameCity($this->shop, $ghsShopInfo);
-                    if ($notSameCity == false) {
+                    if (!$notSameCity) {
                         util::fail('距离太远,不能选择同城配送');
                     }
                 }
@@ -401,7 +401,7 @@ class PurchaseController extends BaseController
                         if ($book == 1) {
                             util::fail('预订时不能选择预售花材');
                         } else {
-                            if (isset($post['sendTimeWant']) == false || empty($post['sendTimeWant'])) {
+                            if (empty($post['sendTimeWant'])) {
                                 util::fail('请选择配送日期');
                             }
                             $sendTimeWant = $post['sendTimeWant'];
@@ -413,7 +413,7 @@ class PurchaseController extends BaseController
                             if (empty($hasDate)) {
                                 util::fail('预售日期有问题,请提醒门店');
                             }
-                            if (in_array(strtotime($sendTimeWant), $hasDate) == false) {
+                            if (!in_array(strtotime($sendTimeWant), $hasDate)) {
                                 util::fail("有预售花材在{$sendTimeWant}没到货");
                             }
                             $post['presell'] = 1;

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

@@ -237,8 +237,8 @@
             const downloadUrls = {
                 'xiaohuabao': 'https://api.shop.hzghd.com/1279.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' // 销花宝收银下载链接
+                'huazhanggui_cashier': 'https://api.shop.hzghd.com/200.apk', // 花掌柜收银下载链接
+                'xiaohuabao_cashier': 'https://api.shop.hzghd.com/159.apk' // 销花宝收银下载链接
             };
             const url = downloadUrls[appType];
             if (url && url !== '#') {

+ 24 - 9
biz-hd/deduct/classes/DeductClass.php

@@ -5,14 +5,13 @@ namespace bizHd\deduct\classes;
 use bizHd\balance\classes\BalanceChangeClass;
 use bizHd\balance\classes\BalanceGiveChangeClass;
 use bizHd\balance\classes\BalancePayChangeClass;
+use bizHd\custom\classes\CustomClass;
 use common\components\dict;
 use common\components\util;
-use Yii;
 use bizHd\base\classes\BaseClass;
 
 class DeductClass extends BaseClass
 {
-
     public static $baseFile = '\bizHd\deduct\models\Deduct';
 
     public static function doDeduct($shop, $custom, $hd, $amount, $params)
@@ -22,10 +21,7 @@ class DeductClass extends BaseClass
             util::fail('余额不够扣');
         }
         $custom->balance = bcsub($custom->balance, $amount, 2);
-        $custom->save();
-
         $hd->balance = bcsub($hd->balance, $amount, 2);
-        $hd->save();
 
         if (floatval($hd->balance) != floatval($custom->balance)) {
             util::fail('余额有问题');
@@ -95,10 +91,8 @@ class DeductClass extends BaseClass
         /************************* 使用充值余额 *****************************/
         $customBalancePay = bcsub($custom->balancePay, $payAmount, 2);
         $custom->balancePay = $customBalancePay;
-        $custom->save();
         $hdBalancePay = bcsub($hd->balancePay, $payAmount, 2);
         $hd->balancePay = $hdBalancePay;
-        $hd->save();
         $payChange = [
             'hdId' => $hdId,
             'hdName' => $hdName,
@@ -129,10 +123,8 @@ class DeductClass extends BaseClass
                 util::fail('余额异常哈!请联系管理员,编号' . $hdId . ' ' . $custom->balanceGive);
             }
             $custom->balanceGive = $customBalanceGive;
-            $custom->save();
             $hdBalanceGive = bcsub($hd->balanceGive, $mustUseGiveAmount, 2);
             $hd->balanceGive = $hdBalanceGive;
-            $hd->save();
             if (floatval($customBalanceGive) != floatval($hdBalanceGive)) {
                 util::fail('余额有问题呢!请联系管理员,编号' . $hdId);
             }
@@ -162,6 +154,29 @@ class DeductClass extends BaseClass
         if (floatval($addBalance) != floatval($custom->balance)) {
             util::fail('账户余额有问题!请检查哈,编号' . $customId);
         }
+
+        // 仅对从充值余额(balancePay)扣减的部分扣积分/成长值
+        $changeAmount = $payAmount;
+        if (bccomp($changeAmount, 0, 2) === 1) {
+            $newIntegral = bcsub($custom->integral, $changeAmount, 2);
+            if (bccomp($newIntegral, 0, 2) === -1) {
+                $newIntegral = 0;
+            }
+            $newGrowth = bcsub($custom->growth, $changeAmount, 2);
+            if (bccomp($newGrowth, 0, 2) === -1) {
+                $newGrowth = 0;
+            }
+            $custom->integral = $newIntegral;
+            $custom->growth = $newGrowth;
+            $memberData = CustomClass::getCustomExpenseLevel($custom->growth, $mainId); // 设置等级多处需要同步修改的,请搜索:getCustomExpenseLevel
+            CustomClass::updateById($customId, [
+                'member' => (int) ($memberData['level'] ?? 0),
+                'memberName' => (string) ($memberData['name'] ?? ''),
+            ]);
+        }
+
+        $custom->save();
+        $hd->save();
     }
 
 }

+ 2 - 2
biz-hd/recharge/classes/RechargeClass.php

@@ -277,8 +277,8 @@ class RechargeClass extends BaseClass
         $addIntegralAndGrowth = bccomp($changeAmount, 0, 2) === 1; // 如果变化金额大于0,则计算积分与成长值
         if ($addIntegralAndGrowth) {
             //积分与成长值
-            $custom->integral = bcadd($custom->integral, $changeAmount);
-            $custom->growth = bcadd($custom->growth, $changeAmount);
+            $custom->integral = bcadd($custom->integral, $changeAmount, 2);
+            $custom->growth = bcadd($custom->growth, $changeAmount, 2);
 
             // 由于没有更新 buyAmount,所以得额外添加更新等级
             $memberData = CustomClass::getCustomExpenseLevel($custom->growth, $mainId); // 设置等级多处需要同步修改的,请搜索:getCustomExpenseLevel

+ 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, 15007, 88085, 91064, 413, 62421];
+        $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, 91053];
         foreach ($nearbyShops as $key => $nearbyShop) {
             if (in_array($nearbyShop['id'], $exclude)) {
                 unset($nearbyShops[$key]);

+ 4 - 0
common/components/book.php

@@ -63,6 +63,7 @@ class book
             ['title' => '微信和支付宝开户认证', 'id' => 'upgrade'],
             ['title' => '换卡和新开收款账户收费标准', 'id' => 'changeCard'],
             ['title' => '公司地址', 'id' => 'aboutUs'],
+            ['title' => '收银机改进', 'id' => 'casherUpdate'],
         ]],
     ];
 
@@ -278,6 +279,9 @@ class book
             ['style' => 'info', 'value' => '地址:斗南花花世界1号馆5045室,具体位置如下',],
             ['style' => 'image', 'value' => 'gs2.jpg',],
         ],
+        'casherUpdate'=>[
+            ['style' => 'video', 'value' => 'jc/casher_update.mp4'],
+        ],
     ];
 
 }