DepartmentModel.php 628 B

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. namespace app\common\model;
  3. class DepartmentModel extends BaseModel
  4. {
  5. protected $table = 'erp_department';
  6. protected function genSchema(array $schema)
  7. {
  8. // TODO: Implement genSchema() method.
  9. }
  10. public function fetchAllDepartment() {
  11. return $this->where('is_delete',0)->select();
  12. }
  13. public function findByName($name) {
  14. return $this->where([
  15. ['is_delete', '=', 0],
  16. ['name', '=', $name]
  17. ])->find();
  18. }
  19. function findAllDepartment() {
  20. return $this->where([
  21. ['is_delete', '=', 0],
  22. ])->select();
  23. }
  24. }