|
@@ -9,6 +9,19 @@ use app\common\library\Tlssigapiv2;
|
|
|
|
|
|
class Plantask extends Controller
|
|
|
{
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ //定时跑用户活跃,改成离线。 一分钟一次
|
|
|
+ public function auto_user_active()
|
|
|
+ {
|
|
|
+ $start_time = time() - (3600 * 24);
|
|
|
+ $end_time = time() - (3600 * 2);
|
|
|
+ $sql = "update `mt_user` set is_active = 0 where is_active = 1 and id in (select user_id from mt_user_active where requesttime between {$start_time} and {$end_time})";
|
|
|
+ db()->query($sql);
|
|
|
+ }
|
|
|
+
|
|
|
+ ////////////////////////////////////////////////////////
|
|
|
//主动拉取im群组内 聊天记录。没用到
|
|
|
public function auto_imgroup(){
|
|
|
$im_config = config('tencent_im');
|
|
@@ -127,17 +140,6 @@ class Plantask extends Controller
|
|
|
echo '结束';
|
|
|
exit;
|
|
|
}
|
|
|
-
|
|
|
- //定时跑用户活跃,改成离线。 一分钟一次
|
|
|
- public function auto_user_active()
|
|
|
- {
|
|
|
- $start_time = time() - (3600 * 24);
|
|
|
- $end_time = time() - (3600 * 2);
|
|
|
- $sql = "update `mt_user` set is_active = 0 where is_active = 1 and id in (select user_id from mt_user_active where requesttime between {$start_time} and {$end_time})";
|
|
|
- db()->query($sql);
|
|
|
- }
|
|
|
-
|
|
|
- ////////////////////////////////////////////////////////
|
|
|
/////////////////////////////////////////下面都是工具方法////////////////////////////////////////////////
|
|
|
//下载远程文件 到指定目录
|
|
|
private function downloadfile($file_url, $path = '', $save_file_name = '')
|
|
@@ -324,5 +326,12 @@ class Plantask extends Controller
|
|
|
}
|
|
|
////////////////////////////////////////////////////////
|
|
|
|
|
|
+ private function error($msg){
|
|
|
+ echo $msg;exit;
|
|
|
+ }
|
|
|
+
|
|
|
+ private function success($msg){
|
|
|
+ echo $msg;exit;
|
|
|
+ }
|
|
|
|
|
|
}
|