|
- <?php
-
- namespace common\models;
-
- use Yii;
-
- /**
- * This is the model class for table "office_wechat_dep".
- *
- * @property integer $ID
- * @property integer $dep_id
- * @property string $dep_name
- * @property integer $parentid
- */
- class OfficeWechatDep extends \yii\db\ActiveRecord
- {
- /**
- * @inheritdoc
- */
- public static function tableName()
- {
- return 'office_wechat_dep';
- }
-
- /**
- * @inheritdoc
- */
- public function rules()
- {
- return [
- [['dep_id', 'dep_name', 'parentid'], 'required'],
- [['dep_id', 'parentid'], 'integer'],
- [['dep_name'], 'string', 'max' => 255],
- ];
- }
-
- /**
- * @inheritdoc
- */
- public function attributeLabels()
- {
- return [
- 'ID' => 'ID',
- 'dep_id' => '企业微信组织架构的部门ID',
- 'dep_name' => '企业微信组织架构的部门名称',
- 'parentid' => '父亲部门id。根部门为1',
- ];
- }
-
- public function load($item, $formName = null)
- {
- $this->dep_id = isset($item['id']) ? $item['id'] : 1;
- $this->dep_name = isset($item['name']) ? $item['name'] : '';
- $this->parentid = isset($item['parentid']) ? $item['parentid'] : 1;
- return true;
- }
- }
|