VerifyCardAccount.php 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. <?php
  2. /**
  3. * 厦门云联储网络科技有限公司
  4. * https://www.baokuaiyun.com
  5. * Copyright (c) 2023 爆块云 All rights reserved.
  6. */
  7. namespace app\models;
  8. use yii\db\ActiveRecord;
  9. use yii\behaviors\TimestampBehavior;
  10. use Yii;
  11. /**
  12. * This is the model class for table "{{%verify_card_account}}".
  13. *
  14. * @property int $id
  15. * @property int $store_id
  16. * @property int $card_id 卡券id
  17. * @property string $account 账号
  18. * @property string $password 密码
  19. * @property int $status 状态,0=未使用,1=已使用
  20. * @property int $created_at 创建时间
  21. * @property int $updated_at 更新时间
  22. */
  23. class VerifyCardAccount extends \yii\db\ActiveRecord
  24. {
  25. /**
  26. * {@inheritdoc}
  27. */
  28. public static function tableName()
  29. {
  30. return '{{%verify_card_account}}';
  31. }
  32. const STATUS_UNUSED = 0; // 未使用
  33. const STATUS_USED = 1; // 已使用
  34. public function behaviors()
  35. {
  36. return [
  37. [
  38. 'class' => TimestampBehavior::class,
  39. 'attributes' => [
  40. ActiveRecord::EVENT_BEFORE_INSERT => ['updated_at', 'created_at'],
  41. ActiveRecord::EVENT_BEFORE_UPDATE => 'updated_at'
  42. ]
  43. ]
  44. ];
  45. }
  46. /**
  47. * {@inheritdoc}
  48. */
  49. public function rules()
  50. {
  51. return [
  52. [['store_id', 'card_id', 'account', 'password'], 'required'],
  53. [['store_id', 'card_id', 'status'], 'integer'],
  54. [['account', 'password'], 'string', 'max' => 60],
  55. ];
  56. }
  57. /**
  58. * {@inheritdoc}
  59. */
  60. public function attributeLabels()
  61. {
  62. return [
  63. 'id' => 'ID',
  64. 'store_id' => 'Store ID',
  65. 'card_id' => '卡券id',
  66. 'account' => '账号',
  67. 'password' => '密码',
  68. 'status' => '状态', // 0=未使用,1=已使用
  69. ];
  70. }
  71. }