This commit is contained in:
parent
f5a7004ea3
commit
473868fd09
|
|
@ -21,7 +21,7 @@ class RegionController
|
|||
public function index()
|
||||
{
|
||||
$data = [
|
||||
'regions' => Region::query()->with('regionZones.zone')->get(),
|
||||
'regions' => RegionRepo::getList(),
|
||||
'countries' => CountryRepo::all()
|
||||
];
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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');
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue