Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
quxiu
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
冷斌
quxiu
Commits
73fb3cec
Commit
73fb3cec
authored
Apr 29, 2020
by
冷斌
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix bug
parent
8c9b4fd2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
43 additions
and
5 deletions
+43
-5
api/Appapi/Api/Charge.php
+24
-0
api/Appapi/Domain/Charge.php
+11
-1
api/Appapi/Model/Charge.php
+8
-4
No files found.
api/Appapi/Api/Charge.php
View file @
73fb3cec
...
@@ -22,9 +22,33 @@ class Api_Charge extends PhalApi_Api {
...
@@ -22,9 +22,33 @@ class Api_Charge extends PhalApi_Api {
'coin'
=>
array
(
'name'
=>
'coin'
,
'type'
=>
'string'
,
'require'
=>
true
,
'desc'
=>
'钻石'
),
'coin'
=>
array
(
'name'
=>
'coin'
,
'type'
=>
'string'
,
'require'
=>
true
,
'desc'
=>
'钻石'
),
'money'
=>
array
(
'name'
=>
'money'
,
'type'
=>
'string'
,
'require'
=>
true
,
'desc'
=>
'充值金额'
),
'money'
=>
array
(
'name'
=>
'money'
,
'type'
=>
'string'
,
'require'
=>
true
,
'desc'
=>
'充值金额'
),
),
),
'index'
=>
array
(
'uid'
=>
array
(
'name'
=>
'uid'
,
'type'
=>
'int'
,
'min'
=>
1
,
'require'
=>
true
,
'desc'
=>
'用户ID'
),
'token'
=>
array
(
'name'
=>
'token'
,
'type'
=>
'string'
,
'require'
=>
true
,
'desc'
=>
'用户token'
),
),
);
);
}
}
public
function
index
()
{
$rs
=
array
(
'code'
=>
0
,
'msg'
=>
''
,
'info'
=>
array
());
$uid
=
checkNull
(
$this
->
uid
);
$token
=
checkNull
(
$this
->
token
);
$checkToken
=
checkToken
(
$uid
,
$token
);
if
(
$checkToken
==
700
){
$rs
[
'code'
]
=
$checkToken
;
$rs
[
'msg'
]
=
'您的登陆状态失效,请重新登陆!'
;
return
$rs
;
}
$domain
=
new
Domain_Charge
();
$result
=
$domain
->
getCharge
(
$uid
);
$rs
[
'info'
][
0
]
=
$result
;
return
$rs
;
}
/* 获取订单号 */
/* 获取订单号 */
protected
function
getOrderid
(
$uid
){
protected
function
getOrderid
(
$uid
){
$orderid
=
$uid
.
'_'
.
date
(
'YmdHis'
)
.
rand
(
100
,
999
);
$orderid
=
$uid
.
'_'
.
date
(
'YmdHis'
)
.
rand
(
100
,
999
);
...
...
api/Appapi/Domain/Charge.php
View file @
73fb3cec
...
@@ -9,5 +9,15 @@ class Domain_Charge {
...
@@ -9,5 +9,15 @@ class Domain_Charge {
return
$rs
;
return
$rs
;
}
}
public
function
getCharge
(
$uid
)
{
$rs
=
array
();
$model
=
new
Model_Charge
();
$rs
=
$model
->
getCharge
(
$uid
);
return
$rs
;
}
}
}
api/Appapi/Model/Charge.php
View file @
73fb3cec
...
@@ -3,9 +3,9 @@
...
@@ -3,9 +3,9 @@
class
Model_Charge
extends
PhalApi_Model_NotORM
{
class
Model_Charge
extends
PhalApi_Model_NotORM
{
/* 订单号 */
/* 订单号 */
public
function
getOrderId
(
$changeid
,
$orderinfo
)
{
public
function
getOrderId
(
$changeid
,
$orderinfo
)
{
$charge
=
DI
()
->
notorm
->
charge_rules
->
select
(
'*'
)
->
where
(
'id=?'
,
$changeid
)
->
fetchOne
();
$charge
=
DI
()
->
notorm
->
charge_rules
->
select
(
'*'
)
->
where
(
'id=?'
,
$changeid
)
->
fetchOne
();
if
(
!
$charge
||
$charge
[
'coin'
]
!=
$orderinfo
[
'coin'
]
||
(
$charge
[
'money'
]
!=
$orderinfo
[
'money'
]
&&
$charge
[
'money_ios'
]
!=
$orderinfo
[
'money'
]
)){
if
(
!
$charge
||
$charge
[
'coin'
]
!=
$orderinfo
[
'coin'
]
||
(
$charge
[
'money'
]
!=
$orderinfo
[
'money'
]
&&
$charge
[
'money_ios'
]
!=
$orderinfo
[
'money'
]
)){
return
1003
;
return
1003
;
}
}
...
@@ -14,11 +14,15 @@ class Model_Charge extends PhalApi_Model_NotORM {
...
@@ -14,11 +14,15 @@ class Model_Charge extends PhalApi_Model_NotORM {
$orderinfo
[
'coin'
]
=
$orderinfo
[
'coin'
]
*
$user
[
'rg_multiple'
];
$orderinfo
[
'coin'
]
=
$orderinfo
[
'coin'
]
*
$user
[
'rg_multiple'
];
}
}
$orderinfo
[
'coin_give'
]
=
$charge
[
'give'
];
$orderinfo
[
'coin_give'
]
=
$charge
[
'give'
];
$result
=
DI
()
->
notorm
->
users_charge
->
insert
(
$orderinfo
);
$result
=
DI
()
->
notorm
->
users_charge
->
insert
(
$orderinfo
);
return
$result
;
return
$result
;
}
}
public
function
getCharge
(
$uid
)
{
return
DI
()
->
notorm
->
users_charge
->
select
(
'*'
)
->
where
(
"uid=
{
$uid
}
and status = 1"
)
->
fetchAll
();
}
}
}
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