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
0344ce7c
Commit
0344ce7c
authored
Aug 24, 2021
by
pengfei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update 更改团长分销活动-团长表名
parent
0aba4b7a
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
14 deletions
+14
-14
ColonelDistributorColonelApply.php
...models/marketing/mysql/ColonelDistributorColonelApply.php
+2
-2
ColonelService.php
application/services/marketing/ColonelService.php
+12
-12
No files found.
application/models/marketing/mysql/
PindanActivity
ColonelApply.php
→
application/models/marketing/mysql/
ColonelDistributor
ColonelApply.php
View file @
0344ce7c
...
...
@@ -9,9 +9,9 @@ namespace App\Models\marketing\mysql;
use
Api\PhpUtils\Mysql\MysqlBase
;
class
PindanActivity
ColonelApply
extends
MysqlBase
class
ColonelDistributor
ColonelApply
extends
MysqlBase
{
const
TABLE_NAME
=
'
pindan_activity
_colonel_apply'
;
const
TABLE_NAME
=
'
colonel_distributor
_colonel_apply'
;
const
CONFIG_INDEX
=
'marketing'
;
const
PRIMARY_KEY
=
'colonel_apply_id'
;
...
...
application/services/marketing/ColonelService.php
View file @
0344ce7c
...
...
@@ -9,7 +9,7 @@ namespace App\Services\marketing;
use
App\Exception\custom\MarketingException
;
use
App\Models\marketing\mysql\PindanActivityColonel
;
use
App\Models\marketing\mysql\
PindanActivity
ColonelApply
;
use
App\Models\marketing\mysql\
ColonelDistributor
ColonelApply
;
use
App\Models\user\mysql\UserWechatBind
;
use
Exception
;
...
...
@@ -25,7 +25,7 @@ class ColonelService
*/
public
static
function
apply
(
array
$params
)
:
int
{
if
(
PindanActivity
ColonelApply
::
existUser
(
$params
[
'user_id'
]))
{
if
(
ColonelDistributor
ColonelApply
::
existUser
(
$params
[
'user_id'
]))
{
throw
new
MarketingException
(
MarketingException
::
COLONEL_APPLY_EXIST
);
}
$colonelData
=
[
...
...
@@ -43,7 +43,7 @@ class ColonelService
'area'
=>
$params
[
'area'
]
??
''
,
];
try
{
if
(
!
$applyId
=
PindanActivity
ColonelApply
::
insertRecord
(
$colonelData
))
{
if
(
!
$applyId
=
ColonelDistributor
ColonelApply
::
insertRecord
(
$colonelData
))
{
throw
new
MarketingException
(
MarketingException
::
COLONEL_APPLY_FAILED
);
}
return
$applyId
;
...
...
@@ -63,7 +63,7 @@ class ColonelService
public
static
function
getManageList
(
array
$params
)
:
array
{
$params
=
self
::
getPageParams
(
$params
);
$result
=
PindanActivityColonelApply
::
getPages
([],
PindanActivity
ColonelApply
::
DEFAULT_COLUMN
,
$params
[
'page'
],
$params
[
'page_size'
]);
$result
=
ColonelDistributorColonelApply
::
getPages
([],
ColonelDistributor
ColonelApply
::
DEFAULT_COLUMN
,
$params
[
'page'
],
$params
[
'page_size'
]);
if
(
empty
(
$result
[
'count'
]))
{
return
$result
;
}
...
...
@@ -86,29 +86,29 @@ class ColonelService
*/
public
static
function
handleManageAudit
(
int
$applyId
,
int
$auditStatus
)
:
bool
{
if
(
!
in_array
(
$auditStatus
,
[
PindanActivityColonelApply
::
STATUS_PASS
,
PindanActivity
ColonelApply
::
STATUS_REJECT
]))
{
if
(
!
in_array
(
$auditStatus
,
[
ColonelDistributorColonelApply
::
STATUS_PASS
,
ColonelDistributor
ColonelApply
::
STATUS_REJECT
]))
{
throw
new
MarketingException
(
MarketingException
::
COLONEL_AUDIT_STATUS
);
}
$applyInfo
=
PindanActivity
ColonelApply
::
getRecord
([
'colonel_apply_id'
=>
$applyId
]);
if
(
empty
(
$applyInfo
)
||
$applyInfo
[
'audit_status'
]
!=
PindanActivity
ColonelApply
::
STATUS_AUDIT
)
{
$applyInfo
=
ColonelDistributor
ColonelApply
::
getRecord
([
'colonel_apply_id'
=>
$applyId
]);
if
(
empty
(
$applyInfo
)
||
$applyInfo
[
'audit_status'
]
!=
ColonelDistributor
ColonelApply
::
STATUS_AUDIT
)
{
throw
new
MarketingException
(
MarketingException
::
COLONEL_AUDIT_STATUS
);
}
try
{
PindanActivity
ColonelApply
::
beginTransaction
();
ColonelDistributor
ColonelApply
::
beginTransaction
();
// 修改申请状态
$updateStatus
=
PindanActivityColonelApply
::
update
([
'audit_status'
=>
$auditStatus
],
[
'colonel_apply_id'
=>
$applyId
,
'audit_status'
=>
PindanActivity
ColonelApply
::
STATUS_AUDIT
]);
$updateStatus
=
ColonelDistributorColonelApply
::
update
([
'audit_status'
=>
$auditStatus
],
[
'colonel_apply_id'
=>
$applyId
,
'audit_status'
=>
ColonelDistributor
ColonelApply
::
STATUS_AUDIT
]);
if
(
empty
(
$updateStatus
))
{
throw
new
MarketingException
(
MarketingException
::
COLONEL_AUDIT_STATUS_FAILED
);
}
// 审核成功,入库团长表
if
(
$auditStatus
==
PindanActivity
ColonelApply
::
STATUS_PASS
)
{
if
(
$auditStatus
==
ColonelDistributor
ColonelApply
::
STATUS_PASS
)
{
if
(
!
self
::
handleAuditSuccess
((
array
)
$applyInfo
))
{
throw
new
MarketingException
(
MarketingException
::
COLONEL_AUDIT_STATUS_FAILED
);
}
}
return
PindanActivity
ColonelApply
::
commit
();
return
ColonelDistributor
ColonelApply
::
commit
();
}
catch
(
MarketingException
$e
)
{
PindanActivity
ColonelApply
::
rollback
();
ColonelDistributor
ColonelApply
::
rollback
();
throw
new
MarketingException
(
MarketingException
::
COLONEL_AUDIT_STATUS_FAILED
);
}
}
...
...
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