Browse Source

个人中心的邀请

lizhen_gitee 11 months ago
parent
commit
92b39c3e4b

+ 8 - 9
application/api/controller/Userintro.php

@@ -5,7 +5,7 @@ namespace app\api\controller;
 use app\common\controller\Api;
 use think\Db;
 /**
- * 用户推荐
+ * 代理邀请中心
  */
 class Userintro extends Api
 {
@@ -15,8 +15,8 @@ class Userintro extends Api
 
     //生成我的视频海报
     //生成邀请码二维码图片
-    public function inviteimage() {
-        $params['text'] = config('h5register_url') . $this->auth->introcode;
+    public function introimage() {
+        $params['text'] = config('h5register_url') .'?intro_no='. $this->auth->introcode;
         $qrcode_service = \addons\qrcode\library\Service::qrcode($params);
 
         $qrcodePath = ROOT_PATH . 'public/uploads/hbplayer/'.date('Ymd');
@@ -24,7 +24,7 @@ class Userintro extends Api
             @mkdir($qrcodePath);
         }
         if (is_really_writable($qrcodePath)) {
-            $filename = $this->auth->introcode . '.png';
+            $filename = 'intro_'.$this->auth->introcode . '.png';
             $filePath = $qrcodePath .'/'. $filename;
             $qrcode_service->writeFile($filePath);
         }
@@ -34,7 +34,7 @@ class Userintro extends Api
 
     //生成视频分享海报
     public function shareposter() {
-        $inviteimage = $this->inviteimage();
+        $inviteimage = $this->introimage();
 
         $data = [
             [
@@ -71,9 +71,9 @@ class Userintro extends Api
         }
         $imgurl = $_SERVER["REQUEST_SCHEME"]."://".$_SERVER["HTTP_HOST"] . '/' . $imgurl;
 
-        echo '<html><body><img src="'.$imgurl.'"></body></html>';
+        //echo '<html><body><img src="'.$imgurl.'"></body></html>';
 
-        //$this->success('', $imgurl);
+        $this->success('', $imgurl);
     }
 
 
@@ -108,8 +108,7 @@ class Userintro extends Api
         $user_list = Db::name('user')->field('id,username,nickname,mobile,avatar,createtime')->where('intro_uid',$this->auth->id)->limit(3)->select();
 
         $rs = [
-            'introsite_activeinfo' => config('site.introsite_activeinfo'),
-            'introsite_introrule' => config('site.introsite_introrule'),
+
             'introcode' => $this->auth->introcode,
             'user_list' => $user_list,
             'money_sum_thisweek' => $money_sum_thisweek,

+ 112 - 0
application/api/controller/Userinvite.php

@@ -0,0 +1,112 @@
+<?php
+
+namespace app\api\controller;
+
+use app\common\controller\Api;
+use think\Db;
+/**
+ * 用户推荐
+ */
+class Userinvite extends Api
+{
+    protected $noNeedLogin = [];
+    protected $noNeedRight = ['*'];
+
+
+    //生成我的视频海报
+    //生成邀请码二维码图片
+    public function inviteimage() {
+        $params['text'] = config('h5register_url') .'?invite_no='. $this->auth->introcode;
+        $qrcode_service = \addons\qrcode\library\Service::qrcode($params);
+
+        $qrcodePath = ROOT_PATH . 'public/uploads/hbplayer/'.date('Ymd');
+        if (!is_dir($qrcodePath)) {
+            @mkdir($qrcodePath);
+        }
+        if (is_really_writable($qrcodePath)) {
+            $filename = 'invite_'.$this->auth->introcode . '.png';
+            $filePath = $qrcodePath .'/'. $filename;
+            $qrcode_service->writeFile($filePath);
+        }
+
+        return '/uploads/hbplayer/'.date('Ymd') .'/'. $filename;
+    }
+
+    //生成视频分享海报
+    public function shareposter() {
+        $inviteimage = $this->inviteimage();
+
+        $data = [
+            [
+                "left"=> "190px",
+                "top"=> "320px",
+                "type"=> "img",
+                "width"=> "110px",
+                "height"=> "110px",
+                "src"=> httpurllocal($inviteimage)//"https://metavision.oss-cn-hongkong.aliyuncs.com/uploads/20220615/f00cb545deb4c4e7296f444239d83e84.jpg"
+            ],
+
+        ];
+
+
+        $data = json_encode($data, 320);
+
+        $poster = [
+            'id' => $this->auth->id,
+            'title' => '珍友',
+            'waittext' => '您的专属海报正在拼命生成中,请等待片刻...',
+            'bg_image' => '/assets/img/posteruserbg.png',
+            'data' => $data,
+            'status' => 'normal',
+            'weigh' => 0,
+            'createtime' => 1653993709,
+            'updatetime' => 1653994259,
+        ];
+
+        $image = new \addons\poster\library\Image();
+        $imgurl = $image->createPosterImage($poster, $this->auth->getUser());
+
+        if (!$imgurl) {
+            $this->error('生成海报出错');
+        }
+        $imgurl = $_SERVER["REQUEST_SCHEME"]."://".$_SERVER["HTTP_HOST"] . '/' . $imgurl;
+
+        //echo '<html><body><img src="'.$imgurl.'"></body></html>';
+
+        $this->success('', $imgurl);
+    }
+
+
+    //我邀请的人列表
+    public function myinvite_list(){
+        $list = Db::name('user')->field('id,username,nickname,avatar,createtime')->where('invite_uid',$this->auth->id)->autopage()->select();
+        $list = list_domain_image($list,['avatar']);
+
+        $this->success('success',$list);
+    }
+
+    //邀请页多个信息
+    public function invitesite_info(){
+
+
+        //累计邀请人数
+        $invite_num      = Db::name('user')->where('invite_uid',$this->auth->id)->count();
+        //累计收益
+        $money_sum = Db::name('user_gold_log')->where(['user_id'=>$this->auth->id,'log_type'=>['IN','41,42']])->sum('change_value');
+
+        $rs = [
+            'invitesite_activeinfo' => config('site.invitesite_activeinfo'),
+            'introsite_introrule'  => config('site.introsite_introrule'),
+            'invite_recharge_rate' => config('site.invite_recharge_rate'),
+            'invite_takecash_rate' => config('site.invite_takecash_rate'),
+            'introcode'  => $this->auth->introcode,
+            'money_sum'  => $money_sum,
+            'invite_num' => $invite_num,
+            'invite_url'  => config('h5register_url') .'?invite_no='. $this->auth->introcode,
+        ];
+
+        $this->success('success',$rs);
+    }
+
+
+}

+ 1 - 1
application/config.php

@@ -354,7 +354,7 @@ return [
     'avatar_girl' => '/assets/img/avatar_girl.png',//默认女头像
     'pay_notify_url' => 'https://anxinlao.huxiukeji.cn',  //支付异步回调域名
     'domain_cdnurl' => 'https://anxinliao-1324465692.cos.ap-chongqing.myqcloud.com',//图片地址
-    'h5register_url' => 'https://kgeweb.huxiukeji.cn/?invite_no=',
+    'h5register_url' => 'https://kgeweb.huxiukeji.cn/',
 
     //开放平台的,不是小程序的
     'wxMiniProgram' => [

+ 4 - 4
application/extra/site.php

@@ -47,15 +47,15 @@ return array (
     'custom' => '自定义',
   ),
   'gift_plat_scale' => '50',
-  'introsite_activeinfo' => '好友充值1000金币可得350金币
+  'invitesite_activeinfo' => '好友充值1000金币可得350金币
 好友收益1000金币可得100金币',
   'introsite_introrule' => '通过海报分享或者链接分享方式注册用户,或直接通过用户绑定方式进行参与活动',
   'kefu_user_ids' => '536',
   'android_is_force' => '1',
   'android_apkUrl' => 'https://oss.tken.vip/apk/app-release102.apk',
-  'android_apkName' => 'TKEN1.0.2',
+  'android_apkName' => '1.0.0',
   'android_desc' => '修复已知问题,优化用户体验',
-  'android_versionCode' => '102',
+  'android_versionCode' => '1',
   'iso_is_force' => '1',
   'ios_downurl' => 'https://apps.apple.com/cn/app/tken/id6469298932',
   'iso_appname' => 'TKEN1.0.1',
@@ -104,7 +104,7 @@ return array (
   'recharge_c2a_rate' => '10',
   'recharge_d2c_rate' => '10',
   'shouyi_b2a_rate' => '10',
-  'shouyi_c2a_rate' => '10',
+  'shouyi_c2a_rate' => '20',
   'withdraw_min_price' => '100',
   'withdrawal_plat_bili' => '6.5',
   'agentjewel_to_money' => '10',

+ 4 - 4
application/extra/wallet.php

@@ -8,10 +8,10 @@ return [
 
         10 => '金币充值',//gold +
 
-        11 => '视频通话',//gold -
-        12 => '语音通话',//gold -
-        13 => '聊天',//gold -
-        14 => '赠送礼物',//gold -
+        11 => '视频通话',//gold -  ,jewel -
+        12 => '语音通话',//gold -  ,jewel -
+        13 => '聊天',   //gold -  ,jewel -
+        14 => '赠送礼物',//gold -  ,jewel -
 
 /////////////////////////////////////