<?php
|
|
namespace app\common\model\supplier;
|
|
use app\common\model\BaseModel;
|
|
/**
|
* 模型
|
*/
|
class Area extends BaseModel
|
{
|
protected $name = 'supplier_area';
|
protected $pk = 'area_id';
|
|
/**
|
* 所有
|
* @return \think\Collection
|
* @throws \think\db\exception\DataNotFoundException
|
* @throws \think\db\exception\DbException
|
* @throws \think\db\exception\ModelNotFoundException
|
*/
|
public static function getALL()
|
{
|
$model = new static;
|
return $model->order(['sort' => 'asc', 'create_time' => 'asc'])->select();
|
}
|
/**
|
* 详情
|
*/
|
public static function detail($area_id)
|
{
|
return (new static())->find($area_id);
|
}
|
|
}
|