Selaa lähdekoodia

麦序清理调整

zhangxiaobin 1 vuosi sitten
vanhempi
commit
deb5cfc327
2 muutettua tiedostoa jossa 32 lisäystä ja 4 poistoa
  1. 23 1
      application/api/controller/Money.php
  2. 9 3
      application/api/controller/Tenim.php

+ 23 - 1
application/api/controller/Money.php

@@ -24,7 +24,7 @@ use app\common\library\Sms as Smslib;
  */
 class Money extends Common
 {
-    protected $noNeedLogin = ['getRecharConfig', 'getRateMoney', 'getExchangeConfig', 'getExchsoundConfig', 'rebateDuty', 'kjRecharge', 'changeWithDrawStatus'];
+    protected $noNeedLogin = ['getRecharConfig', 'getRateMoney', 'getExchangeConfig', 'getExchsoundConfig', 'rebateDuty', 'kjRecharge', 'changeWithDrawStatus','moneyConfig'];
     protected $noNeedRight = '*';
 
     public function _initialize()
@@ -1843,4 +1843,26 @@ class Money extends Common
         $result =$alipay->AliPayWithdraw($data);
         return $result;
     }
+
+    /**
+     * 获取余额相关比例
+     * @return void
+     */
+    public function moneyConfig()
+    {
+        try {
+            $field = 'name,title,value';
+            $where['name'] = ['in', ['money_to_jewel','withdrawRate']];
+            $config = Db::name('config')->field($field)->where($where)->select();
+            $result = [];
+            if (!empty($config)) {
+                foreach ($config as $key => $value) {
+                    $result[$value['name']] = $value;
+                }
+            }
+            $this->success('获取成功',$result);
+        } catch (Exception $e) {
+            $this->error($e->getMessage());
+        }
+    }
 }

+ 9 - 3
application/api/controller/Tenim.php

@@ -701,9 +701,15 @@ exit;
                         foreach ($imRes['data'] as $imKey => &$imVal) {
                             if (in_array($imVal['key'],$imFieldArr)) {
                                 $tempData = json_decode($imVal['value'],true);
-                                if (isset($tempData['user']) && $tempData['user'] == $userId) {
-                                    $tempData['status'] = 0;
-                                    $tempData['user'] = "";
+                                if (isset($tempData['user'])) {
+                                    if ($tempData['user'] == $userId) {//找到用户清理麦序
+                                        $tempData['status'] = 0;
+                                        $tempData['user'] = "";
+                                    } else {
+                                        if (empty($tempData['user']) && $tempData['status'] == 1) {
+                                            $tempData['status'] = 0;
+                                        }
+                                    }
                                 }
                                 $imVal['value'] = json_encode($tempData);
                             }