You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
672 B

<?php
/**
* Created by PhpStorm.
* User: Administrator
* Date: 10/5/2019
* Time: 1:48 PM
*/
namespace app\service;
class InfoForViewHistory
{
public static function add($user,$request,$page){
$time=time();
$data = [
'username'=>$user,
'ip'=>$request->ip(),
'view_url'=>'http://'.\think\Env::get('host.hostname').'/'.$request->url(),
'view_time'=>$time,
'view_page'=>$page,
];
$addInfo = \app\model\BaseViewHistory::create($data);
if ($addInfo){
return true;
}else {
return false;
}
}
}