作者 wangzhi

222

... ... @@ -9,8 +9,7 @@ use fast\Random;
use think\Config;
use app\common\model\Attachment;
use addons\qiniu\library\Auth;
use think\Db;
/**
* 公共接口
*/
... ... @@ -115,7 +114,7 @@ class Common extends Api
$sha1 = sha1_file($filePath);
$imagewidth = $imageheight = 0;
if (in_array($suffix, ['gif', 'jpg', 'jpeg', 'bmp', 'png', 'swf','pdf'])) {
if (in_array($suffix, ['gif', 'jpg', 'jpeg', 'bmp', 'png', 'swf', 'pdf'])) {
$imgInfo = getimagesize($splInfo->getPathname());
$imagewidth = isset($imgInfo[0]) ? $imgInfo[0] : $imagewidth;
$imageheight = isset($imgInfo[1]) ? $imgInfo[1] : $imageheight;
... ... @@ -173,4 +172,21 @@ class Common extends Api
}
return;
}
//每天清空日搜索
public function delete_day_so()
{
$beginToday=mktime(0,0,0,date('m'),date('d'),date('Y'));
// Db::name('so_level_day')->where(['createtime','<',$beginToday])->delete();
Db::name('so_level_day')->where(['createtime','<',1594955100])->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();
}
}
... ...