瀏覽代碼

加价方式与提现提示

shish 5 年之前
父節點
當前提交
9a374ac134
共有 2 個文件被更改,包括 9 次插入4 次删除
  1. 1 1
      app-ghs/controllers/CashController.php
  2. 8 3
      biz-ghs/item/services/ItemService.php

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

@@ -36,7 +36,7 @@ class CashController extends BaseController
         try {
             CashClass::addApply($get);
             $transaction->commit();
-            util::success('提交成功,等待审核');
+            util::success('申请成功,最迟第2天到帐');
         } catch (\Exception $exception) {
             $transaction->rollBack();
             Yii::info("提现申请报错:" . $exception->getMessage());

+ 8 - 3
biz-ghs/item/services/ItemService.php

@@ -52,9 +52,14 @@ class ItemService extends BaseService
         }
         $name = $data['name'] ?? '';
 
-        //2021.7.11 linqh  参数改为 只传售价,成本价和加价各取一半[{itemId:1000,classId:2,price:1,stockWarning:1}]
-        $cost = bcdiv($price, 2, 2);
-        $addPrice = bcsub($price, $cost, 2);
+        if ($price > 5) {
+            $cost = bcsub($price, 5, 2);
+            $addPrice = 5;
+        } else {
+            $cost = bcdiv($price, 2, 2);
+            $addPrice = bcsub($price, $cost, 2);
+        }
+
         $data['cost'] = $cost;
         $data['addPrice'] = $addPrice;