Browse Source

会员升级

Kirin 1 year ago
parent
commit
342afc70e7

+ 21 - 0
app/controller/admin/v1/finance/Finance.php

@@ -11,6 +11,8 @@
 
 namespace app\controller\admin\v1\finance;
 
+use app\jobs\integral\IntegralJob;
+use app\services\user\UserAwardIntegralServices;
 use app\services\user\UserBillServices;
 use app\services\user\UserBrokerageServices;
 use app\services\user\UserMoneyServices;
@@ -103,4 +105,23 @@ class Finance extends AuthController
         return $this->success($services->getBrokerageList($where));
     }
 
+    public function setAwardIntegral(){
+        $rate1 = sys_config('action_integral_rate', 3);
+        $rate2 = sys_config('static_integral_rate', 3);
+        $service = app()->make(UserAwardIntegralServices::class);
+        $list = $service->getList(['status' => 0]);
+        foreach ($list as $v) {
+            if ($v['type'] == 1) {
+                $sum_extract = bcmul($rate1, $v['sum_price'], 2);
+            } else {
+                $sum_extract = bcmul($rate2, $v['order_price'], 2);
+            }
+            if ($sum_extract != $v['extract_sum']) {
+                $service->update($v['id'], ['extract_sum' => $sum_extract]);
+            }
+        }
+        app()->make(IntegralJob::class)->autoExtract($service->getPrice());
+        return $this->success('ok');
+    }
+
 }

+ 16 - 17
app/controller/api/v1/PublicController.php

@@ -59,23 +59,22 @@ class PublicController extends BaseController
 
     public function test()
     {
-//        var_dump(WithdrawService::init()::applySignUrl(286137));
-//        var_dump(WithdrawService::init()::querySignResult('APL1737385463784161280'));
-//        var_dump(WithdrawService::init()::contractDo('239164'));
-        var_dump(WithdrawService::init()::contractInfo('239164'));
-//        var_dump(WithdrawService::init()::fastIssuing(286137, 3,
-//            '潘雪珍',
-//            '332603197410045327',
-//            '13216941319',
-//            '6216666200001509444',
-//            100,
-//            '佣金提现'
-//        ));
-
-        //SYYX12023122016485345574
-        //{"enterprise_professional_facilitator_id":239164,"professional_id":286137,"professional_sn":"P0286137"}
-        // { ["transactionCode"]=> string(22) "APL1737385463784161280" ["signUrl"]=> string(186) "https://h5.sandbox.junziqian.com/signInfo/viewDetail?ts=1703059948458&signNo=SSN1737385463805132800&sign=spDB2t_oorkOKb-Odi-wHpPbFPxhp2JeCSPehR8MyoQ&backUrl=https%3A%2F%2Fwww.syushop.com" }
-
+        $rate1 = sys_config('action_integral_rate', 3);
+        $rate2 = sys_config('static_integral_rate', 3);
+        $service = app()->make(UserAwardIntegralServices::class);
+        $list = $service->getList(['status' => 0]);
+        foreach ($list as $v) {
+            if ($v['type'] == 1) {
+                $sum_extract = bcmul($rate1, $v['sum_price'], 2);
+            } else {
+                $sum_extract = bcmul($rate2, $v['order_price'], 2);
+            }
+            if ($sum_extract != $v['extract_sum']) {
+                $service->update($v['id'], ['extract_sum' => $sum_extract]);
+            }
+        }
+        app()->make(IntegralJob::class)->autoExtract($service->getPrice());
+        return app('json')->successful('ok');
     }
 
     /**

+ 2 - 1
app/model/user/UserExtract.php

@@ -49,7 +49,8 @@ class UserExtract extends BaseModel
     protected static $status = [
         -1 => '未通过',
         0 => '审核中',
-        1 => '已提现'
+        1 => '已提现',
+        2 => '待二次审核',
     ];
 
     /**