ReconsumePool.php 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. <?php
  2. namespace common\models;
  3. use common\helpers\Cache;
  4. use common\helpers\Date;
  5. use common\helpers\user\Info;
  6. use common\helpers\user\Status;
  7. use Yii;
  8. use yii\base\Exception;
  9. use yii\db\Expression;
  10. use common\libs\logging\operate\valueType\Config as ValueTypeConfig;
  11. /**
  12. * This is the model class for table "{{%RECONSUME_POOL}}".
  13. *
  14. * @property string $ID
  15. * @property string $USER_ID 会员ID
  16. * @property string $UNUSED_PV 未扣除PV
  17. * @property int $UNUSED_MONTH 未扣除月数
  18. * @property int $CREATED_AT 创建时间
  19. */
  20. class ReconsumePool extends \common\components\ActiveRecord
  21. {
  22. /**
  23. * @inheritdoc
  24. */
  25. public static function tableName()
  26. {
  27. return '{{%RECONSUME_POOL}}';
  28. }
  29. /**
  30. * @inheritdoc
  31. */
  32. public function rules()
  33. {
  34. return [
  35. [['USER_ID', 'CREATED_AT'], 'required'],
  36. [['UNUSED_PV'], 'number'],
  37. [['UNUSED_MONTH', 'CREATED_AT'], 'integer'],
  38. [['ID', 'USER_ID'], 'string', 'max' => 32],
  39. [['USER_ID'], 'unique'],
  40. [['ID'], 'unique'],
  41. ];
  42. }
  43. /**
  44. * @inheritdoc
  45. */
  46. public function attributeLabels()
  47. {
  48. return [
  49. 'ID' => 'ID',
  50. 'USER_ID' => '会员ID',
  51. 'UNUSED_PV' => '未扣除PV',
  52. 'UNUSED_MONTH' => '未扣除月数',
  53. 'CREATED_AT' => '创建时间',
  54. ];
  55. }
  56. /**
  57. * 操作日志记录条件
  58. * @return array
  59. */
  60. public function attrLabelsWithLogType(){
  61. return [
  62. 'USER_ID' => '会员ID',
  63. 'UNUSED_PV' => '未扣除PV',
  64. 'UNUSED_MONTH' => '未扣除月数',
  65. ];
  66. }
  67. }