Activity.php 941 B

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. namespace App\Models;
  3. use Illuminate\Database\Eloquent\Model;
  4. use Illuminate\Database\Eloquent\SoftDeletes;
  5. class Activity extends Model
  6. {
  7. static $honor=['dlb'=>'大礼包','ryq'=>'荣誉墙','ly'=>'旅游','dlbc'=>'大礼包C','dlbd'=>'大礼包D'];
  8. static $levels=['3'=>'代理公司','2'=>'销售经理','1'=>'销售主管'];
  9. use SoftDeletes;
  10. protected $table='activity';
  11. protected $fillable = ['title','start_time','end_time','big_gift','honor_wall','is_ing','super_up','top_down','top_up','crown_down','contents','disabled'];
  12. public function gift()
  13. {
  14. return $this->hasMany('App\Models\Gifts','activity_id','id');
  15. }
  16. public function activity_limit_honor()
  17. {
  18. return $this->hasMany('App\Models\ActivityLimit','activity_id','id');
  19. }
  20. public function activity_limit_down()
  21. {
  22. return $this->hasMany('App\Models\ActivityLimit','activity_id','id');
  23. }
  24. }