|
- <?php
-
- namespace common\models;
-
- use Yii;
-
- /**
- * This is the model class for table "office_wechat_user".
- *
- * @property integer $ID
- * @property integer $userid
- * @property string $username
- * @property integer $dep_id
- */
- class OfficeWechatUser extends \yii\db\ActiveRecord
- {
- /**
- * @inheritdoc
- */
- public static function tableName()
- {
- return 'office_wechat_user';
- }
-
- /**
- * @inheritdoc
- */
- public function rules()
- {
- return [
- [['userid', 'username', 'dep_id'], 'required'],
- [['dep_id'], 'integer'],
- [['username'], 'string', 'max' => 255],
- ];
- }
-
- /**
- * @inheritdoc
- */
- public function attributeLabels()
- {
- return [
- 'ID' => 'ID',
- 'userid' => '企业微信用户ID',
- 'username' => '企业微信用户名称',
- 'dep_id' => '所属部门',
- ];
- }
-
-
- public function load($item, $formName = null)
- {
- $this->userid = isset($item['userid']) ? $item['userid'] : 1;
- $this->username = isset($item['name']) ? $item['name'] : '';
- $this->dep_id = isset($item['department'][0]) ? $item['department'][0] : 1;
- return true;
- }
- }
|