Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
xiaozhan
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
冷斌
xiaozhan
Commits
dfa527ed
Commit
dfa527ed
authored
Mar 13, 2020
by
冷斌
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
7df2924f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
46 additions
and
46 deletions
+46
-46
application/Appapi/Controller/EquipmentController.class.php
+46
-46
No files found.
application/Appapi/Controller/EquipmentController.class.php
View file @
dfa527ed
...
@@ -6,26 +6,26 @@ namespace Appapi\Controller;
...
@@ -6,26 +6,26 @@ namespace Appapi\Controller;
use
Common\Controller\HomebaseController
;
use
Common\Controller\HomebaseController
;
class
EquipmentController
extends
HomebaseController
{
class
EquipmentController
extends
HomebaseController
{
function
index
(){
function
index
(){
$uid
=
I
(
"uid"
);
$uid
=
I
(
"uid"
);
$token
=
I
(
"token"
);
$token
=
I
(
"token"
);
if
(
!
$uid
||
!
$token
||
checkToken
(
$uid
,
$token
)
==
700
){
if
(
!
$uid
||
!
$token
||
checkToken
(
$uid
,
$token
)
==
700
){
$this
->
assign
(
"reason"
,
'您的登陆状态失效,请重新登陆!'
);
$this
->
assign
(
"reason"
,
'您的登陆状态失效,请重新登陆!'
);
$this
->
display
(
':error'
);
$this
->
display
(
':error'
);
exit
;
exit
;
}
}
$this
->
assign
(
"uid"
,
$uid
);
$this
->
assign
(
"uid"
,
$uid
);
$this
->
assign
(
"token"
,
$token
);
$this
->
assign
(
"token"
,
$token
);
/* 靓号信息 */
/* 靓号信息 */
$Liang
=
M
(
"liang"
);
$Liang
=
M
(
"liang"
);
$liang_list
=
$Liang
->
where
(
"uid=
{
$uid
}
"
)
->
order
(
"buytime desc"
)
->
select
();
$liang_list
=
$Liang
->
where
(
"uid=
{
$uid
}
"
)
->
order
(
"buytime desc"
)
->
select
();
$this
->
assign
(
"liang_list"
,
$liang_list
);
$this
->
assign
(
"liang_list"
,
$liang_list
);
/* 坐骑信息 */
/* 坐骑信息 */
$car_key
=
'carinfo'
;
$car_key
=
'carinfo'
;
$car_list
=
getcaches
(
$car_key
);
$car_list
=
getcaches
(
$car_key
);
...
@@ -35,11 +35,11 @@ class EquipmentController extends HomebaseController {
...
@@ -35,11 +35,11 @@ class EquipmentController extends HomebaseController {
setcaches
(
$car_key
,
$car_list
);
setcaches
(
$car_key
,
$car_list
);
}
}
}
}
foreach
(
$car_list
as
$k
=>
$v
){
foreach
(
$car_list
as
$k
=>
$v
){
$v
[
'thumb'
]
=
get_upload_path
(
$v
[
'thumb'
]);
$v
[
'thumb'
]
=
get_upload_path
(
$v
[
'thumb'
]);
$v
[
'swf'
]
=
get_upload_path
(
$v
[
'swf'
]);
$v
[
'swf'
]
=
get_upload_path
(
$v
[
'swf'
]);
$carlist2
[
$v
[
'id'
]]
=
$v
;
$carlist2
[
$v
[
'id'
]]
=
$v
;
}
}
...
@@ -47,7 +47,7 @@ class EquipmentController extends HomebaseController {
...
@@ -47,7 +47,7 @@ class EquipmentController extends HomebaseController {
$nowtime
=
time
();
$nowtime
=
time
();
$Car_u
=
M
(
"users_car"
);
$Car_u
=
M
(
"users_car"
);
$user_carlist
=
$Car_u
->
where
(
"uid=
{
$uid
}
and endtime>
{
$nowtime
}
"
)
->
select
();
$user_carlist
=
$Car_u
->
where
(
"uid=
{
$uid
}
and endtime>
{
$nowtime
}
"
)
->
select
();
foreach
(
$user_carlist
as
$k
=>
$v
){
foreach
(
$user_carlist
as
$k
=>
$v
){
if
(
$carlist2
[
$v
[
'carid'
]]){
if
(
$carlist2
[
$v
[
'carid'
]]){
$user_carlist
[
$k
][
'carinfo'
]
=
$carlist2
[
$v
[
'carid'
]];
$user_carlist
[
$k
][
'carinfo'
]
=
$carlist2
[
$v
[
'carid'
]];
...
@@ -59,12 +59,12 @@ class EquipmentController extends HomebaseController {
...
@@ -59,12 +59,12 @@ class EquipmentController extends HomebaseController {
$this
->
assign
(
"user_carlist"
,
$user_carlist
);
$this
->
assign
(
"user_carlist"
,
$user_carlist
);
$this
->
display
();
$this
->
display
();
}
}
/* 设置靓号 */
/* 设置靓号 */
function
setliang
(){
function
setliang
(){
$rs
=
array
(
'code'
=>
0
,
'info'
=>
array
(),
'msg'
=>
'更换成功'
);
$rs
=
array
(
'code'
=>
0
,
'info'
=>
array
(),
'msg'
=>
'更换成功'
);
...
@@ -73,15 +73,15 @@ class EquipmentController extends HomebaseController {
...
@@ -73,15 +73,15 @@ class EquipmentController extends HomebaseController {
$liangid
=
I
(
"liangid"
);
$liangid
=
I
(
"liangid"
);
$state
=
I
(
"state"
);
$state
=
I
(
"state"
);
if
(
!
$uid
||
!
$token
||
checkToken
(
$uid
,
$token
)
==
700
){
if
(
!
$uid
||
!
$token
||
checkToken
(
$uid
,
$token
)
==
700
){
$rs
[
'code'
]
=
700
;
$rs
[
'code'
]
=
700
;
$rs
[
'msg'
]
=
'您的登陆状态失效,请重新登陆!'
;
$rs
[
'msg'
]
=
'您的登陆状态失效,请重新登陆!'
;
echo
json_encode
(
$rs
);
echo
json_encode
(
$rs
);
exit
;
exit
;
}
}
$Liang
=
M
(
"liang"
);
$Liang
=
M
(
"liang"
);
$isexist
=
$Liang
->
where
(
"uid=
{
$uid
}
and id=
{
$liangid
}
"
)
->
find
();
$isexist
=
$Liang
->
where
(
"uid=
{
$uid
}
and id=
{
$liangid
}
"
)
->
find
();
if
(
!
$isexist
){
if
(
!
$isexist
){
$rs
[
'code'
]
=
1001
;
$rs
[
'code'
]
=
1001
;
...
@@ -89,55 +89,56 @@ class EquipmentController extends HomebaseController {
...
@@ -89,55 +89,56 @@ class EquipmentController extends HomebaseController {
echo
json_encode
(
$rs
);
echo
json_encode
(
$rs
);
exit
;
exit
;
}
}
$Liang
->
where
(
"uid=
{
$uid
}
"
)
->
save
(
array
(
'state'
=>
0
)
);
// $Liang->where("uid={$uid}")->save(array('state'=>0) );
$setstatus
=
$state
?
0
:
1
;
// $setstatus=$state?0:1;
$setstatus
=
0
;
$data
=
array
(
$data
=
array
(
'state'
=>
$setstatus
,
'state'
=>
$setstatus
,
);
);
$list
=
$Liang
->
where
(
"uid=
{
$uid
}
and id=
{
$liangid
}
"
)
->
save
(
$data
);
$list
=
M
(
"liang"
)
->
where
(
"uid=
{
$uid
}
and id=
{
$liangid
}
"
)
->
save
(
$data
);
$Users
=
M
(
"users"
);
$Users
=
M
(
"users"
);
$goodnum
=
$isexist
[
'name'
];
$goodnum
=
$isexist
[
'name'
];
$key
=
'liang_'
.
$uid
;
$key
=
'liang_'
.
$uid
;
if
(
$setstatus
==
1
){
if
(
$setstatus
==
1
){
$Users
->
where
(
"id=
{
$uid
}
"
)
->
setField
(
"goodnum"
,
$goodnum
);
$Users
->
where
(
"id=
{
$uid
}
"
)
->
setField
(
"goodnum"
,
$goodnum
);
$isexist
=
M
(
"liang"
)
->
where
(
"uid=
{
$uid
}
and status=1 and state=1"
)
->
find
();
$isexist
=
M
(
"liang"
)
->
where
(
"uid=
{
$uid
}
and status=1 and state=1"
)
->
find
();
if
(
$isexist
){
if
(
$isexist
){
setcaches
(
$key
,
$isexist
);
setcaches
(
$key
,
$isexist
);
}
}
}
else
{
}
else
{
$Users
->
where
(
"id=
{
$uid
}
"
)
->
setField
(
"goodnum"
,
0
);
$Users
->
where
(
"id=
{
$uid
}
"
)
->
setField
(
"goodnum"
,
0
);
delcache
(
$key
);
delcache
(
$key
);
}
}
echo
json_encode
(
$rs
);
echo
json_encode
(
$rs
);
exit
;
exit
;
}
}
/* 装备坐骑 */
/* 装备坐骑 */
function
setcar
(){
function
setcar
(){
$uid
=
I
(
"uid"
);
$uid
=
I
(
"uid"
);
$token
=
I
(
"token"
);
$token
=
I
(
"token"
);
$carid
=
I
(
"carid"
);
$carid
=
I
(
"carid"
);
$status
=
I
(
"status"
);
$status
=
I
(
"status"
);
$rs
=
array
(
'code'
=>
0
,
'info'
=>
array
(),
'msg'
=>
'更换成功'
);
$rs
=
array
(
'code'
=>
0
,
'info'
=>
array
(),
'msg'
=>
'更换成功'
);
if
(
!
$uid
||
!
$token
||
checkToken
(
$uid
,
$token
)
==
700
){
if
(
!
$uid
||
!
$token
||
checkToken
(
$uid
,
$token
)
==
700
){
$rs
[
'code'
]
=
700
;
$rs
[
'code'
]
=
700
;
$rs
[
'msg'
]
=
'您的登陆状态失效,请重新登陆!'
;
$rs
[
'msg'
]
=
'您的登陆状态失效,请重新登陆!'
;
echo
json_encode
(
$rs
);
echo
json_encode
(
$rs
);
exit
;
exit
;
}
}
$setstatus
=
$status
?
0
:
1
;
//
$setstatus=$status?0:1;
$setstatus
=
0
;
$Car_u
=
M
(
"users_car"
);
$Car_u
=
M
(
"users_car"
);
$isexist
=
$Car_u
->
where
(
"uid=
{
$uid
}
and carid=
{
$carid
}
"
)
->
find
();
$isexist
=
$Car_u
->
where
(
"uid=
{
$uid
}
and carid=
{
$carid
}
"
)
->
find
();
if
(
!
$isexist
){
if
(
!
$isexist
){
$rs
[
'code'
]
=
1001
;
$rs
[
'code'
]
=
1001
;
...
@@ -146,18 +147,18 @@ class EquipmentController extends HomebaseController {
...
@@ -146,18 +147,18 @@ class EquipmentController extends HomebaseController {
exit
;
exit
;
}
}
$data1
=
array
(
// $data1=array(
'status'
=>
0
,
// 'status'=>0,
);
// );
$Car_u
->
where
(
"uid=
{
$uid
}
"
)
->
save
(
$data1
);
// $Car_u->where("uid={$uid}")->save($data1);
$data
=
array
(
$data
=
array
(
'status'
=>
$setstatus
,
'status'
=>
$setstatus
,
);
);
$result
=
$Car_u
->
where
(
"uid=
{
$uid
}
and carid=
{
$carid
}
"
)
->
save
(
$data
);
$result
=
M
(
"users_car"
)
->
where
(
"uid=
{
$uid
}
and carid=
{
$carid
}
"
)
->
save
(
$data
);
$key
=
'car_'
.
$uid
;
$key
=
'car_'
.
$uid
;
if
(
$setstatus
){
if
(
$setstatus
){
$isexist
=
M
(
"users_car"
)
->
where
(
"uid=
{
$uid
}
and status=1"
)
->
find
();
$isexist
=
M
(
"users_car"
)
->
where
(
"uid=
{
$uid
}
and status=1"
)
->
find
();
...
@@ -167,10 +168,10 @@ class EquipmentController extends HomebaseController {
...
@@ -167,10 +168,10 @@ class EquipmentController extends HomebaseController {
}
else
{
}
else
{
delcache
(
$key
);
delcache
(
$key
);
}
}
echo
json_encode
(
$rs
);
echo
json_encode
(
$rs
);
exit
;
exit
;
}
}
}
}
\ No newline at end of file
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