LinkCase.php 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <?php
  2. namespace App\Http\Models;
  3. use App\Http\Traits\ModelBoost;
  4. use Illuminate\Database\Eloquent\Model;
  5. use Illuminate\Database\Eloquent\SoftDeletes;
  6. class LinkCase extends Model
  7. {
  8. use SoftDeletes, ModelBoost;
  9. protected $table = 'link_case';
  10. protected $primaryKey = 'id';
  11. protected $guarded = [];
  12. public function getTypeTitleAttribute()
  13. {
  14. $typeList = array_column(self::TYPES, null, 'inx');
  15. return $typeList[$this->type ?? 0]['val'] ?? '';
  16. }
  17. const TYPES = [
  18. 1 => 'PDF',
  19. 2 => 'B2B',
  20. 3 => '书签',
  21. 4 => '一次性',
  22. 5 => '图片',
  23. 6 => 'SNS',
  24. 7 => '论坛',
  25. 8 => 'Blog',
  26. 9 => '信息页',
  27. /* 10 => '网址提交',
  28. 11 => '分享',*/
  29. 12 => '重点外链',
  30. /* 13 => '网站提交',
  31. 14 => '博客',
  32. 15 => '图片分享',
  33. 16 => '一次性注册',
  34. 17 => 'minisite',
  35. 18 => 'forum',
  36. 19 => '社交',
  37. 20 => '网址提交分析',
  38. 21 => '视频',
  39. 22 => '问答',
  40. 23 => 'blogger'*/
  41. ];
  42. }