shish 3 lat temu
rodzic
commit
885ea34686

+ 7 - 34
biz/sj/classes/CashClass.php

@@ -40,40 +40,13 @@ class CashClass extends BaseClass
     }
 
     //获取提现费率 ssh 20210623
-    public static function getRate($currentPtStyle, $shopId)
+    public static function getRate($currentPtStyle, $main)
     {
-        if ($currentPtStyle == dict::getDict('ptStyle', 'hd')) {
-            return 0.006;
-        } elseif ($currentPtStyle == dict::getDict('ptStyle', 'ghs')) {
-            //纯彩花艺
-            if ($shopId == 10 || $shopId == 22) {
-                return 0.003;
-            }
-            //天天鲜花 阿东 当天到账
-            if ($shopId == 763 || $shopId == 795 || $shopId == 1405) {
-                return 0.0035;
-            }
-            //泉城
-            if ($shopId == 447 || $shopId == 1105) {
-                return 0.003;
-            }
-            //都市花季
-            if ($shopId == 1212 || $shopId == 1315) {
-                return 0.003;
-            }
-            //惠雅鲜花
-            if ($shopId == 1489 || $shopId == 520) {
-                return 0.003;
-            }
-            //花样年华
-            if ($shopId == 1585 || $shopId == 1596) {
-                return 0.003;
-            }
-            //丽子鲜花 翔安店
-            if ($shopId == 1527) {
-                return 0.003;
-            }
-            return 0.0038;
+        if ($currentPtStyle == dict::getDict('ptStyle', 'ghs')) {
+            $rate = $main->rate ?? 3.8;
+            $rateVal = bcdiv($rate, 1000, 4);
+            $rateVal = floatval($rateVal);
+            return $rateVal;
         }
         return 0.006;
     }
@@ -127,7 +100,7 @@ class CashClass extends BaseClass
 
         //应转金额
         $ptStyle = $shop->ptStyle;
-        $rate = CashClass::getRate($ptStyle, $shop->id);
+        $rate = CashClass::getRate($ptStyle, $main);
         $tip = bcmul($txBalance, $rate, 2);
         $beAmount = bcsub($txBalance, $tip, 2);
 

+ 0 - 27
console/controllers/InitController.php

@@ -9,32 +9,5 @@ use yii\console\Controller;
 class InitController extends Controller
 {
 
-    public function actionUnit()
-    {
-        ini_set('memory_limit', '2045M');
-        set_time_limit(0);
-
-        $arr = UnitClass::getAllByCondition(['id>' => 0], null, '*', 'id');
-        $data = [];
-        foreach ($arr as $item) {
-            $id = $item['id'] ?? 0;
-            $name = $item['name'] ?? '';
-            $data[$id] = $name;
-        }
-
-        $itemList = ProductClass::getAllByCondition(['id>'=>0], null, '*', null, true);
-        if (!empty($itemList)) {
-            foreach ($itemList as $item) {
-                $bigUnitId = $item->bigUnitId ?? 1;
-                $smallUnitId = $item->smallUnitId ?? 1;
-                $bigUnit = $data[$bigUnitId] ?? '扎';
-                $smallUnit = $data[$smallUnitId] ?? '支';
-                $item->bigUnit = $bigUnit;
-                $item->smallUnit = $smallUnit;
-                $item->save();
-            }
-        }
-
-    }
 
 }