QAndASetting.php 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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. /**
  11. * This is the model class for table "{{%q_and_a_setting}}".
  12. *
  13. * @property int $id
  14. * @property int $store_id
  15. * @property int $q_integral
  16. * @property string $rule
  17. * @property int $updated_at
  18. * @property string $key
  19. * @property string $appid
  20. */
  21. class QAndASetting extends \yii\db\ActiveRecord
  22. {
  23. /**
  24. * {@inheritdoc}
  25. */
  26. public static function tableName()
  27. {
  28. return '{{%q_and_a_setting}}';
  29. }
  30. public function behaviors()
  31. {
  32. return [
  33. [
  34. 'class' => TimestampBehavior::class,
  35. 'attributes' => [
  36. ActiveRecord::EVENT_BEFORE_INSERT => ['updated_at'],
  37. ActiveRecord::EVENT_BEFORE_UPDATE => 'updated_at'
  38. ]
  39. ]
  40. ];
  41. }
  42. /**
  43. * {@inheritdoc}
  44. */
  45. public function rules()
  46. {
  47. return [
  48. [['store_id', 'q_integral', 'rule', 'key', 'appid'], 'required'],
  49. [['store_id', 'q_integral', 'updated_at'], 'safe']
  50. ];
  51. }
  52. /**
  53. * {@inheritdoc}
  54. */
  55. public function attributeLabels()
  56. {
  57. return [
  58. 'id' => 'ID',
  59. 'store_id' => 'Store ID',
  60. 'q_integral' => '问题消耗积分',
  61. 'rule' => '规则说明',
  62. 'updated_at' => 'Update Time',
  63. 'key' => 'key',
  64. 'appid' => 'appid',
  65. ];
  66. }
  67. }