| 
									
										
										
										
											2021-11-18 17:57:04 +08:00
										 |  |  | <?php | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | namespace app\model; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-11-30 18:52:02 +08:00
										 |  |  | use think\model\relation\HasOne; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-11-18 17:57:04 +08:00
										 |  |  | class Business extends Base | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     const state_reviewing = 0; | 
					
						
							|  |  |  |     const state_on        = 1; | 
					
						
							|  |  |  |     const state_off       = 2; | 
					
						
							| 
									
										
										
										
											2021-11-30 18:31:58 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-11-30 18:52:02 +08:00
										 |  |  |     /** | 
					
						
							| 
									
										
										
										
											2021-12-02 10:49:50 +08:00
										 |  |  |      * @remarks 代理商、平台商、平台代理商、渠道商等词组均描述的是代理商,因此文案统一为【代理商】 | 
					
						
							| 
									
										
										
										
											2021-11-30 18:52:02 +08:00
										 |  |  |      */ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-11-24 14:41:24 +08:00
										 |  |  |     public function category() | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         return $this->hasOne(Category::class, 'id',"type"); | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2021-11-30 18:52:02 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-11-30 18:31:58 +08:00
										 |  |  |     public function account() | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         return $this->hasOne(Account::class, 'business_code',"code"); | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2021-12-02 10:49:50 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-12-01 16:53:44 +08:00
										 |  |  |     public function agency() | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         return $this->hasOne(self::class,"code","agency_code"); | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2021-12-02 10:41:02 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-11-18 17:57:04 +08:00
										 |  |  | } |