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
49ff75e5
Commit
49ff75e5
authored
Aug 14, 2019
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
message
parent
7f923275
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
56 additions
and
2 deletions
+56
-2
StoreFee.php
application/api_broker/controller/StoreFee.php
+3
-1
PushMessageService.php
application/api_broker/service/PushMessageService.php
+45
-0
StoreFee.php
application/index/controller/StoreFee.php
+3
-0
CostService.php
application/index/service/CostService.php
+5
-1
No files found.
application/api_broker/controller/StoreFee.php
View file @
49ff75e5
...
...
@@ -3,9 +3,9 @@
namespace
app\api_broker\controller
;
use
app\api_broker\extend\Basic
;
use
app\api_broker\service\PushMessageService
;
use
app\api_broker\service\StoreFeeService
;
use
app\index\service\UserService
;
use
app\model\AAgents
;
use
app\model\AStore
;
use
app\model\FollowUpLogModel
;
...
...
@@ -88,6 +88,8 @@ class StoreFee extends Basic
$is_ok
=
$this
->
service_
->
addApplyFor
(
$type
,
$fee_item
,
$total_fee
,
$agent_id
,
$store_id
,
$purpose
,
$site_id
,
$card_name
,
$bank
,
$card_no
,
$count_time
,
$img_arr
,
0
,
$office_id
);
if
(
$is_ok
>
0
)
{
$push
=
new
PushMessageService
();
$push
->
recordApplyForFeDistrict
(
$agent_id
,
$this
->
agentId
);
return
$this
->
response
(
"200"
,
"request success"
,
[]);
}
else
{
return
$this
->
response
(
"101"
,
"save exception"
);
...
...
application/api_broker/service/PushMessageService.php
View file @
49ff75e5
...
...
@@ -547,4 +547,48 @@ class PushMessageService
$where
[
'site_id'
]
=
$site_id
;
return
$m_user_agent
->
getUserAgentColumn
(
'agent_id'
,
$where
);
}
/**
* 费用报销推送给总监
*
* @param $agent_id
* @param $operation_id
* @return bool
*/
public
function
recordApplyForFeDistrict
(
$agent_id
,
$operation_id
)
{
$redis
=
new
RedisCacheService
();
$agent_data
=
$redis
->
getRedisCache
(
2
,
$agent_id
);
if
(
$agent_data
)
{
return
false
;
}
$m_agent
=
new
AAgents
();
$where
[
'district_id'
]
=
$agent_data
[
'district_id'
];
$where
[
'level'
]
=
[
'in'
,
'30,40'
];
$where
[
'status'
]
=
0
;
$district_id_agent
=
$m_agent
->
getFieldOneValue
(
'id'
,
$where
);
if
(
empty
(
$district_id_agent
))
{
return
false
;
}
$record_data
[
'message'
]
=
'['
.
$agent_data
[
'name'
]
.
']提交了费用报销,快去审核吧!'
;
$this
->
record
(
19
,
0
,
[
$district_id_agent
],
$operation_id
,
$record_data
);
return
true
;
}
/**
* 费用报销审核完推送给提交人
*
* @param $agent_id
* @param $operation_id
* @return bool
*/
public
function
recordApplyForFeCheck
(
$agent_id
,
$operation_id
)
{
$record_data
[
'message'
]
=
'你有费用报销通过审核通过!'
;
$this
->
record
(
19
,
0
,
[
$agent_id
],
$operation_id
,
$record_data
);
return
true
;
}
}
\ No newline at end of file
application/index/controller/StoreFee.php
View file @
49ff75e5
...
...
@@ -9,6 +9,7 @@ namespace app\index\controller;
*/
use
app\api_broker\service\PushMessageService
;
use
app\api_broker\service\RedisCacheService
;
use
app\api_broker\service\StoreFeeService
;
use
app\api_broker\validate\StoreFeeValidate
;
...
...
@@ -472,6 +473,8 @@ class StoreFee extends Basic
$is_ok
=
$service_
->
addApplyForPC
(
$type
,
$fee_item
,
$total_fee
,
$agent_id
,
$store_id
,
$purpose
,
$site_id
,
$card_name
,
$bank
,
$card_no
,
$count_time
,
$img_arr
,
$id
,
$office_id
,
$status
);
if
(
$is_ok
>
0
)
{
$push
=
new
PushMessageService
();
$push
->
recordApplyForFeDistrict
(
$agent_id
,
$this
->
userId
);
return
$this
->
response
(
"200"
,
"request success"
,
[]);
}
else
{
return
$this
->
response
(
"101"
,
"save exception"
);
...
...
application/index/service/CostService.php
View file @
49ff75e5
...
...
@@ -4,6 +4,7 @@
namespace
app\index\service
;
use
app\api_broker\service\PushMessageService
;
use
app\model\FApplyForFee
;
use
app\model\FApplyForFeeCheck
;
use
app\model\FImg
;
...
...
@@ -35,7 +36,7 @@ class CostService
$result
[
'msg'
]
=
''
;
$where
[
'id'
]
=
$params
[
'id'
];
$where
[
'is_del'
]
=
$is_update_apply
=
0
;
$cost_data
=
$this
->
apply_model
->
findByOne
(
'id,status'
,
$where
);
$cost_data
=
$this
->
apply_model
->
findByOne
(
'id,status
,agent_id
'
,
$where
);
if
(
empty
(
$cost_data
))
{
$result
[
'msg'
]
=
'无该记录'
;
return
$result
;
...
...
@@ -79,6 +80,9 @@ class CostService
if
(
isset
(
$img_arr
))
{
$this
->
f_img_model
->
insertDataAll
(
$img_arr
);
}
$push
=
new
PushMessageService
();
$push
->
recordApplyForFeCheck
(
$cost_data
[
'agent_id'
],
''
,
$agent_id
);
}
}
catch
(
\Exception
$e
)
{
$result
[
'msg'
]
=
'修改申请记录失败'
.
$e
->
getMessage
();
...
...
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