Activity.php 1004 B

12345678910111213141516171819202122232425262728293031
  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'=>'旅游','dlba'=>'大礼包A-a','dlbb'=>'大礼包A-b','dlbc'=>'大礼包B-a','dlbd'=>'大礼包B-b','dlbe'=>'大礼包B-c'];
  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. }