|
@@ -205,45 +205,28 @@ class Auth extends BaseController
|
|
|
*/
|
|
*/
|
|
|
public function userInfo()
|
|
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']);
|
|
$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']);
|
|
$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();
|
|
$data = $user->toArray();
|
|
|
- @file_put_contents('quanju3.txt',"-测试4\r\n",8);
|
|
|
|
|
$data['total_consume'] = $user['pay_price'];
|
|
$data['total_consume'] = $user['pay_price'];
|
|
|
- @file_put_contents('quanju3.txt',"-测试5\r\n",8);
|
|
|
|
|
$promoter = get_extension_info($user);
|
|
$promoter = get_extension_info($user);
|
|
|
- @file_put_contents('quanju3.txt',"-测试6\r\n",8);
|
|
|
|
|
$promoter['isShow'] = false;
|
|
$promoter['isShow'] = false;
|
|
|
if ($promoter['isPromoter']) {
|
|
if ($promoter['isPromoter']) {
|
|
|
$promoter['isShow'] = true;
|
|
$promoter['isShow'] = true;
|
|
|
- @file_put_contents('quanju3.txt',"-测试7\r\n",8);
|
|
|
|
|
} else {
|
|
} else {
|
|
|
if (!in_array($promoter['promoter_type'],[1,2])) {
|
|
if (!in_array($promoter['promoter_type'],[1,2])) {
|
|
|
- @file_put_contents('quanju3.txt',"-测试8\r\n",8);
|
|
|
|
|
$promoter['isShow'] = true;
|
|
$promoter['isShow'] = true;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- @file_put_contents('quanju3.txt',"-测试9\r\n",8);
|
|
|
|
|
$data['promoter'] = $promoter;
|
|
$data['promoter'] = $promoter;
|
|
|
- @file_put_contents('quanju3.txt',"-测试10\r\n",8);
|
|
|
|
|
- if (systemConfig('member_status')){
|
|
|
|
|
- @file_put_contents('quanju3.txt',"-11\r\n",8);
|
|
|
|
|
|
|
+ if (systemConfig('member_status'))
|
|
|
$data['member_icon'] = $this->request->userInfo()->member->brokerage_icon ?? '';
|
|
$data['member_icon'] = $this->request->userInfo()->member->brokerage_icon ?? '';
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- if ($data['is_svip'] == 3){
|
|
|
|
|
- @file_put_contents('quanju3.txt',"-测试12\r\n",8);
|
|
|
|
|
|
|
+ if ($data['is_svip'] == 3)
|
|
|
$data['svip_endtime'] = date('Y-m-d H:i:s', strtotime("+100 year"));
|
|
$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());
|
|
$day = date('Y-m-d', time());
|
|
|
$key = 'sign_' . $user['uid'] . '_' . $day;
|
|
$key = 'sign_' . $user['uid'] . '_' . $day;
|
|
|
$data['sign_status'] = false;
|
|
$data['sign_status'] = false;
|
|
|
- @file_put_contents('quanju3.txt',"-测试14\r\n",8);
|
|
|
|
|
if (Cache::get($key)) {
|
|
if (Cache::get($key)) {
|
|
|
$data['sign_status'] = true;
|
|
$data['sign_status'] = true;
|
|
|
} else {
|
|
} else {
|
|
@@ -253,46 +236,36 @@ class Auth extends BaseController
|
|
|
Cache::set($key, true, new \DateTime($day . ' 23:59:59'));
|
|
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['staff_mer'] = $data['staffs'] ? array_column($data['staffs'], 'mer_id') : [];
|
|
|
$data['oil_level_name']='无';
|
|
$data['oil_level_name']='无';
|
|
|
- @file_put_contents('quanju3.txt',"-测试16\r\n",8);
|
|
|
|
|
if ($data['oil_level']>0){
|
|
if ($data['oil_level']>0){
|
|
|
$data['oil_level_name']=OilLevel::where('id',$data['oil_level'])->value('name');
|
|
$data['oil_level_name']=OilLevel::where('id',$data['oil_level'])->value('name');
|
|
|
}
|
|
}
|
|
|
$data['gift_level_name'] = '无';
|
|
$data['gift_level_name'] = '无';
|
|
|
- @file_put_contents('quanju3.txt',"-测试17\r\n",8);
|
|
|
|
|
if ($data['gift_level'] > 0) {
|
|
if ($data['gift_level'] > 0) {
|
|
|
$data['gift_level_name'] = GiftLevel::where('id', $data['gift_level'])->value('name');
|
|
$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');
|
|
$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();
|
|
$integral_prcie =app()->make(AwardIntegralPriceRepository::class)->awardIntegralPrice();
|
|
|
$data['integral_prcie'] =$integral_prcie['price'];
|
|
$data['integral_prcie'] =$integral_prcie['price'];
|
|
|
$UserRepository = app()->make(UserRepository::class);
|
|
$UserRepository = app()->make(UserRepository::class);
|
|
|
- @file_put_contents('quanju3.txt',"-测试19\r\n",8);
|
|
|
|
|
$UserRepository->checkAward($user['uid']);
|
|
$UserRepository->checkAward($user['uid']);
|
|
|
- @file_put_contents('quanju3.txt',"-测试20\r\n",8);
|
|
|
|
|
$GiftLevel = app()->make(GiftLevel::class);
|
|
$GiftLevel = app()->make(GiftLevel::class);
|
|
|
$group_users = $GiftLevel->get_group_user($user['uid']);
|
|
$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');
|
|
$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');
|
|
$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);
|
|
$gift_performance = bcadd($achievement1, $achievement2, 2);
|
|
|
if ($gift_performance>0){
|
|
if ($gift_performance>0){
|
|
|
$data['gift_performance'] = $gift_performance;
|
|
$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');
|
|
$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');
|
|
$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);
|
|
$oil_performance = bcadd($achievement1, $achievement2, 2);
|
|
|
- @file_put_contents('quanju3.txt',"-测试24\r\n",8);
|
|
|
|
|
if ($oil_performance>0){
|
|
if ($oil_performance>0){
|
|
|
$data['oil_performance'] = $oil_performance;
|
|
$data['oil_performance'] = $oil_performance;
|
|
|
}
|
|
}
|
|
|
$data['integral_value'] = bcmul($data['award_integral'],$data['integral_prcie'],2);
|
|
$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');
|
|
$data['user_extract_min'] = systemConfig('user_extract_min');
|
|
|
return app('json')->success($data);
|
|
return app('json')->success($data);
|
|
|
}
|
|
}
|