IntegralAppreciationCommunity.php 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. <?php
  2. /**
  3. * 重庆赤晓店信息科技有限公司
  4. * https://www.chixiaodian.com
  5. * Copyright (c) 2023 赤店商城 All rights reserved.
  6. */
  7. namespace app\models;
  8. use yii\db\ActiveRecord;
  9. use yii\behaviors\TimestampBehavior;
  10. /**
  11. * This is the model class for table "{{%integral_appreciation_community}}".
  12. *
  13. * @property integer $id
  14. * @property integer $store_id
  15. * @property integer $user_id
  16. * @property integer $type
  17. * @property float $integral
  18. * @property string $mobile
  19. * @property integer $status
  20. * @property integer $is_delete
  21. * @property string $created_at
  22. * @property string $updated_at
  23. */
  24. class IntegralAppreciationCommunity extends \yii\db\ActiveRecord
  25. {
  26. /**
  27. * 帖子类型:求购
  28. */
  29. const TYPE_BUY = 0;
  30. /**
  31. * 帖子类型:出售
  32. */
  33. const TYPE_SELL = 1;
  34. public static $typeArray = [
  35. self::TYPE_BUY => '求购',
  36. self::TYPE_SELL => '出售',
  37. ];
  38. /**
  39. * 状态:未审核
  40. */
  41. const STATUS_NO_APPLY = 0;
  42. /**
  43. * 状态:已审核
  44. */
  45. const STATUS_APPLY = 1;
  46. /**
  47. * 状态:已拒绝
  48. */
  49. const STATUS_REFUSE = 2;
  50. /**
  51. * 状态:已下线
  52. */
  53. // const STATUS_OFFLINE = 3;
  54. public static $statusArray = [
  55. self::STATUS_NO_APPLY => '未审核',
  56. self::STATUS_APPLY => '已通过',
  57. self::STATUS_REFUSE => '已拒绝',
  58. // self::STATUS_OFFLINE => '已下线',
  59. ];
  60. /**
  61. * {@inheritdoc}
  62. */
  63. public static function tableName()
  64. {
  65. return '{{%integral_appreciation_community}}';
  66. }
  67. public function behaviors()
  68. {
  69. return [
  70. [
  71. 'class' => TimestampBehavior::class
  72. ]
  73. ];
  74. }
  75. /**
  76. * {@inheritdoc}
  77. */
  78. public function rules()
  79. {
  80. return [
  81. [['id', 'store_id', 'user_id', 'type', 'status', 'is_delete'], 'integer'],
  82. [['integral', 'created_at', 'updated_at'], 'number'],
  83. [['mobile'], 'string']
  84. ];
  85. }
  86. /**
  87. * {@inheritdoc}
  88. */
  89. public function attributeLabels()
  90. {
  91. return [
  92. 'id' => '',
  93. 'store_id' => '店铺ID',
  94. 'user_id' => '用户ID',
  95. 'type' => '帖子类型:0=求购;1=出售;',
  96. 'integral' => '积分金额',
  97. 'mobile' => '联系方式',
  98. 'status' => '帖子状态:0=未审核;1=已审核;2=已下线;',
  99. 'is_delete' => '',
  100. 'created_at' => '',
  101. 'updated_at' => ''
  102. ];
  103. }
  104. }