2023-01-29 10:26:52 +08:00

39 lines
1.2 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
// +----------------------------------------------------------------------
// | 每日12点清0推广链接日数据统计 [ WE CAN DO IT JUST THINK IT ]
// +----------------------------------------------------------------------
namespace app\admin\controller;
use app\common\controller\Admin;
use think\Cache;
use think\Controller;
class Spreadtask extends Controller{
public function index(){
$data = db('tuiguang')->field('id')
->whereOr(['daypaynum'=>['neq',0]])
->whereOr(['dayregnum'=>['neq',0]])
->whereOr(['daymoney'=>['neq',0]])
->select();
$a=0;
$b=0;
foreach($data as $k=>$v){
$r = db('tuiguang')->where('id',$v['id'])->update([
'daypaynum'=>0,
'dayregnum'=>0,
'daymoney'=>0
]);
if($r){
$a++;
}else{
$b++;
}
}
db('applets_api')->where('wxid',0)->update(['number'=>1]);
$c = Cache::store('redis')->set('info-30',$info);
echo '成功推广链接:'.$a.' 失败条数:'.$b;
echo '更新30天数据成功'.$c;
}
}