WIN-2308041133\Administrator 1 ماه پیش
والد
کامیت
bbd74e03ba
1فایلهای تغییر یافته به همراه30 افزوده شده و 3 حذف شده
  1. 30 3
      app/controller/api/Auth.php

+ 30 - 3
app/controller/api/Auth.php

@@ -205,28 +205,45 @@ class Auth extends BaseController
      */
     public function userInfo()
     {
+        @file_put_contents('quanju3.txt',"-测试1\r\n",8);
         $user = $this->request->userInfo()->hidden(['label_id', 'group_id', 'pwd', 'addres', 'card_id', 'last_time', 'last_ip', 'create_time', 'mark', 'status', 'spread_time', 'real_name', 'birthday', 'brokerage_price']);
+        @file_put_contents('quanju3.txt',"-测试2\r\n",8);
         $user->append(['service', 'topService', 'total_collect_product', 'total_collect_store', 'total_coupon', 'total_visit_product', 'total_unread', 'total_recharge', 'lock_integral', 'total_integral', 'staffs']);
+        @file_put_contents('quanju3.txt',"-测试3\r\n",8);
         $data = $user->toArray();
+        @file_put_contents('quanju3.txt',"-测试4\r\n",8);
         $data['total_consume'] = $user['pay_price'];
+        @file_put_contents('quanju3.txt',"-测试5\r\n",8);
         $promoter = get_extension_info($user);
+        @file_put_contents('quanju3.txt',"-测试6\r\n",8);
         $promoter['isShow'] = false;
         if ($promoter['isPromoter']) {
             $promoter['isShow'] = true;
+            @file_put_contents('quanju3.txt',"-测试7\r\n",8);
         } else {
             if (!in_array($promoter['promoter_type'],[1,2])) {
+                @file_put_contents('quanju3.txt',"-测试8\r\n",8);
                 $promoter['isShow'] = true;
             }
         }
+        @file_put_contents('quanju3.txt',"-测试9\r\n",8);
         $data['promoter'] = $promoter;
-        if (systemConfig('member_status'))
+        @file_put_contents('quanju3.txt',"-测试10\r\n",8);
+        if (systemConfig('member_status')){
+            @file_put_contents('quanju3.txt',"-11\r\n",8);
             $data['member_icon'] = $this->request->userInfo()->member->brokerage_icon ?? '';
-        if ($data['is_svip'] == 3)
+        }
+
+        if ($data['is_svip'] == 3){
+            @file_put_contents('quanju3.txt',"-测试12\r\n",8);
             $data['svip_endtime'] = date('Y-m-d H:i:s', strtotime("+100 year"));
+        }
 
+        @file_put_contents('quanju3.txt',"-测试13\r\n",8);
         $day = date('Y-m-d', time());
         $key = 'sign_' . $user['uid'] . '_' . $day;
         $data['sign_status'] = false;
+        @file_put_contents('quanju3.txt',"-测试14\r\n",8);
         if (Cache::get($key)) {
             $data['sign_status'] = true;
         } else {
@@ -236,36 +253,46 @@ class Auth extends BaseController
                 Cache::set($key, true, new \DateTime($day . ' 23:59:59'));
             }
         }
+        @file_put_contents('quanju3.txt',"-测试15\r\n",8);
         $data['staff_mer'] = $data['staffs'] ? array_column($data['staffs'], 'mer_id') : [];
         $data['oil_level_name']='无';
+        @file_put_contents('quanju3.txt',"-测试16\r\n",8);
         if ($data['oil_level']>0){
             $data['oil_level_name']=OilLevel::where('id',$data['oil_level'])->value('name');
         }
         $data['gift_level_name'] = '无';
+        @file_put_contents('quanju3.txt',"-测试17\r\n",8);
         if ($data['gift_level'] > 0) {
             $data['gift_level_name'] = GiftLevel::where('id', $data['gift_level'])->value('name');
         }
         $data['brokerage_price'] = \app\common\model\user\User::where('uid', $user['uid'])->value('brokerage_price');
-
+        @file_put_contents('quanju3.txt',"-测试18\r\n",8);
         $integral_prcie =app()->make(AwardIntegralPriceRepository::class)->awardIntegralPrice();
         $data['integral_prcie'] =$integral_prcie['price'];
         $UserRepository = app()->make(UserRepository::class);
+        @file_put_contents('quanju3.txt',"-测试19\r\n",8);
         $UserRepository->checkAward($user['uid']);
+        @file_put_contents('quanju3.txt',"-测试20\r\n",8);
         $GiftLevel = app()->make(GiftLevel::class);
         $group_users = $GiftLevel->get_group_user($user['uid']);
+        @file_put_contents('quanju3.txt',"-测试21\r\n",8);
         $achievement1 = StoreOrder::where('uid','in', $group_users)->where('paid', 1)->where('product_type',2)->whereNotIn('status',-1)->sum('pay_price');
         $achievement2 = StoreOrder::where('uid', $user['uid'])->where('paid', 1)->where('product_type',2)->whereNotIn('status',-1)->sum('pay_price');
+        @file_put_contents('quanju3.txt',"-测试22\r\n",8);
         $gift_performance = bcadd($achievement1, $achievement2, 2);
         if ($gift_performance>0){
             $data['gift_performance'] = $gift_performance;
         }
+        @file_put_contents('quanju3.txt',"-测试23\r\n",8);
         $achievement1 = StoreOrder::where('uid', 'in',$group_users)->where('paid', 1)->where('product_type',1)->whereNotIn('status',-1)->sum('pay_price');
         $achievement2 = StoreOrder::where('uid', $user['uid'])->where('paid', 1)->where('product_type',1)->whereNotIn('status',-1)->sum('pay_price');
         $oil_performance = bcadd($achievement1, $achievement2, 2);
+        @file_put_contents('quanju3.txt',"-测试24\r\n",8);
         if ($oil_performance>0){
             $data['oil_performance'] = $oil_performance;
         }
         $data['integral_value'] = bcmul($data['award_integral'],$data['integral_prcie'],2);
+        @file_put_contents('quanju3.txt',"-测试25\r\n",8);
         $data['user_extract_min'] = systemConfig('user_extract_min');
         return app('json')->success($data);
     }