| 
									
										
										
										
											2020-11-25 09:07:06 +08:00
										 |  |  | <?php | 
					
						
							|  |  |  | namespace app\model; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class Model extends Base  | 
					
						
							|  |  |  | { | 
					
						
							| 
									
										
										
										
											2020-12-03 13:47:57 +08:00
										 |  |  |     const ARTICLE = 31; | 
					
						
							|  |  |  |     const PAGE = 33; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-11-25 09:07:06 +08:00
										 |  |  |     //获取模型列表
 | 
					
						
							|  |  |  |     public static function getList() | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         return self::order('sort asc') | 
					
						
							|  |  |  |         ->select() | 
					
						
							|  |  |  |         ->toArray(); | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |     public static function onAfterInsert($model) | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         $model->sort = $model->id; | 
					
						
							|  |  |  |         $model->save(); | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | } |