Product.php 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <?php
  2. namespace App\Model;
  3. class Product extends UseScopeBaseModel
  4. {
  5. protected $table = "product"; //指定表
  6. const CREATED_AT = 'crt_time';
  7. const UPDATED_AT = 'upd_time';
  8. protected $dateFormat = 'U';
  9. const State_zero = 0;
  10. const State_one = 1;
  11. const State_two = 2;
  12. public static $state = [
  13. self::State_zero => '新增',
  14. self::State_one => '上架',
  15. self::State_two => '下架',
  16. ];
  17. const range_function = 'productRangeNot';
  18. const Product_attribute_zero = 0;
  19. const Product_attribute_one = 1;
  20. const Product_attribute_two = 2;
  21. const Product_attribute_three = 3;
  22. public static $product_attribute = [
  23. self::Product_attribute_zero => '无',
  24. self::Product_attribute_one => '其他',
  25. self::Product_attribute_two => '主推款',
  26. self::Product_attribute_three => '热卖款',
  27. ];
  28. public static $product_attribute_color = [
  29. self::Product_attribute_zero => [
  30. 'background_color' => 'white',
  31. 'font_color' => 'black',
  32. ],
  33. self::Product_attribute_one => [
  34. 'background_color' => 'white',
  35. 'font_color' => 'black',
  36. ],
  37. self::Product_attribute_two => [
  38. 'background_color' => 'white',
  39. 'font_color' => 'black',
  40. ],
  41. self::Product_attribute_three => [
  42. 'background_color' => 'white',
  43. 'font_color' => 'black',
  44. ],
  45. ];
  46. const is_use_zero = 0;
  47. const is_use_one = 1;
  48. public static $is_use = [
  49. self::is_use_zero => '停用',
  50. self::is_use_one => '启用',
  51. ];
  52. }