AddonsCouponRewardLog.php 2.1 KB

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