mirror of https://github.com/1099438829/apeblog
修正更新自动时间戳
This commit is contained in:
parent
d7a0de97db
commit
d7df6222fe
|
|
@ -158,7 +158,7 @@ class Admin extends AuthController
|
||||||
$data['create_user'] = $this->adminId;
|
$data['create_user'] = $this->adminId;
|
||||||
$data['create_time'] = time();
|
$data['create_time'] = time();
|
||||||
$data['update_time'] = time();
|
$data['update_time'] = time();
|
||||||
aModel::insert($data);
|
aModel::create($data);
|
||||||
//添加前台用户
|
//添加前台用户
|
||||||
$userId = userModel::addAdminUser($data);
|
$userId = userModel::addAdminUser($data);
|
||||||
$res = aModel::update(['uid' => $userId], ['id' => $id]);
|
$res = aModel::update(['uid' => $userId], ['id' => $id]);
|
||||||
|
|
|
||||||
|
|
@ -129,7 +129,7 @@ class AdminAuth extends AuthController
|
||||||
if ($id == "") {
|
if ($id == "") {
|
||||||
$data['create_user'] = $this->adminId;
|
$data['create_user'] = $this->adminId;
|
||||||
$data['create_time'] = time();
|
$data['create_time'] = time();
|
||||||
$res = aModel::insert($data);
|
$res = aModel::create($data);
|
||||||
} else {
|
} else {
|
||||||
$data['update_user'] = $this->adminId;
|
$data['update_user'] = $this->adminId;
|
||||||
$data['update_time'] = time();
|
$data['update_time'] = time();
|
||||||
|
|
|
||||||
|
|
@ -103,7 +103,7 @@ class AdminRole extends AuthController
|
||||||
if ($id == "") {
|
if ($id == "") {
|
||||||
$data['create_user'] = $this->adminId;
|
$data['create_user'] = $this->adminId;
|
||||||
$data['create_time'] = time();
|
$data['create_time'] = time();
|
||||||
$res = rModel::insert($data);
|
$res = rModel::create($data);
|
||||||
} else {
|
} else {
|
||||||
$data['update_user'] = $this->adminId;
|
$data['update_user'] = $this->adminId;
|
||||||
$data['update_time'] = time();
|
$data['update_time'] = time();
|
||||||
|
|
|
||||||
|
|
@ -107,7 +107,7 @@ class Advert extends AuthController
|
||||||
$info = aModel::where("alias",$data['alias'])->find($id);
|
$info = aModel::where("alias",$data['alias'])->find($id);
|
||||||
if ($info) return app("json")->fail("标识已存在,请修改后重试");
|
if ($info) return app("json")->fail("标识已存在,请修改后重试");
|
||||||
$data['create_time'] = time();
|
$data['create_time'] = time();
|
||||||
$res = aModel::insert($data);
|
$res = aModel::create($data);
|
||||||
} else {
|
} else {
|
||||||
$data['update_time'] = time();
|
$data['update_time'] = time();
|
||||||
$res = aModel::update($data, ['id' => $id]);
|
$res = aModel::update($data, ['id' => $id]);
|
||||||
|
|
|
||||||
|
|
@ -73,7 +73,7 @@ class Category extends AuthController
|
||||||
if ($data['alias'] == "") $data['alias'] = get_rand_str(8);
|
if ($data['alias'] == "") $data['alias'] = get_rand_str(8);
|
||||||
if ($data['id'] == "") {
|
if ($data['id'] == "") {
|
||||||
$model = new aModel();
|
$model = new aModel();
|
||||||
$res = $model->insert($data);
|
$res = $model->create($data);
|
||||||
} else {
|
} else {
|
||||||
$res = aModel::update($data, ['id' => $data['id']]);
|
$res = aModel::update($data, ['id' => $data['id']]);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -110,10 +110,13 @@ class Index extends AuthController
|
||||||
//获取文章分类url
|
//获取文章分类url
|
||||||
$documentCategoryModel = new DocumentCategoryModel();
|
$documentCategoryModel = new DocumentCategoryModel();
|
||||||
$categoryInfo = $documentCategoryModel->field('id,alias,title,create_time')
|
$categoryInfo = $documentCategoryModel->field('id,alias,title,create_time')
|
||||||
->where('status', 1)->where('status', 1)
|
->where('status', 1)
|
||||||
->page($page, $pagesize)
|
->page($page, $pagesize)
|
||||||
->order('id desc')->select();
|
->order('id desc')->select();
|
||||||
foreach ($categoryInfo as $v) {
|
foreach ($categoryInfo as $v) {
|
||||||
|
echo $v['create_time'];
|
||||||
|
echo date("Y-m-d\TH:i:s+00:00",strtotime($v['create_time']));
|
||||||
|
echo strtotime($v['create_time']);die();
|
||||||
$str .= '<url>';
|
$str .= '<url>';
|
||||||
$str .= '<loc>' . url('index/article/lists',["id"=>$v["alias"]?:$v['id']],".html",$domain) . '</loc>';
|
$str .= '<loc>' . url('index/article/lists',["id"=>$v["alias"]?:$v['id']],".html",$domain) . '</loc>';
|
||||||
$str .= '<lastmod>' . date("Y-m-d\TH:i:s+00:00",strtotime($v['create_time'])) . '</lastmod>';
|
$str .= '<lastmod>' . date("Y-m-d\TH:i:s+00:00",strtotime($v['create_time'])) . '</lastmod>';
|
||||||
|
|
@ -129,6 +132,8 @@ class Index extends AuthController
|
||||||
->order('id desc')->select();
|
->order('id desc')->select();
|
||||||
|
|
||||||
foreach ($documentInfo as $v) {
|
foreach ($documentInfo as $v) {
|
||||||
|
echo date("Y-m-d\TH:i:s+00:00",strtotime($v['create_time']));
|
||||||
|
echo strtotime($v['create_time']);die();
|
||||||
$str .= '<url>';
|
$str .= '<url>';
|
||||||
$str .= '<loc>' . url('/index/article/detail',["id"=>$v["alias"]?:$v['id']],".html",$domain) . '</loc>';
|
$str .= '<loc>' . url('/index/article/detail',["id"=>$v["alias"]?:$v['id']],".html",$domain) . '</loc>';
|
||||||
$str .= '<lastmod>'.date("Y-m-d\TH:i:s+00:00",strtotime($v['create_time'])) .'</lastmod>';
|
$str .= '<lastmod>'.date("Y-m-d\TH:i:s+00:00",strtotime($v['create_time'])) .'</lastmod>';
|
||||||
|
|
|
||||||
|
|
@ -117,7 +117,7 @@ class Nav extends AuthController
|
||||||
if ($data['url'] == "") return app("json")->fail("链接不能为空");
|
if ($data['url'] == "") return app("json")->fail("链接不能为空");
|
||||||
if ($id == "") {
|
if ($id == "") {
|
||||||
$data['create_time'] = time();
|
$data['create_time'] = time();
|
||||||
$res = aModel::insert($data);
|
$res = aModel::create($data);
|
||||||
} else {
|
} else {
|
||||||
$data['update_time'] = time();
|
$data['update_time'] = time();
|
||||||
$res = aModel::update($data, ['id' => $id]);
|
$res = aModel::update($data, ['id' => $id]);
|
||||||
|
|
|
||||||
|
|
@ -185,7 +185,7 @@ class SystemConfig extends AuthController
|
||||||
if ($id == "") {
|
if ($id == "") {
|
||||||
$data['create_user'] = $this->adminId;
|
$data['create_user'] = $this->adminId;
|
||||||
$data['create_time'] = time();
|
$data['create_time'] = time();
|
||||||
$res = cModel::insert($data);
|
$res = cModel::create($data);
|
||||||
} else {
|
} else {
|
||||||
$data['update_user'] = $this->adminId;
|
$data['update_user'] = $this->adminId;
|
||||||
$data['update_time'] = time();
|
$data['update_time'] = time();
|
||||||
|
|
|
||||||
|
|
@ -95,7 +95,7 @@ class SystemConfigTab extends AuthController
|
||||||
if ($id == "") {
|
if ($id == "") {
|
||||||
$data['create_user'] = $this->adminId;
|
$data['create_user'] = $this->adminId;
|
||||||
$data['create_time'] = time();
|
$data['create_time'] = time();
|
||||||
$res = tModel::insert($data);
|
$res = tModel::create($data);
|
||||||
} else {
|
} else {
|
||||||
$data['update_user'] = $this->adminId;
|
$data['update_user'] = $this->adminId;
|
||||||
$data['update_time'] = time();
|
$data['update_time'] = time();
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,7 @@ class AdminNotify extends BaseModel
|
||||||
*/
|
*/
|
||||||
public static function addLog(array $data)
|
public static function addLog(array $data)
|
||||||
{
|
{
|
||||||
return self::insert($data);
|
return self::create($data);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,9 @@ class BaseModel extends Model
|
||||||
private static $transaction = 0;
|
private static $transaction = 0;
|
||||||
private static $DbInstance = [];
|
private static $DbInstance = [];
|
||||||
|
|
||||||
|
//自动时间戳
|
||||||
|
protected $autoWriteTimestamp = true;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取错误信息
|
* 获取错误信息
|
||||||
* @param string $defaultMsg
|
* @param string $defaultMsg
|
||||||
|
|
|
||||||
|
|
@ -87,15 +87,7 @@ class Document extends BaseModel
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新文件信息
|
* 更新文件信息
|
||||||
* @param $dat
|
* @param $date
|
||||||
* @param string $type
|
|
||||||
* @throws DataNotFoundException
|
|
||||||
* @throws DbException
|
|
||||||
* @throws ModelNotFoundException
|
|
||||||
*/
|
|
||||||
/**
|
|
||||||
* 更新文件信息
|
|
||||||
* @param $dat
|
|
||||||
* @param string $type
|
* @param string $type
|
||||||
* @throws DataNotFoundException
|
* @throws DataNotFoundException
|
||||||
* @throws DbException
|
* @throws DbException
|
||||||
|
|
|
||||||
|
|
@ -12,10 +12,6 @@ use app\common\model\UvLog as UvLogModel;
|
||||||
*/
|
*/
|
||||||
class PvLog extends BaseModel
|
class PvLog extends BaseModel
|
||||||
{
|
{
|
||||||
|
|
||||||
//自动时间戳
|
|
||||||
protected $autoWriteTimestamp = true;
|
|
||||||
|
|
||||||
public function del_data()
|
public function del_data()
|
||||||
{
|
{
|
||||||
//获取七天前日期
|
//获取七天前日期
|
||||||
|
|
|
||||||
|
|
@ -8,10 +8,6 @@ namespace app\common\model;
|
||||||
*/
|
*/
|
||||||
class UrlLog extends BaseModel
|
class UrlLog extends BaseModel
|
||||||
{
|
{
|
||||||
|
|
||||||
//自动时间戳
|
|
||||||
protected $autoWriteTimestamp = true;
|
|
||||||
|
|
||||||
//更新url_log
|
//更新url_log
|
||||||
public function set_url($title, $url)
|
public function set_url($title, $url)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,4 @@ namespace app\common\model;
|
||||||
*/
|
*/
|
||||||
class UvLog extends BaseModel
|
class UvLog extends BaseModel
|
||||||
{
|
{
|
||||||
|
|
||||||
//自动时间戳
|
|
||||||
protected $autoWriteTimestamp = true;
|
|
||||||
}
|
}
|
||||||
|
|
@ -409,7 +409,7 @@ CREATE TABLE `ape_document_category` (
|
||||||
-- Records of ape_document_category
|
-- Records of ape_document_category
|
||||||
-- ----------------------------
|
-- ----------------------------
|
||||||
BEGIN;
|
BEGIN;
|
||||||
INSERT INTO `ape_document_category` (`id`, `title`, `alias`, `icon`, `type`, `pid`, `sort`, `meta_title`, `keywords`, `description`, `status`, `template`, `link_str`, `view`, `create_time`, `update_time`) VALUES (1, '关于小站', '', '', 0, 0, 99, '关于小站', '关于小站,源码云,源码云博客,关于源码云博客', '源码云博客,源码云博客网站', 1, 'list_default.html', '', 80, 0, 1642089484);
|
INSERT INTO `ape_document_category` (`id`, `title`, `alias`, `icon`, `type`, `pid`, `sort`, `meta_title`, `keywords`, `description`, `status`, `template`, `link_str`, `view`, `create_time`, `update_time`) VALUES (1, '关于小站', '', '', 0, 0, 99, '关于小站', '关于小站,源码云,源码云博客,关于源码云博客', '源码云博客,源码云博客网站', 1, 'list_default.html', '', 80, 1642089484, 1642089484);
|
||||||
COMMIT;
|
COMMIT;
|
||||||
|
|
||||||
-- ----------------------------
|
-- ----------------------------
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue