| 
									
										
										
										
											2021-11-29 14:00:37 +08:00
										 |  |  | <?php | 
					
						
							|  |  |  | namespace app\model; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | use think\Collection; | 
					
						
							|  |  |  | use think\db\exception\DataNotFoundException; | 
					
						
							|  |  |  | use think\db\exception\DbException; | 
					
						
							|  |  |  | use think\db\exception\ModelNotFoundException; | 
					
						
							| 
									
										
										
										
											2021-11-29 17:32:48 +08:00
										 |  |  | use think\Model; | 
					
						
							| 
									
										
										
										
											2021-11-29 14:00:37 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | /** | 
					
						
							|  |  |  |  * 商圈 | 
					
						
							|  |  |  |  * Class BusinessCircle | 
					
						
							|  |  |  |  * @package app\model | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | class BusinessCircle extends Base | 
					
						
							|  |  |  | { | 
					
						
							| 
									
										
										
										
											2021-11-29 17:32:48 +08:00
										 |  |  |     /** | 
					
						
							|  |  |  |      * 获取全部列表 | 
					
						
							|  |  |  |      * | 
					
						
							|  |  |  |      * @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(); | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2021-11-29 14:00:37 +08:00
										 |  |  | } |