Mysql Support (#60)
This commit is contained in:
@@ -141,9 +141,10 @@ class Form extends Model
|
|||||||
return $this->views()->count() +
|
return $this->views()->count() +
|
||||||
$this->statistics()->sum(DB::raw("cast(data->>'views' as integer)"));
|
$this->statistics()->sum(DB::raw("cast(data->>'views' as integer)"));
|
||||||
} elseif(env('DB_CONNECTION') == 'mysql') {
|
} elseif(env('DB_CONNECTION') == 'mysql') {
|
||||||
return $this->views()->count() +
|
return (int)($this->views()->count() +
|
||||||
$this->statistics()->sum(DB::raw("json_extract(data, '$.views')")); // code to
|
$this->statistics()->sum(DB::raw("json_extract(data, '$.views')")));
|
||||||
}
|
}
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setDescriptionAttribute($value)
|
public function setDescriptionAttribute($value)
|
||||||
|
|||||||
Reference in New Issue
Block a user