Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
tl_estate
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hujun
tl_estate
Commits
1b0aed19
Commit
1b0aed19
authored
Oct 28, 2018
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
反复转勤
parent
bde568a4
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
13 deletions
+19
-13
BrokerService.php
application/index/service/BrokerService.php
+19
-13
No files found.
application/index/service/BrokerService.php
View file @
1b0aed19
...
@@ -66,15 +66,12 @@ class BrokerService
...
@@ -66,15 +66,12 @@ class BrokerService
$where
[
'site_id'
]
=
$data
[
'site_id'
];
$where
[
'site_id'
]
=
$data
[
'site_id'
];
$agent_data
=
$this
->
m_agent
->
verifyUser
(
$field
,
''
,
$where
);
$agent_data
=
$this
->
m_agent
->
verifyUser
(
$field
,
''
,
$where
);
if
(
!
empty
(
$agent_data
[
'status'
])
&&
$agent_data
[
'status'
]
==
3
)
{
if
(
!
empty
(
$agent_data
)
&&
$agent_data
[
'status'
]
==
0
)
{
$result
[
'msg'
]
=
'该用户已转勤'
;
}
if
(
!
empty
(
$agent_data
))
{
$result
[
'msg'
]
=
'该用户已存在'
;
$result
[
'msg'
]
=
'该用户已存在'
;
return
$result
;
return
$result
;
}
}
$agent_old
=
$this
->
m_agent
->
getAgentById
(
$field
,
[
'phone'
=>
$data
[
'phone'
],
'status'
=>
0
]);
$agent_old
=
$this
->
m_agent
->
getAgentById
(
$field
,
[
'phone'
=>
$data
[
'phone'
],
'status'
=>
0
]);
if
(
empty
(
$data
[
'confirm_old'
])
&&
!
empty
(
$agent_old
[
0
][
'id'
]
))
{
if
(
empty
(
$data
[
'confirm_old'
])
&&
(
!
empty
(
$agent_old
[
0
][
'id'
])
||
$agent_data
[
'status'
]
==
3
))
{
$result
[
'msg'
]
=
'转勤'
;
$result
[
'msg'
]
=
'转勤'
;
return
$result
;
return
$result
;
}
else
{
}
else
{
...
@@ -120,8 +117,14 @@ class BrokerService
...
@@ -120,8 +117,14 @@ class BrokerService
}
}
if
(
$is_new_id
)
{
if
(
$is_new_id
)
{
$change_old_id
=
$agent_old
[
0
][
'id'
];
$id
=
$this
->
m_agent
->
saveAgent
(
$data
);
$id
=
$this
->
m_agent
->
saveAgent
(
$data
);
}
elseif
(
$agent_data
[
'status'
]
==
3
)
{
$change_old_id
=
$agent_old
[
0
][
'id'
];
$id
=
$this
->
m_agent
->
saveAgent
([
'id'
=>
$agent_data
[
'id'
],
'status'
=>
0
]);
$this
->
m_agent
->
saveAgent
([
'id'
=>
$agent_old
[
0
][
'id'
],
'status'
=>
3
]);
}
else
{
}
else
{
$change_old_id
=
$agent_old
[
0
][
'id'
];
//将原来的id作为新的
//将原来的id作为新的
$data
[
'id'
]
=
$agent_old
[
0
][
'id'
];
$data
[
'id'
]
=
$agent_old
[
0
][
'id'
];
$id
=
$this
->
m_agent
->
saveAgent
(
$data
);
$id
=
$this
->
m_agent
->
saveAgent
(
$data
);
...
@@ -148,7 +151,7 @@ class BrokerService
...
@@ -148,7 +151,7 @@ class BrokerService
$result
[
'data'
]
=
[
'id'
=>
$id
];
$result
[
'data'
]
=
[
'id'
=>
$id
];
$result
[
'msg'
]
=
$msg
;
$result
[
'msg'
]
=
$msg
;
if
(
$change_old_id
)
{
if
(
$change_old_id
&&
(
$change_old_id
!=
$id
)
)
{
$m_user
=
new
Users
();
$m_user
=
new
Users
();
$update_user
=
$update_house
=
[];
$update_user
=
$update_house
=
[];
$user_id_arr
=
$m_user
->
getUserByWhereColumn
([
'agent_id'
=>
$change_old_id
],
'id'
);
$user_id_arr
=
$m_user
->
getUserByWhereColumn
([
'agent_id'
=>
$change_old_id
],
'id'
);
...
@@ -173,13 +176,6 @@ class BrokerService
...
@@ -173,13 +176,6 @@ class BrokerService
$house_id_arr
=
array_unique
(
$house_id_arr
);
$house_id_arr
=
array_unique
(
$house_id_arr
);
$record_data
[
'house_id'
]
=
empty
(
$house_id_arr
)
?
""
:
implode
(
','
,
$house_id_arr
);
$record_data
[
'house_id'
]
=
empty
(
$house_id_arr
)
?
""
:
implode
(
','
,
$house_id_arr
);
$m_records
=
new
AOperatingRecords
();
$record_data
[
'remark'
]
=
'转勤,旧id:'
.
$change_old_id
;
$record_data
[
'type'
]
=
0
;
$record_data
[
'operation_id'
]
=
$operation_id
;
$record_data
[
'agent_id'
]
=
$id
;
$m_records
->
insertData
(
$record_data
);
if
(
!
empty
(
$update_user
))
{
if
(
!
empty
(
$update_user
))
{
$m_user
->
updateUserAll
(
$update_user
);
$m_user
->
updateUserAll
(
$update_user
);
}
}
...
@@ -188,6 +184,16 @@ class BrokerService
...
@@ -188,6 +184,16 @@ class BrokerService
$m_house
->
updateUserAll
(
$update_house
);
$m_house
->
updateUserAll
(
$update_house
);
}
}
}
}
if
(
$data
[
'confirm_old'
]
==
1
)
{
$m_records
=
new
AOperatingRecords
();
$record_data
[
'remark'
]
=
'转勤,旧id:'
.
$change_old_id
;
$record_data
[
'type'
]
=
0
;
$record_data
[
'operation_id'
]
=
$operation_id
;
$record_data
[
'agent_id'
]
=
$id
;
$m_records
->
insertData
(
$record_data
);
}
}
else
{
}
else
{
$result
[
'msg'
]
=
'新增或编辑失败'
;
$result
[
'msg'
]
=
'新增或编辑失败'
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment