| 12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- <?php
- namespace App\Models;
- use Illuminate\Database\Eloquent\Model;
- class AgentLevel extends Model
- {
- /**
- * 数据库连接名
- */
- protected $connection = 'mysql';
- /**
- * 与模型关联的表名
- */
- protected $table = 'webgame.agent_levels';
- /**
- * 可批量赋值的属性
- */
- protected $fillable = [
- 'level_name',
- 'level',
- 'required_referrals',
- 'commission_rate'
- ];
- /**
- * 表明模型是否应该被打上时间戳
- *
- * @var bool
- */
- public $timestamps = false;
- /**
- * 获取此级别的用户
- */
- public function users()
- {
- return $this->hasMany(AgentUserInfo::class, 'level', 'level');
- }
- }
|