4
This commit is contained in:
+17
-3
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user