feat : city
This commit is contained in:
@@ -8,6 +8,7 @@ use App\Constants\Admin\AuthCode;
|
||||
use Hyperf\Database\Model\Builder;
|
||||
use Hyperf\Database\Model\Collection;
|
||||
use Hyperf\DbConnection\Model\Model;
|
||||
use Hyperf\Tappable\HigherOrderTapProxy;
|
||||
|
||||
/**
|
||||
* @property int $id
|
||||
@@ -71,4 +72,13 @@ class AdminSection extends Model
|
||||
->get([['id','pid','name','status','remark']])
|
||||
->toArray();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @return int
|
||||
*/
|
||||
public function getCityById(int $id): int
|
||||
{
|
||||
return $this->where('id',$id)->value('city_id') ?? 0;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user