Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.
 
 
 
 
 
 

58 рядки
1.3 KiB

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