DDepartment.Class.php 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?php
  2. /**
  3. * 部门管理Dao
  4. * Created by PhpStorm.
  5. * User: 小威
  6. * Date: 2019/10/31
  7. * Time: 17:00
  8. */
  9. namespace JinDouYun\Dao\Department;
  10. use JinDouYun\Dao\BaseDao;
  11. class DDepartment extends BaseDao
  12. {
  13. public function __construct($serviceDB = 'default')
  14. {
  15. $this->_table = 'department';
  16. $this->_primary = 'id';
  17. $this->_fields = [
  18. "id", //int(10) NOT NULL AUTO_INCREMENT COMMENT '自增id',
  19. "shopId", //int(10) DEFAULT NULL COMMENT '商铺id',
  20. "pid", //int(10) NOT NULL DEFAULT '0' COMMENT '上级id 0:为顶级',
  21. "departmentCode", //varchar(50) DEFAULT NULL COMMENT '部门编码',
  22. "order", //tinyint(3) NOT NULL COMMENT '排序 默认0 数越大 越靠前',
  23. "departmentName", //varchar(255) NOT NULL COMMENT '部门名称',
  24. "desc", //text COMMENT '部门说明/描述',
  25. "deleteStatus", //tinyint(3) NOT NULL DEFAULT '5' COMMENT '删除状态 4:删除 5:正常',
  26. "enableStatus", //tinyint(3) NOT NULL DEFAULT '4' COMMENT '启用状态 4:未启用 5:已启用',
  27. "createTime", //int(10) DEFAULT NULL COMMENT '创建时间',
  28. "updateTime", //int(10) DEFAULT NULL COMMENT '更新时间',
  29. "extend", //json DEFAULT NULL COMMENT '扩展字段',
  30. "dept_id", //jint DEFAULT NULL COMMENT '部门id',
  31. ];
  32. $this->_readonly = ['id'];
  33. $this->_create_autofill = [
  34. 'createTime' => time()
  35. ];
  36. $this->_update_autofill = [
  37. 'updateTime' => time()
  38. ];
  39. parent::__construct($serviceDB);
  40. }
  41. }