123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990 |
- <?php
- namespace app\dao\other;
- use app\dao\BaseDao;
- use app\model\other\SystemCity;
- class SystemCityDao extends BaseDao
- {
-
- protected function setModel(): string
- {
- return SystemCity::class;
- }
-
- public function getCityList(array $where, string $field = '*')
- {
- return $this->search($where)->field($field)->select()->toArray();
- }
-
- public function getCityArray(array $where, string $field, string $key)
- {
- return $this->search($where)->column($field, $key);
- }
-
- public function deleteCity(int $cityId)
- {
- return $this->getModel()->where('city_id', $cityId)->whereOr('parent_id', $cityId)->delete();
- }
-
- public function getCityIdMax()
- {
- return $this->getModel()->max('city_id');
- }
-
- public function getShippingCity()
- {
- return $this->getModel()->with('children')->where('parent_id', 0)->order('id asc')->select()->toArray();
- }
- }
|