...
|
...
|
@@ -10,6 +10,7 @@ use think\Config; |
|
|
use app\common\model\Attachment;
|
|
|
use addons\qiniu\library\Auth;
|
|
|
use think\Db;
|
|
|
|
|
|
/**
|
|
|
* 公共接口
|
|
|
*/
|
...
|
...
|
@@ -177,18 +178,19 @@ class Common extends Api |
|
|
//每天清空日搜索
|
|
|
public function delete_day_so()
|
|
|
{
|
|
|
$beginToday=mktime(0,0,0,date('m'),date('d'),date('Y'));
|
|
|
$map = [];
|
|
|
$beginToday = mktime(0, 0, 0, date('m'), date('d'), date('Y'));
|
|
|
$map['createtime'] = array('LT', 1594956500);
|
|
|
// Db::name('so_level_day')->where(['createtime','<',$beginToday])->delete();
|
|
|
Db::name('so_level_day')->where(['createtime','<',1594955300])->delete();
|
|
|
Db::name('so_level_day')->where($map)->delete();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//每周清空周搜索
|
|
|
public function delete_month_so()
|
|
|
{
|
|
|
$beginWeek = mktime(0,0,0,date("m"),date("d")-date("w")+1,date("Y"));
|
|
|
Db::name('so_level_month')->where(['createtime','<',$beginWeek])->delete();
|
|
|
$map2 = [];
|
|
|
$beginWeek = mktime(0, 0, 0, date("m"), date("d") - date("w") + 1, date("Y"));
|
|
|
$map2['createtime'] = array('LT', $beginWeek);
|
|
|
Db::name('so_level_month')->where($map2)->delete();
|
|
|
}
|
|
|
} |
...
|
...
|
|