AddonsRechargeLog.php 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. <?php
  2. namespace addons\Recharge\common\models;
  3. use common\models\user\User;
  4. use Yii;
  5. /**
  6. * This is the model class for table "{{%addons_recharge_log}}".
  7. *
  8. * @property int $id
  9. * @property int $mall_id
  10. * @property int $user_id
  11. * @property int $recharge_active_id 充值活动id
  12. * @property int $recharge_order_id 充值订单id
  13. * @property float $recharge_num 充值金额
  14. * @property int $give_score 赠送积分
  15. * @property float $give_balance 赠送余额
  16. * @property string $give_coupons 赠送优惠券
  17. * @property string|null $give_content 赠送内容文字描述
  18. * @property int $created_at
  19. * @property int $updated_at
  20. * @property float $give_condition
  21. */
  22. class AddonsRechargeLog extends \common\models\base\BaseActiveRecord
  23. {
  24. /**
  25. * {@inheritdoc}
  26. */
  27. public static function tableName()
  28. {
  29. return '{{%addons_recharge_log}}';
  30. }
  31. /**
  32. * {@inheritdoc}
  33. */
  34. public function rules()
  35. {
  36. return [
  37. [['mall_id', 'user_id', 'recharge_active_id', 'recharge_order_id', 'give_score', 'created_at', 'updated_at'], 'integer'],
  38. [['recharge_active_id'], 'required'],
  39. [['recharge_num', 'give_balance','give_condition'], 'number'],
  40. [['give_content'], 'string'],
  41. [['give_coupons'], 'safe'],
  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. 'recharge_active_id' => '充值活动id',
  54. 'recharge_order_id' => '充值订单id',
  55. 'recharge_num' => '充值金额',
  56. 'give_score' => '赠送积分',
  57. 'give_balance' => '赠送余额',
  58. 'give_coupons' => '赠送优惠券',
  59. 'give_content' => '赠送内容文字描述',
  60. 'created_at' => 'Created At',
  61. 'updated_at' => 'Updated At',
  62. ];
  63. }
  64. // 关联模型
  65. public function getUser()
  66. {
  67. return $this->hasOne(User::class, ['id' => 'user_id']);
  68. }
  69. }