ScoreExpansionLog.php 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. <?php
  2. namespace addons\ScoreExpansion\common\models;
  3. use common\models\user\User;
  4. use Yii;
  5. /**
  6. * This is the model class for table "qimall_addons_score_expansion_log".
  7. *
  8. * @property int $id
  9. * @property int $mall_id 商城id
  10. * @property int $user_id 用户id
  11. * @property string $point_type 积分类型
  12. * @property string $from_type 来原类型
  13. * @property float $point_num 积分数量
  14. * @property string $order_sn 订单编号
  15. * @property string $change_type 操作类型:add-增加,sub-减少
  16. * @property float $change_num 操作数量
  17. * @property float $after_num 变动后数量
  18. * @property string $source_table 来源表
  19. * @property int $source_table_id 操作来源业务id
  20. * @property int|null $status 状态,-1:失效,1:正常,2:冻结
  21. * @property string $desc 变动说明
  22. * @property int $created_at 创建时间
  23. * @property int $updated_at 修改时间
  24. */
  25. class ScoreExpansionLog extends \common\models\base\BaseActiveRecord
  26. {
  27. /**
  28. * {@inheritdoc}
  29. */
  30. public static function tableName()
  31. {
  32. return 'qimall_addons_score_expansion_log';
  33. }
  34. /**
  35. * {@inheritdoc}
  36. */
  37. public function rules()
  38. {
  39. return [
  40. [['mall_id', 'user_id', 'point_type', 'from_type', 'order_sn', 'change_type', 'source_table', 'source_table_id'], 'required'],
  41. [['mall_id', 'user_id', 'source_table_id', 'status', 'created_at', 'updated_at'], 'integer'],
  42. [['point_num', 'change_num', 'after_num'], 'number'],
  43. [['from_type', 'order_sn', 'source_table', 'desc'], 'string', 'max' => 255],
  44. [['change_type'], 'string', 'max' => 12],
  45. ];
  46. }
  47. /**
  48. * {@inheritdoc}
  49. */
  50. public function attributeLabels()
  51. {
  52. return [
  53. 'id' => 'ID',
  54. 'mall_id' => 'Mall ID',
  55. 'user_id' => 'User ID',
  56. 'point_type' => 'Point Type',
  57. 'from_type' => 'From Type',
  58. 'point_num' => 'Point Num',
  59. 'order_sn' => 'Order Sn',
  60. 'change_type' => 'Change Type',
  61. 'change_num' => 'Change Num',
  62. 'after_num' => 'After Num',
  63. 'source_table' => 'Source Table',
  64. 'source_table_id' => 'Source Table ID',
  65. 'status' => 'Status',
  66. 'desc' => 'Desc',
  67. 'created_at' => 'Created At',
  68. 'updated_at' => 'Updated At',
  69. ];
  70. }
  71. /**
  72. * 关联用户信息
  73. * @DateTime: 2023/2/28 0018 9:56
  74. * @Copyright: copyright (c) 2021 广东七件事集团
  75. * @return \yii\db\ActiveQuery
  76. */
  77. public function getUser()
  78. {
  79. return $this->hasOne(User::class, ['id' => 'user_id']);
  80. }
  81. }