You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

59 lines
1.2 KiB

  1. <?php
  2. namespace common\models;
  3. use Yii;
  4. /**
  5. * This is the model class for table "office_wechat_user".
  6. *
  7. * @property integer $ID
  8. * @property integer $userid
  9. * @property string $username
  10. * @property integer $dep_id
  11. */
  12. class OfficeWechatUser extends \yii\db\ActiveRecord
  13. {
  14. /**
  15. * @inheritdoc
  16. */
  17. public static function tableName()
  18. {
  19. return 'office_wechat_user';
  20. }
  21. /**
  22. * @inheritdoc
  23. */
  24. public function rules()
  25. {
  26. return [
  27. [['userid', 'username', 'dep_id'], 'required'],
  28. [['dep_id'], 'integer'],
  29. [['username'], 'string', 'max' => 255],
  30. ];
  31. }
  32. /**
  33. * @inheritdoc
  34. */
  35. public function attributeLabels()
  36. {
  37. return [
  38. 'ID' => 'ID',
  39. 'userid' => '企业微信用户ID',
  40. 'username' => '企业微信用户名称',
  41. 'dep_id' => '所属部门',
  42. ];
  43. }
  44. public function load($item, $formName = null)
  45. {
  46. $this->userid = isset($item['userid']) ? $item['userid'] : 1;
  47. $this->username = isset($item['name']) ? $item['name'] : '';
  48. $this->dep_id = isset($item['department'][0]) ? $item['department'][0] : 1;
  49. return true;
  50. }
  51. }