Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
goods
Project
Project
Details
Activity
Releases
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
bp
goods
Commits
952d24ec
Commit
952d24ec
authored
Sep 09, 2021
by
pengfei
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'colonel' into develop
parents
515e9658
f862e8f8
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
16 deletions
+35
-16
Colonelorder.php
application/modules/Job/controllers/Colonelorder.php
+23
-4
ColonelService.php
application/services/marketing/ColonelService.php
+12
-12
No files found.
application/modules/Job/controllers/Colonelorder.php
View file @
952d24ec
...
...
@@ -36,10 +36,7 @@ class ColonelorderController extends Job
public
function
init
()
{
parent
::
init
();
$timeRange
=
PindanActivityColonelConfigService
::
getSettlementTimeRange
();
$this
->
settlementDate
=
$timeRange
[
'date'
];
$this
->
startTime
=
$timeRange
[
'start_time'
];
$this
->
endTime
=
$timeRange
[
'end_time'
];
$this
->
loadTimeConfig
();
$this
->
colonelConfigList
=
$this
->
getColonelConfig
(
$this
->
settlementDate
);
}
...
...
@@ -267,6 +264,28 @@ class ColonelorderController extends Job
return
(
int
)
ColonelDistributorPayInfo
::
save
(
$data
);
}
/**
* Notes: 加载配置
* User: pengfei@yidian-inc.com
* Date: 2021/9/8 7:43 下午
*/
private
function
loadTimeConfig
()
{
// 如果传入时间-使用指定时间
$params
=
$this
->
getRequest
()
->
getParams
();
if
(
empty
(
$params
[
'date'
])
||
strtotime
(
$params
[
'date'
]))
{
$timeRange
=
PindanActivityColonelConfigService
::
getSettlementTimeRange
();
$this
->
settlementDate
=
$timeRange
[
'date'
];
$this
->
startTime
=
$timeRange
[
'start_time'
];
$this
->
endTime
=
$timeRange
[
'end_time'
];
}
else
{
$hour
=
PindanActivityColonelConfigService
::
ACTIVITY_DEFAULT_HOUR
;
$this
->
settlementDate
=
$params
[
'date'
];
$this
->
startTime
=
"
{
$params
[
'date'
]
}
$hour
:00:00"
;
$this
->
endTime
=
strtotime
(
$this
->
startTime
.
' +1 day'
);
}
}
/**
* Notes: 记录 info 日志
* User: pengfei@yidian-inc.com
...
...
application/services/marketing/ColonelService.php
View file @
952d24ec
...
...
@@ -49,11 +49,11 @@ class ColonelService
$colonelData
[
'take_place_name'
]
=
"【团长】
{
$colonelData
[
'take_place_name'
]
}
"
;
}
if
(
!
$applyId
=
ColonelDistributorColonelApply
::
insertRecord
(
$colonelData
))
{
throw
new
Marketing
Exception
(
MarketingException
::
COLONEL_APPLY_FAILED
);
throw
new
Exception
(
MarketingException
::
COLONEL_APPLY_FAILED
);
}
return
$applyId
;
}
catch
(
Exception
$e
)
{
throw
new
MarketingException
(
MarketingException
::
COLONEL_APPLY_FAILED
);
throw
new
MarketingException
(
$e
->
getMessage
()
);
}
}
...
...
@@ -171,21 +171,21 @@ class ColonelService
[
'colonel_apply_id'
=>
$applyId
,
'audit_status[!]'
=>
ColonelDistributorColonelApply
::
STATUS_PASS
]
);
if
(
empty
(
$updateStatus
))
{
throw
new
Marketing
Exception
(
MarketingException
::
COLONEL_AUDIT_STATUS_FAILED
);
throw
new
Exception
(
MarketingException
::
COLONEL_AUDIT_STATUS_FAILED
);
}
// 审核成功
if
(
$auditStatus
==
ColonelDistributorColonelApply
::
STATUS_PASS
)
{
if
(
!
self
::
handleAuditSuccess
((
array
)
$applyInfo
))
{
throw
new
Marketing
Exception
(
MarketingException
::
COLONEL_ADD_FAILED
);
throw
new
Exception
(
MarketingException
::
COLONEL_ADD_FAILED
);
}
}
if
(
!
ColonelDistributorColonelApply
::
commit
())
{
throw
new
Marketing
Exception
(
MarketingException
::
COMMIT_ERROR
);
throw
new
Exception
(
MarketingException
::
COMMIT_ERROR
);
}
return
true
;
}
catch
(
Marketing
Exception
$e
)
{
}
catch
(
Exception
$e
)
{
ColonelDistributorColonelApply
::
rollback
();
throw
new
MarketingException
(
$e
->
get
Cod
e
());
throw
new
MarketingException
(
$e
->
get
Messag
e
());
}
}
...
...
@@ -232,19 +232,19 @@ class ColonelService
ColonelDistributorColonel
::
beginTransaction
();
// 添加自提点
if
(
!
$takePlaceId
=
TakePlaceService
::
add
(
$params
))
{
throw
new
Marketing
Exception
(
MarketingException
::
COLONEL_TAKE_PLACE_FAILED
);
throw
new
Exception
(
MarketingException
::
COLONEL_TAKE_PLACE_FAILED
);
}
// 修改自提点id
if
(
!
ColonelDistributorColonel
::
updateRecord
([
'take_place_id'
=>
$takePlaceId
],
$where
))
{
throw
new
Marketing
Exception
(
MarketingException
::
COLONEL_TAKE_PLACE_EDIT_FAILED
);
throw
new
Exception
(
MarketingException
::
COLONEL_TAKE_PLACE_EDIT_FAILED
);
}
if
(
!
ColonelDistributorColonel
::
commit
())
{
throw
new
Marketing
Exception
(
MarketingException
::
COMMIT_ERROR
);
throw
new
Exception
(
MarketingException
::
COMMIT_ERROR
);
}
return
(
int
)
$takePlaceId
;
}
catch
(
Marketing
Exception
$e
)
{
}
catch
(
Exception
$e
)
{
ColonelDistributorColonel
::
rollback
();
throw
new
MarketingException
(
$e
->
get
Cod
e
());
throw
new
MarketingException
(
$e
->
get
Messag
e
());
}
}
...
...
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