Browse Source

解锁喜欢我的人

lizhen_gitee 3 years ago
parent
commit
f4c7136473

+ 26 - 0
application/api/controller/Userlike.php

@@ -26,6 +26,32 @@ class Userlike extends Api
         $this->success('success',$list);
     }
 
+    //解锁喜欢我的人
+    public function unlock_like_me(){
+        $gold = intval(config('site.unlock_like_me'));
+        if($gold > 0){
+
+            Db::startTrans();
+            $rs = model('wallet')->lockChangeAccountRemain($this->auth->id,'gold',-$gold,62,'');
+            if($rs['status'] === false){
+                Db::rollback();
+                $this->error($rs['msg']);
+            }
+
+            //tag任务赠送金币
+            //消费解锁喜欢我的人
+            $task_rs = \app\common\model\TaskLog::tofinish($this->auth->id,17);
+            if($task_rs === false){
+                Db::rollback();
+                $this->error('完成任务赠送奖励失败');
+            }
+
+            Db::commit();
+            $this->success('success');
+        }
+        $this->success('success');
+    }
+
     //我喜欢的人列表
     public function my_like_list(){
         $list = Db::name('user_like')

+ 2 - 0
application/common/library/Auth.php

@@ -491,6 +491,8 @@ class Auth
         //签到天数
         $userinfo['sign_times'] = $check = Db::name('user_sign')->where('uid',$this->id)->order('id desc')->value('times');
 
+        //附上变量解锁喜欢我列表
+        $userinfo['unlock_like_me'] = config('site.unlock_like_me');
 
 
         return $userinfo;

+ 1 - 0
application/extra/site.php

@@ -59,4 +59,5 @@ return array (
   'gift_plat_scale' => '30',
   'usetask_avatar_gold' => '5',
   'usetask_follow_3user' => '3',
+  'unlock_like_me' => '38',
 );

+ 1 - 0
application/extra/wallet.php

@@ -24,6 +24,7 @@ return [
         52 => '他人赠送礼物',
 
         61 => '完成个人任务',
+        62 => '解锁喜欢我的人',
     ],
     'moneyname' => [
         'money'    => '余额',