This commit is contained in:
MeSHard
2025-11-10 16:12:07 +08:00
parent 99f88bc53e
commit 94f7e83679
181 changed files with 15770 additions and 0 deletions

View File

@@ -0,0 +1,48 @@
<?php
declare (strict_types = 1);
namespace app\model;
use think\Model;
/**
* @mixin \think\Model
*/
class ChargeStation extends Model
{
public function searchChargeStationNameAttr($query, $value)
{
return $value ? $query->where('charge_station_name', 'like', '%'.$value.'%') : '';
}
public function searchStationTypeAttr($query, $value)
{
return $value ? $query->where('station_type', '=', $value) : '';
}
public function searchCityAttr($query, $value)
{
return $value ? $query->where('city', 'like', '%'.$value.'%') : '';
}
public function searchAreaAttr($query, $value)
{
return $value ? $query->where('area', 'like', '%'.$value.'%') : '';
}
public function searchStreetAttr($query, $value)
{
return $value ? $query->where('street', 'like', '%'.$value.'%') : '';
}
public function searchAddressAttr($query, $value)
{
return $value ? $query->where('address', 'like', '%'.$value.'%') : '';
}
public function searchPriceAttr($query, $value)
{
return $value ? $query->where('price', 'between', [intval($value),intval($value)+1]) : '';
}
}