This commit is contained in:
Edward Yang 2022-08-18 14:57:42 +08:00
parent f5a7004ea3
commit 473868fd09
3 changed files with 11 additions and 2 deletions

View File

@ -21,7 +21,7 @@ class RegionController
public function index()
{
$data = [
'regions' => Region::query()->with('regionZones.zone')->get(),
'regions' => RegionRepo::getList(),
'countries' => CountryRepo::all()
];

View File

@ -15,6 +15,11 @@ use Beike\Models\Region;
class RegionRepo
{
public static function getList()
{
return Region::query()->with('regionZones.zone')->get();
}
public static function createOrUpdate($data)
{
$id = $data['id'] ?? 0;

View File

@ -11,9 +11,13 @@
namespace Beike\Models;
use Carbon\Carbon;
use Illuminate\Database\Eloquent\Model;
class Base extends Model
{
protected function serializeDate(\DateTimeInterface $date): string
{
return Carbon::createFromFormat('Y-m-d H:i:s', $date)->format('Y-m-d H:i:s');
}
}