33 lines
		
	
	
		
			669 B
		
	
	
	
		
			PHP
		
	
	
			
		
		
	
	
			33 lines
		
	
	
		
			669 B
		
	
	
	
		
			PHP
		
	
	
| <?php
 | |
| 
 | |
| namespace app\model;
 | |
| 
 | |
| use think\model\relation\HasOne;
 | |
| 
 | |
| class Business extends Base
 | |
| {
 | |
|     const state_reviewing = 0;
 | |
|     const state_on        = 1;
 | |
|     const state_off       = 2;
 | |
| 
 | |
|     /**
 | |
|      * @remarks 代理商、平台商、平台代理商、渠道商等词组均描述的是代理商,因此文案统一为【代理商】
 | |
|      */
 | |
| 
 | |
|     public function category()
 | |
|     {
 | |
|         return $this->hasOne(Category::class, 'id',"type");
 | |
|     }
 | |
| 
 | |
|     public function account()
 | |
|     {
 | |
|         return $this->hasOne(Account::class, 'business_code',"code");
 | |
|     }
 | |
| 
 | |
|     public function agency()
 | |
|     {
 | |
|         return $this->hasOne(self::class,"code","agency_code");
 | |
|     }
 | |
| 
 | |
| }
 |