PromoterQua.php 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. <?php
  2. /**
  3. * 厦门云联储网络科技有限公司
  4. * https://www.baokuaiyun.com
  5. * Copyright (c) 2023 爆块云 All rights reserved.
  6. */
  7. namespace app\models;
  8. use GuzzleHttp\Client;
  9. use Yii;
  10. use yii\behaviors\TimestampBehavior;
  11. use app\modules\admin\models\wechat_mp\CardForm;
  12. use app\utils\IotCloudHelper;
  13. use yii\redis\Cache;
  14. /**
  15. * This is the model class for table "{{%promoter_qua}}".
  16. *
  17. * @property integer $id
  18. * @property integer $qua_id
  19. * @property integer $cat_id
  20. * @property integer $brand_qua_id
  21. * @property integer $need_to_apply
  22. * @property integer $mandatory
  23. * @property string $created_at
  24. * @property string $updated_at
  25. * @property string $tips
  26. */
  27. class PromoterQua extends \yii\db\ActiveRecord
  28. {
  29. /**
  30. * @inheritdoc
  31. */
  32. public static function tableName()
  33. {
  34. return '{{%promoter_qua}}';
  35. }
  36. public function beforeSave($insert)
  37. {
  38. if (parent::beforeSave($insert)) {
  39. if ($this->isNewRecord) {
  40. $this->created_at = date('Y-m-d H:i:s');
  41. }else{
  42. $this->updated_at = date('Y-m-d H:i:s');
  43. }
  44. return true;
  45. }
  46. return false;
  47. }
  48. /**
  49. * @inheritdoc
  50. */
  51. public function rules()
  52. {
  53. return [
  54. [['id', 'qua_id','cat_id','brand_qua_id','mandatory'], 'integer'],
  55. [['tips'], 'string'],
  56. [['created_at','updated_at'], 'safe'],
  57. ];
  58. }
  59. /**
  60. * @inheritdoc
  61. */
  62. public function attributeLabels()
  63. {
  64. return [
  65. 'id' => 'ID',
  66. ];
  67. }
  68. }