Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
eduline
Overview
Overview
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
冷斌
eduline
Commits
67c39df7
Commit
67c39df7
authored
May 19, 2020
by
冷斌
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
`试卷`
parent
eab98316
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
30 deletions
+36
-30
apps/classroom/Lib/Model/ZyRechargeModel.class.php
+36
-30
No files found.
apps/classroom/Lib/Model/ZyRechargeModel.class.php
View file @
67c39df7
...
@@ -108,36 +108,6 @@ class ZyRechargeModel extends Model
...
@@ -108,36 +108,6 @@ class ZyRechargeModel extends Model
if
(
$attach
)
{
if
(
$attach
)
{
$data
[
'note_wxpay'
]
=
$attach
;
$data
[
'note_wxpay'
]
=
$attach
;
}
}
//推广奖励
if
(
$recharge
[
'invite_id'
]
>
0
)
{
$count
=
M
(
'zy_recharge'
)
->
where
(
array
(
'invite_id'
=>
$recharge
[
'invite_id'
]))
->
count
();
$num
=
$count
-
1
;
$level
=
[
0
=>
0.1
,
50
=>
0.2
,
180
=>
0.3
];
$r
=
0
;
foreach
(
$level
as
$time
=>
$rate
)
{
if
(
$num
>=
$time
)
{
$r
=
$rate
;
}
}
$money
=
$recharge
[
'money'
]
*
$r
;
$zy_split_balance
=
M
(
'zy_split_balance'
)
->
where
(
array
(
'uid'
=>
$recharge
[
'invite_id'
]))
->
find
();
$nn
=
$zy_split_balance
[
'balance'
]
+
$money
;
M
(
'zy_split_balance'
)
->
where
(
array
(
'uid'
=>
$recharge
[
'invite_id'
]))
->
save
([
'balance'
=>
$nn
]);
M
(
'zy_split_balance_flow'
)
->
add
([
'uid'
=>
$recharge
[
'invite_id'
],
'type'
=>
5
,
'num'
=>
$money
,
'balance'
=>
$money
,
'rel_id'
=>
1
,
'rel_type'
=>
'zy_classes_order'
,
'note'
=>
$recharge
[
'note'
],
'ctime'
=>
time
(),
]);
}
//修改购买记录状态
//修改购买记录状态
$rer
=
M
(
'zy_recharge'
)
->
where
(
array
(
'pay_pass_num'
=>
$pay_pass_num
))
->
save
(
$data
);
$rer
=
M
(
'zy_recharge'
)
->
where
(
array
(
'pay_pass_num'
=>
$pay_pass_num
))
->
save
(
$data
);
if
(
$rer
)
{
if
(
$rer
)
{
...
@@ -209,6 +179,41 @@ class ZyRechargeModel extends Model
...
@@ -209,6 +179,41 @@ class ZyRechargeModel extends Model
return
false
;
return
false
;
}
}
protected
function
share
(
$pay_pass_num
)
{
$recharge
=
M
(
'zy_recharge'
)
->
where
(
array
(
'pay_pass_num'
=>
$pay_pass_num
))
->
find
();
//推广奖励
if
(
$recharge
[
'invite_id'
]
>
0
)
{
$count
=
M
(
'zy_recharge'
)
->
where
(
array
(
'invite_id'
=>
$recharge
[
'invite_id'
]))
->
count
();
$num
=
$count
-
1
;
$level
=
[
0
=>
0.1
,
50
=>
0.2
,
180
=>
0.3
];
$r
=
0
;
foreach
(
$level
as
$time
=>
$rate
)
{
if
(
$num
>=
$time
)
{
$r
=
$rate
;
}
}
$money
=
$recharge
[
'money'
]
*
$r
;
$zy_split_balance
=
M
(
'zy_split_balance'
)
->
where
(
array
(
'uid'
=>
$recharge
[
'invite_id'
]))
->
find
();
$nn
=
$zy_split_balance
[
'balance'
]
+
$money
;
M
(
'zy_split_balance'
)
->
where
(
array
(
'uid'
=>
$recharge
[
'invite_id'
]))
->
save
([
'balance'
=>
$nn
]);
M
(
'zy_split_balance_flow'
)
->
add
([
'uid'
=>
$recharge
[
'invite_id'
],
'type'
=>
5
,
'num'
=>
$money
,
'balance'
=>
$money
,
'rel_id'
=>
1
,
'rel_type'
=>
'zy_classes_order'
,
'note'
=>
$recharge
[
'note'
],
'ctime'
=>
time
(),
]);
}
}
public
function
setThirdPartyNormalPaySuccess
(
$pay_pass_num
,
$order
,
$attach
)
//setNormalPaySuccess2
public
function
setThirdPartyNormalPaySuccess
(
$pay_pass_num
,
$order
,
$attach
)
//setNormalPaySuccess2
{
{
$recharge_status
=
M
(
'zy_recharge'
)
->
where
(
array
(
'pay_pass_num'
=>
$pay_pass_num
))
->
getField
(
'status'
);
$recharge_status
=
M
(
'zy_recharge'
)
->
where
(
array
(
'pay_pass_num'
=>
$pay_pass_num
))
->
getField
(
'status'
);
...
@@ -219,6 +224,7 @@ class ZyRechargeModel extends Model
...
@@ -219,6 +224,7 @@ class ZyRechargeModel extends Model
if
(
$attach
)
{
if
(
$attach
)
{
$data
[
'note_wxpay'
]
=
$attach
;
$data
[
'note_wxpay'
]
=
$attach
;
}
}
$this
->
share
(
$pay_pass_num
);
//修改购买记录状态
//修改购买记录状态
if
(
false
!==
M
(
'zy_recharge'
)
->
where
(
array
(
'pay_pass_num'
=>
$pay_pass_num
))
->
save
(
$data
))
{
if
(
false
!==
M
(
'zy_recharge'
)
->
where
(
array
(
'pay_pass_num'
=>
$pay_pass_num
))
->
save
(
$data
))
{
return
true
;
return
true
;
...
...
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