PromoterTalent.php 1.8 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 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 "{{%account_log}}".
  16. *
  17. * @property integer $id
  18. * @property integer $store_id
  19. * @property integer $status
  20. * @property string $talent_appid
  21. * @property string $bind_time
  22. * @property string $talent_nickname
  23. * @property string $talent_head_img
  24. * @property string $related_finder_exportname_list
  25. * @property string $related_mp_biz_appid_list
  26. * @property string $created_at
  27. * @property string $updated_at
  28. */
  29. class PromoterTalent extends \yii\db\ActiveRecord
  30. {
  31. /**
  32. * @inheritdoc
  33. */
  34. public static function tableName()
  35. {
  36. return '{{%promoter_talent}}';
  37. }
  38. /**
  39. * @inheritdoc
  40. */
  41. public function rules()
  42. {
  43. return [
  44. [['store_id','status'], 'integer'],
  45. [['talent_appid', 'bind_time', 'talent_nickname', 'talent_head_img', 'related_finder_exportname_list','related_mp_biz_appid_list'], 'string'],
  46. [['created_at', 'updated_at'], 'string'],
  47. ];
  48. }
  49. public function beforeSave($insert)
  50. {
  51. if (parent::beforeSave($insert)) {
  52. if ($this->isNewRecord) {
  53. $this->created_at = date('Y-m-d H:i:s');
  54. }else{
  55. $this->updated_at = date('Y-m-d H:i:s');
  56. }
  57. return true;
  58. }
  59. return false;
  60. }
  61. /**
  62. * @inheritdoc
  63. */
  64. public function attributeLabels()
  65. {
  66. return [
  67. 'id' => 'ID',
  68. ];
  69. }
  70. }