Browse Source

vip过期的计划任务

lizhen_gitee 1 year ago
parent
commit
cd72a31568

+ 18 - 0
application/api/controller/Baseconfig.php

@@ -98,4 +98,22 @@ class Baseconfig extends Api
         $this->success('success',$config);
     }
 
+    //好评有礼
+    public function app_comment(){
+        $images = input('images','');
+        $platform = input('platform','android');
+
+        $data = [
+            'user_id' => $this->auth->id,
+            'images'  => $images,
+            'status'  => 0,
+            'platform'  => $platform,
+            'createtime'  => time(),
+            'updatetime'  => time(),
+        ];
+
+        Db::name('app_comment')->insertGetId($data);
+        $this->success();
+    }
+
 }

+ 4 - 16
application/api/controller/Index.php

@@ -17,23 +17,11 @@ class Index extends Api
         exit;
     }
 
-    //好评有礼
-    public function app_comment(){
-        $images = input('images','');
-        $platform = input('platform','android');
-
-        $data = [
-            'user_id' => $this->auth->id,
-            'images'  => $images,
-            'status'  => 0,
-            'platform'  => $platform,
-            'createtime'  => time(),
-            'updatetime'  => time(),
-        ];
-
-        Db::name('app_comment')->insertGetId($data);
-        $this->success();
+    public function fujin(){
+        //是vip,且开启了隐身的,不能在内
+
     }
+    public function tuijian(){}
 
 
     /**

+ 7 - 1
application/index/controller/Plantask.php

@@ -18,11 +18,17 @@ class Plantask extends Controller
     }
 
     //定时跑用户活跃,改成离线
-    public function user_active(){
+    public function auto_user_active(){
         $actitime = time() - 600;
 
         $sql = 'update `mt_user` set is_active = 0 where id in (select user_id from mt_user_active where requesttime < '.$actitime.')';
         db()->query($sql);
     }
 
+    //vip过期的,三个隐私设置改成0
+    public function auto_vipend(){
+        $sql = 'update `mt_user_power` set yinsi = 0,yinshen = 0,wuhen = 0 where user_id in (select user_id from mt_user_wallet where vip_endtime < '.time().')';
+        db()->query($sql);
+    }
+
 }