wesmiler 1 år sedan
förälder
incheckning
98f4324f4d

+ 21 - 15
app/Services/Api/MemberService.php

@@ -275,6 +275,8 @@ class MemberService extends BaseService
             'sbt_fee' => ConfigService::make()->getConfigByCode('profit_withdraw_sbt_fee', 0),
             'recharge_min' => ConfigService::make()->getConfigByCode('recharge_min_money', 0.1),
             'withdraw_min' => ConfigService::make()->getConfigByCode('withdraw_min_money', 0),
+            'recharge_open' => ConfigService::make()->getConfigByCode('recharge_open', 1),
+            'withdraw_open' => ConfigService::make()->getConfigByCode('withdraw_open', 1),
         ];
 
         if ($type == 1) {
@@ -569,25 +571,29 @@ class MemberService extends BaseService
      */
     public function makeQrcode($str, $dir='qrcode', $refresh = false, $size = 4, $margin = 2, $level = 2)
     {
-        $basePath = base_path() . '/public';
-        $qrFile = "/images/{$dir}/";
-        if (!is_dir($basePath . '/uploads' . $qrFile)) {
-            @mkdir($basePath . '/uploads' . $qrFile, 0755, true);
-        }
+        try {
+            $basePath = base_path() . '/public';
+            $qrFile = "/images/{$dir}/";
+            if (!is_dir($basePath . '/uploads' . $qrFile)) {
+                @mkdir($basePath . '/uploads' . $qrFile, 0755, true);
+            }
 
-        $key = date('Ymd') . strtoupper(md5($str . '_' . $size . $margin . $level));
-        $qrFile = $qrFile . "C_{$key}.png";
-        $cacheKey = "caches:qrcodes:member_" . $key;
-        if (RedisService::get($cacheKey) && is_file($basePath . '/uploads' . $qrFile) && !$refresh) {
-            return $qrFile;
-        }
+            $key = date('Ymd') . strtoupper(md5($str . '_' . $size . $margin . $level));
+            $qrFile = $qrFile . "C_{$key}.png";
+            $cacheKey = "caches:qrcodes:member_" . $key;
+            if (RedisService::get($cacheKey) && is_file($basePath . '/uploads' . $qrFile) && !$refresh) {
+                return $qrFile;
+            }
 
-        QRcode::png($str, $basePath . '/uploads' . $qrFile, $level, $size, $margin);
-        if (!file_exists($basePath . '/uploads' . $qrFile)) {
+            QRcode::png($str, $basePath . '/uploads' . $qrFile, $level, $size, $margin);
+            if (!file_exists($basePath . '/uploads' . $qrFile)) {
+                return false;
+            }
+            RedisService::set($cacheKey, ['str' => $str, 'qrcode' => $qrFile, 'date' => date('Y-m-d H:i:s')], 7 * 24 * 3600);
+            return $qrFile;
+        }catch (\Exception $exception){
             return false;
         }
-        RedisService::set($cacheKey, ['str' => $str, 'qrcode' => $qrFile, 'date' => date('Y-m-d H:i:s')], 7 * 24 * 3600);
-        return $qrFile;
     }
 
     /**

+ 2 - 0
app/Services/Api/PledgeOrderService.php

@@ -75,6 +75,7 @@ class PledgeOrderService extends BaseService
             "pledge_total" => "0.00",
             "pledge_money" => "0.00",
             "pledge_profit" => "0.00",
+            "pledge_destruction" => "0.00",
             "pledge_end_time" => 0,
             "pledge_settle_time" => 0,
             "pledge_ent_text" => '00:00:00',
@@ -87,6 +88,7 @@ class PledgeOrderService extends BaseService
 
         if($userId){
             $counts['pledge_count'] = (int)$this->model->where(['user_id'=> $userId,'mark'=>1])->count('id');
+            $counts['pledge_destruction'] = (int)abs(AccountLogModel::where(['type'=>1,'coin_type'=>2,'status'=> 1,'mark'=>1])->sum('money'));
             $counts['pledge_total'] = moneyFormat($this->model->where(['user_id'=> $userId,'mark'=>1])->sum('money'),2);
             $info = $this->model->where(['user_id'=> $userId,'status'=>1,'mark'=>1])->orderBy('create_time','desc')->orderBy('id','desc')->first();
             $info = $info? $info->toArray() : [];

+ 1 - 1
app/Services/Api/TeamService.php

@@ -142,7 +142,7 @@ class TeamService extends BaseService
         ];
 
         if($type == 1){
-            $info['share_count'] = $this->getTeamUserCountByType($userId, 1); //
+            $info['share_count'] = $this->getTeamUserCountByType($userId, 2); //
             $info['today_share_count'] = $this->getTeamUserCountByType($userId, 3);
 
             // 下一等级业绩,团队业绩