12345678910111213141516171819202122232425262728293031323334353637383940 |
- /*
- * @description: 计量业务相关
- * @Author: CP
- * @Date: 2021-12-25 14:37:01
- * @FilePath: \construction_management\services\jl_service.go
- */
- package services
- import (
- "go.mod/dao"
- "go.mod/datasource"
- )
- type JlService struct {
- dao *dao.ProjectDao
- }
- // 创建项目用户service
- func NewJlService() *JlService {
- return &JlService{
- dao: dao.NewProjectDao(datasource.InstanceDbMaster()),
- }
- }
- // 是否有项目
- func (s *JlService) IsCode(code string) map[string]interface{} {
- exist := 0
- if code != "" {
- projectData := s.dao.GetListByCode(code)
- if len(projectData) != 0 {
- exist = 1
- }
- }
- data := map[string]interface{}{
- "exist": exist,
- }
- return data
- }
|