35 lines
		
	
	
		
			729 B
		
	
	
	
		
			PHP
		
	
	
			
		
		
	
	
			35 lines
		
	
	
		
			729 B
		
	
	
	
		
			PHP
		
	
	
| <?php
 | |
| namespace app\model;
 | |
| 
 | |
| use think\Collection;
 | |
| use think\db\exception\DataNotFoundException;
 | |
| use think\db\exception\DbException;
 | |
| use think\db\exception\ModelNotFoundException;
 | |
| use think\Model;
 | |
| 
 | |
| /**
 | |
|  * 商圈
 | |
|  * Class BusinessCircle
 | |
|  * @package app\model
 | |
|  */
 | |
| class BusinessCircle extends Base
 | |
| {
 | |
|     /**
 | |
|      * 获取全部列表
 | |
|      *
 | |
|      * @return Disease[]|array|Collection
 | |
|      * @throws DataNotFoundException
 | |
|      * @throws DbException
 | |
|      * @throws ModelNotFoundException
 | |
|      */
 | |
|     public static function getList()
 | |
|     {
 | |
|         return self::field('id,name,sort')->order('id', 'desc')->select();
 | |
|     }
 | |
| 
 | |
|     public  static function onAfterInsert($obj)
 | |
|     {
 | |
|         $obj->sort = $obj->id;
 | |
|         $obj->save();
 | |
|     }
 | |
| } |