This commit is contained in:
2025-12-24 16:59:05 +08:00
parent b52a51c09b
commit b68946fe79
218 changed files with 10790 additions and 3878 deletions
+17 -3
View File
@@ -75,9 +75,18 @@ class Archives extends Base
public function getCategoryOptions($type='default'){
return Category::where('status','1')->where('type',$type)->column('id,title');
}
function setCreatedAtAttr($v,$row=[]){
cp($v);
cp($row);
function setCreatedAtAttr($v){
if($v && strpos($v,'-')){
return strtotime($v);
}
return $v;
}
function setUpdatedAtAttr($v){
if($v && strpos($v,'-')){
return strtotime($v);
}
return $v;
}
@@ -86,6 +95,11 @@ class Archives extends Base
return Config('site.flagtype');
}
public function content()
{
return $this->hasOne('content', 'id', 'id');
// ->bind(['content']);//->setEagerlyType(0);
}
public function category()
{
return $this->belongsTo('Category', 'category_id', 'id');//->setEagerlyType(0);