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
1ec788b3
Commit
1ec788b3
authored
Aug 24, 2021
by
luhongguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update: class修改
parent
5c8c000b
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
33 additions
and
84 deletions
+33
-84
ColonelDistributorConfig.php
...ation/models/marketing/mysql/ColonelDistributorConfig.php
+2
-2
ColonelDistributorInviteOrder.php
.../models/marketing/mysql/ColonelDistributorInviteOrder.php
+2
-2
ColonelDistributorInviteOrderNum.php
...dels/marketing/mysql/ColonelDistributorInviteOrderNum.php
+1
-1
ColonelDistributorPayInfo.php
...tion/models/marketing/mysql/ColonelDistributorPayInfo.php
+1
-1
PindanActivityInviteOrderRefund.php
...odels/marketing/mysql/PindanActivityInviteOrderRefund.php
+0
-51
PindanActivityColonelConfigService.php
...services/marketing/PindanActivityColonelConfigService.php
+10
-10
PindanActivityInviteOrderService.php
...n/services/marketing/PindanActivityInviteOrderService.php
+17
-17
No files found.
application/models/marketing/mysql/
PindanActivityColonel
Config.php
→
application/models/marketing/mysql/
ColonelDistributor
Config.php
View file @
1ec788b3
...
...
@@ -4,9 +4,9 @@ namespace App\Models\marketing\mysql;
use
Api\PhpUtils\Mysql\MysqlBase
;
class
PindanActivityColonel
Config
extends
MysqlBase
class
ColonelDistributor
Config
extends
MysqlBase
{
const
TABLE_NAME
=
'
pindan_activity
_colonel_config'
;
const
TABLE_NAME
=
'
colonel_distributor
_colonel_config'
;
const
CONFIG_INDEX
=
'marketing'
;
const
PRIMARY_KEY
=
'colonel_config_id'
;
...
...
application/models/marketing/mysql/
PindanActivity
InviteOrder.php
→
application/models/marketing/mysql/
ColonelDistributor
InviteOrder.php
View file @
1ec788b3
...
...
@@ -4,9 +4,9 @@ namespace App\Models\marketing\mysql;
use
Api\PhpUtils\Mysql\MysqlBase
;
class
PindanActivity
InviteOrder
extends
MysqlBase
class
ColonelDistributor
InviteOrder
extends
MysqlBase
{
const
TABLE_NAME
=
'
pindan_activity
_invite_order'
;
const
TABLE_NAME
=
'
colonel_distributor
_invite_order'
;
const
CONFIG_INDEX
=
'marketing'
;
const
PRIMARY_KEY
=
'invite_order_id'
;
...
...
application/models/marketing/mysql/
PindanActivity
InviteOrderNum.php
→
application/models/marketing/mysql/
ColonelDistributor
InviteOrderNum.php
View file @
1ec788b3
...
...
@@ -4,7 +4,7 @@ namespace App\Models\marketing\mysql;
use
Api\PhpUtils\Mysql\MysqlBase
;
class
PindanActivity
InviteOrderNum
extends
MysqlBase
class
ColonelDistributor
InviteOrderNum
extends
MysqlBase
{
const
TABLE_NAME
=
'pindan_activity_invite_order_num'
;
const
CONFIG_INDEX
=
'marketing'
;
...
...
application/models/marketing/mysql/
PindanActivity
PayInfo.php
→
application/models/marketing/mysql/
ColonelDistributor
PayInfo.php
View file @
1ec788b3
...
...
@@ -4,7 +4,7 @@ namespace App\Models\marketing\mysql;
use
Api\PhpUtils\Mysql\MysqlBase
;
class
PindanActivity
PayInfo
extends
MysqlBase
class
ColonelDistributor
PayInfo
extends
MysqlBase
{
const
TABLE_NAME
=
'pindan_activity_pay_info'
;
const
CONFIG_INDEX
=
'marketing'
;
...
...
application/models/marketing/mysql/PindanActivityInviteOrderRefund.php
deleted
100644 → 0
View file @
5c8c000b
<?php
namespace
App\Models\marketing\mysql
;
use
Api\PhpUtils\Mysql\MysqlBase
;
class
PindanActivityInviteOrderRefund
extends
MysqlBase
{
const
TABLE_NAME
=
'pindan_activity_invite_order_refund'
;
const
CONFIG_INDEX
=
'marketing'
;
const
PRIMARY_KEY
=
'invite_order_refund_id'
;
public
static
function
getRecord
(
$where
,
$columns
=
[],
$options
=
[])
{
if
(
empty
(
$columns
))
{
$columns
=
'*'
;
}
return
self
::
get
(
$columns
,
$where
,
$options
);
}
public
static
function
getRecordMaster
(
$where
,
$columns
=
[],
$options
=
[])
{
if
(
empty
(
$columns
))
{
$columns
=
'*'
;
}
return
self
::
selectMaster
(
$columns
,
$where
,
$options
);
}
public
static
function
insertRecord
(
$columns
,
$options
=
[])
{
return
self
::
insert
(
$columns
,
$options
);
}
public
static
function
updateRecord
(
$columns
,
$where
)
{
return
self
::
update
(
$columns
,
$where
);
}
public
static
function
save
(
$data
,
$where
=
[],
$options
=
[])
{
if
(
empty
(
$where
))
{
return
self
::
insert
(
$data
,
$options
);
}
return
self
::
update
(
$data
,
$where
);
}
public
static
function
deleteRecord
(
$where
)
{
return
self
::
delete
(
$where
);
}
}
\ No newline at end of file
application/services/marketing/PindanActivityColonelConfigService.php
View file @
1ec788b3
...
...
@@ -5,7 +5,7 @@ namespace App\Services\marketing;
use
App\Exception\custom\MarketingException
;
use
App\Models\marketing\mysql\Marketing
;
use
App\Models\marketing\mysql\
PindanActivityColonel
Config
;
use
App\Models\marketing\mysql\
ColonelDistributor
Config
;
class
PindanActivityColonelConfigService
{
...
...
@@ -18,7 +18,7 @@ class PindanActivityColonelConfigService
public
static
function
editColonelConfig
(
$params
=
[])
{
$date
=
$params
[
"date"
];
$type
=
empty
(
$params
[
"type"
])
?
PindanActivityColonel
Config
::
TYPE_COLONEL
:
$params
[
"type"
];
$type
=
empty
(
$params
[
"type"
])
?
ColonelDistributor
Config
::
TYPE_COLONEL
:
$params
[
"type"
];
$configList
=
json_decode
(
$params
[
"config"
],
true
);
if
(
empty
(
$configList
))
{
...
...
@@ -28,12 +28,12 @@ class PindanActivityColonelConfigService
if
(
count
(
$configList
)
>
6
)
{
throw
new
MarketingException
([
'cus'
=>
MarketingException
::
COLONEL_LEVEL_SIX
]);
}
PindanActivityColonel
Config
::
beginTransaction
();
ColonelDistributor
Config
::
beginTransaction
();
$idsRes
=
PindanActivityColonel
Config
::
select
([
"colonel_config_id"
],
[
"date"
=>
$date
,
"type"
=>
$type
],
[]);
$idsRes
=
ColonelDistributor
Config
::
select
([
"colonel_config_id"
],
[
"date"
=>
$date
,
"type"
=>
$type
],
[]);
if
(
!
empty
(
$idsRes
))
{
$ids
=
array_column
(
$idsRes
,
"colonel_config_id"
);
PindanActivityColonel
Config
::
deleteRecord
([
"colonel_config_id"
=>
$ids
]);
ColonelDistributor
Config
::
deleteRecord
([
"colonel_config_id"
=>
$ids
]);
}
$data
=
[];
...
...
@@ -43,10 +43,10 @@ class PindanActivityColonelConfigService
$data
[
$key
][
"assess_order_num"
]
=
$item
[
"assess_order_num"
];
$data
[
$key
][
"reward_amount"
]
=
$item
[
"reward_amount"
];
}
PindanActivityColonel
Config
::
save
(
$data
);
ColonelDistributor
Config
::
save
(
$data
);
if
(
!
PindanActivityColonel
Config
::
commit
())
{
PindanActivityColonel
Config
::
rollback
();
if
(
!
ColonelDistributor
Config
::
commit
())
{
ColonelDistributor
Config
::
rollback
();
throw
new
MarketingException
([
"cus"
=>
5
]);
}
...
...
@@ -61,8 +61,8 @@ class PindanActivityColonelConfigService
public
static
function
colonelConfig
(
$params
=
[])
{
$day
=
empty
(
$params
[
"date"
])
?
date
(
"Y-m-d"
)
:
$params
[
"date"
];
$type
=
empty
(
$params
[
"type"
])
?
PindanActivityColonel
Config
::
TYPE_COLONEL
:
$params
[
"type"
];
$list
=
PindanActivityColonel
Config
::
select
(
"*"
,
[
"date"
=>
$day
,
"type"
=>
$type
],
[]);
$type
=
empty
(
$params
[
"type"
])
?
ColonelDistributor
Config
::
TYPE_COLONEL
:
$params
[
"type"
];
$list
=
ColonelDistributor
Config
::
select
(
"*"
,
[
"date"
=>
$day
,
"type"
=>
$type
],
[]);
$data
=
[];
if
(
!
empty
(
$list
))
{
...
...
application/services/marketing/PindanActivityInviteOrderService.php
View file @
1ec788b3
...
...
@@ -3,8 +3,8 @@
namespace
App\Services\marketing
;
use
App\Exception\custom\MarketingException
;
use
App\Models\marketing\mysql\
PindanActivity
InviteOrder
;
use
App\Models\marketing\mysql\
PindanActivity
InviteOrderNum
;
use
App\Models\marketing\mysql\
ColonelDistributor
InviteOrder
;
use
App\Models\marketing\mysql\
ColonelDistributor
InviteOrderNum
;
use
App\Models\marketing\mysql\PindanActivityInviteOrderRefund
;
class
PindanActivityInviteOrderService
...
...
@@ -25,7 +25,7 @@ class PindanActivityInviteOrderService
"refund_time"
=>
null
,
];
$inviteOrder
=
PindanActivity
InviteOrder
::
selectMaster
(
"*"
,
$inviteOrderData
,
[]);
$inviteOrder
=
ColonelDistributor
InviteOrder
::
selectMaster
(
"*"
,
$inviteOrderData
,
[]);
if
(
!
empty
(
$inviteOrder
))
{
return
true
;
}
...
...
@@ -34,20 +34,20 @@ class PindanActivityInviteOrderService
"colonel_user_id"
=>
$params
[
"colonel_user_id"
],
"date"
=>
date
(
"Y-m-d"
),
];
$inviteOrderNum
=
PindanActivity
InviteOrderNum
::
selectMaster
(
"*"
,
$inviteOrderNumData
,
[]);
$inviteOrderNum
=
ColonelDistributor
InviteOrderNum
::
selectMaster
(
"*"
,
$inviteOrderNumData
,
[]);
PindanActivity
InviteOrder
::
beginTransaction
();
$addInviteOrderRes
=
PindanActivity
InviteOrder
::
save
(
$inviteOrderData
);
ColonelDistributor
InviteOrder
::
beginTransaction
();
$addInviteOrderRes
=
ColonelDistributor
InviteOrder
::
save
(
$inviteOrderData
);
if
(
!
empty
(
$inviteOrderNum
))
{
$addInviteOrderNumRes
=
PindanActivity
InviteOrderNum
::
save
([
"num[+]"
=>
$num
],
[
"invite_order_num_id"
=>
$inviteOrderNum
[
0
][
"invite_order_num_id"
]]);
$addInviteOrderNumRes
=
ColonelDistributor
InviteOrderNum
::
save
([
"num[+]"
=>
$num
],
[
"invite_order_num_id"
=>
$inviteOrderNum
[
0
][
"invite_order_num_id"
]]);
}
else
{
$inviteOrderNumData
[
"num"
]
=
$num
;
$addInviteOrderNumRes
=
PindanActivity
InviteOrderNum
::
save
(
$inviteOrderNumData
);
$addInviteOrderNumRes
=
ColonelDistributor
InviteOrderNum
::
save
(
$inviteOrderNumData
);
}
if
(
empty
(
$addInviteOrderRes
)
||
empty
(
$addInviteOrderNumRes
)
||
!
PindanActivity
InviteOrder
::
commit
())
{
PindanActivity
InviteOrder
::
rollback
();
if
(
empty
(
$addInviteOrderRes
)
||
empty
(
$addInviteOrderNumRes
)
||
!
ColonelDistributor
InviteOrder
::
commit
())
{
ColonelDistributor
InviteOrder
::
rollback
();
throw
new
MarketingException
([
"cus"
=>
MarketingException
::
COMMIT_ERROR
]);
}
return
true
;
...
...
@@ -64,7 +64,7 @@ class PindanActivityInviteOrderService
$orderId
=
$params
[
"order_id"
];
$orderItemIds
=
$params
[
"order_item_id"
];
$inviteOrder
=
PindanActivity
InviteOrder
::
selectMaster
(
"*"
,
[
"order_id"
=>
$orderId
],
[]);
$inviteOrder
=
ColonelDistributor
InviteOrder
::
selectMaster
(
"*"
,
[
"order_id"
=>
$orderId
],
[]);
if
(
!
empty
(
$inviteOrder
))
{
$inviteOrderData
=
[
"colonel_user_id"
=>
$inviteOrder
[
0
][
"colonel_user_id"
],
...
...
@@ -90,18 +90,18 @@ class PindanActivityInviteOrderService
}
$num
=
count
(
$refundData
);
PindanActivity
InviteOrder
::
beginTransaction
();
ColonelDistributor
InviteOrder
::
beginTransaction
();
PindanActivityInviteOrderRefund
::
insertRecord
(
$refundData
);
$addInviteOrderRes
=
PindanActivity
InviteOrder
::
save
([
"is_refund"
=>
PindanActivity
InviteOrder
::
IS_REFUND_YES
,
$addInviteOrderRes
=
ColonelDistributor
InviteOrder
::
save
([
"is_refund"
=>
ColonelDistributor
InviteOrder
::
IS_REFUND_YES
,
"refund_time"
=>
date
(
"y-m-d H:i:s"
)
],
$inviteOrderData
);
$addInviteOrderNumRes
=
PindanActivity
InviteOrderNum
::
save
([
"num[-]"
=>
$num
],
$inviteOrderNumData
);
$addInviteOrderNumRes
=
ColonelDistributor
InviteOrderNum
::
save
([
"num[-]"
=>
$num
],
$inviteOrderNumData
);
if
(
empty
(
$addInviteOrderRes
)
||
empty
(
$addInviteOrderNumRes
)
||
!
PindanActivity
InviteOrder
::
commit
())
{
PindanActivity
InviteOrder
::
rollback
();
if
(
empty
(
$addInviteOrderRes
)
||
empty
(
$addInviteOrderNumRes
)
||
!
ColonelDistributor
InviteOrder
::
commit
())
{
ColonelDistributor
InviteOrder
::
rollback
();
throw
new
MarketingException
([
"cus"
=>
MarketingException
::
COMMIT_ERROR
]);
}
}
...
...
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