Browse Source

一些个人中心和商品等接口

lizhen_gitee 1 year ago
parent
commit
2811284ec5

+ 3 - 1
addons/unishop/controller/Product.php

@@ -107,7 +107,9 @@ class Product extends Base
             ->field('u.username,u.avatar,e.*')
             ->order(['toptime' => 'desc', 'createtime' => 'desc'])->limit(2)->select();
         if ($evaluate) {
-            $data->evaluate_list = collection($evaluate)->append(['createtime_text'])->toArray();
+            $evaluate_list = collection($evaluate)->append(['createtime_text'])->toArray();
+
+            $data->evaluate_list = list_domain_image($evaluate_list,['images']);
         }
         $data = $data->append(['images_text', 'spec_list', 'spec_table_list'])->toArray();
 

+ 1 - 5
application/api/controller/Baseconfig.php

@@ -16,11 +16,7 @@ class Baseconfig extends Api
     public function index(){
 
         $config = [
-//            'android_update_num'     => config('site.android_update_num'),
-//            'android_update_version' => config('site.android_update_version'),
-//            'ios_update_num'         => config('site.ios_update_num'),
-//            'ios_update_version'     => config('site.ios_update_version'),
-            'comment_for_gold_switch'     => config('site.comment_for_gold_switch'),//好评有礼开关
+            'contactus'     => config('site.contactus'),//联系客服
         ];
 
         $this->success('success',$config);

+ 8 - 0
application/api/controller/Usercenter.php

@@ -13,6 +13,14 @@ class Usercenter extends Api
     protected $noNeedLogin = [];
     protected $noNeedRight = '*';
 
+    //我的下级
+    public function myintro(){
+        $list = Db::name('user')->field('id,nickname,avatar,jointime')->where('intro_uid',$this->auth->id)->autopage()->order('id desc')->select();
+        $list = list_domain_image($list,['avatar']);
+
+        $this->success(1,$list);
+    }
+
     //生成我的视频海报
     //生成邀请码二维码图片
     public function inviteimage($introcode) {

+ 4 - 1
application/common/library/Auth.php

@@ -410,7 +410,10 @@ class Auth
 
         //追加
         $userinfo['avatar'] = one_domain_image($userinfo['avatar']);
-        $userinfo['score'] = model('wallet')->getWallet($this->id,'score');
+        $userinfo['score'] = model('wallet')->getWallet($this->id,'score');//积分
+        $userinfo['withdraw_score'] = Db::name('user_withdraw')->where('user_id',$this->id)->where('status',1)->sum('score');//已兑换积分
+        $userinfo['share_score'] = Db::name('user_score_log')->where('user_id',$this->id)->where('log_type',1)->sum('change_value');//分享奖励
+        $userinfo['intro_number'] = Db::name('user')->where('intro_uid',$this->id)->count('id');//我的粉丝
 
         return $userinfo;
     }

+ 2 - 2
application/extra/site.php

@@ -40,7 +40,7 @@ return array (
     'category2' => '分类二',
     'custom' => '自定义',
   ),
-  'withdrawal_service_fee' => '2',
-  'min_withdrawal_money' => '0.3',
+  'min_withdrawal_money' => '1',
   'max_withdrawal_money' => '1000000',
+  'contactus' => '400123456',
 );