StoreCouponRewardLog.php 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. <?php
  2. namespace addons\Store\common\models;
  3. use common\models\base\BaseActiveRecord;
  4. use Yii;
  5. /**
  6. * This is the model class for table "qimall_addons_store_coupon_reward_log".
  7. *
  8. * @property int $id
  9. * @property int $mall_id
  10. * @property int $user_id
  11. * @property int $store_id 门店id
  12. * @property int $coupon_id 优惠券id
  13. * @property float $reward_number 奖励数额
  14. * @property int $reward_scenarios 奖励场景,1:转赠奖励,2:使用奖励
  15. * @property int $reward_type 奖励类型,1:余额,2:红包,3:积分,4:系统虚拟货币
  16. * @property string $reward_type_code 奖励类型代码,balance:余额,red_packet:红包,score:积分,如果是虚拟货币,则记录其 code
  17. * @property string $source_table 数据来源表
  18. * @property int $source_id 数据来源id
  19. * @property int $created_at 创建时间
  20. * @property int $updated_at
  21. */
  22. class StoreCouponRewardLog extends BaseActiveRecord
  23. {
  24. /**
  25. * {@inheritdoc}
  26. */
  27. public static function tableName()
  28. {
  29. return '{{%addons_store_coupon_reward_log}}';
  30. }
  31. /**
  32. * {@inheritdoc}
  33. */
  34. public function rules()
  35. {
  36. return [
  37. [['mall_id', 'user_id', 'store_id', 'coupon_id'], 'required'],
  38. [['mall_id', 'user_id', 'store_id', 'coupon_id', 'reward_scenarios', 'reward_type', 'source_id', 'created_at', 'updated_at'], 'integer'],
  39. [['reward_number'], 'number'],
  40. [['reward_type_code'], 'string', 'max' => 20],
  41. [['source_table'], 'string', 'max' => 255],
  42. ];
  43. }
  44. /**
  45. * {@inheritdoc}
  46. */
  47. public function attributeLabels()
  48. {
  49. return [
  50. 'id' => 'ID',
  51. 'mall_id' => 'Mall ID',
  52. 'user_id' => 'User ID',
  53. 'store_id' => 'Store ID',
  54. 'coupon_id' => 'Coupon ID',
  55. 'reward_number' => 'Reward Number',
  56. 'reward_scenarios' => 'Reward Scenarios',
  57. 'reward_type' => 'Reward Type',
  58. 'reward_type_code' => 'Reward Type Code',
  59. 'source_table' => 'Source Table',
  60. 'source_id' => 'Source ID',
  61. 'created_at' => 'Created At',
  62. 'updated_at' => 'Updated At',
  63. ];
  64. }
  65. }