切换导航条
此项目
正在载入...
登录
郭盛
/
areial
·
提交
转到一个项目
GitLab
转到仪表盘
项目
活动
文件
提交
管道
0
构建
0
图表
里程碑
问题
0
合并请求
0
成员
标记
维基
派生
网络
创建新的问题
下载为
邮件补丁
差异文件
浏览文件
作者
郭盛
5 years ago
提交
f7449cf24a054ca351f4a2166431fb5e586a5ec6
1 个父辈
054db25e
1 个管道 的构建
通过
耗费 4 秒
修改全部订单
变更
1
构建
1
隐藏空白字符变更
内嵌
并排对比
正在显示
1 个修改的文件
包含
118 行增加
和
35 行删除
application/admin/controller/OrderDetail.php
application/admin/controller/OrderDetail.php
查看文件 @
f7449cf
...
...
@@ -50,48 +50,131 @@ class OrderDetail extends Backend
return
$this
->
selectpage
();
}
list
(
$where
,
$sort
,
$order
,
$offset
,
$limit
)
=
$this
->
buildparams
();
$total
=
$this
->
model
->
with
([
'user'
])
->
where
(
'user_id'
,
$ids
)
->
where
(
$where
)
->
order
(
$sort
,
$order
)
->
count
();
$list
=
$this
->
model
->
with
([
'user'
])
->
where
(
'user_id'
,
$ids
)
->
where
(
$where
)
->
order
(
$sort
,
$order
)
->
limit
(
$offset
,
$limit
)
->
select
();
$list
=
collection
(
$list
)
->
toArray
();
$type
=
new
\app\admin\model\Pic
();
$video
=
new
\app\admin\model\Video
();
foreach
(
$list
as
&
$v
){
$type_ids
=
$type
->
whereIn
(
'id'
,
$v
[
'pic_id'
])
->
column
(
'title'
);
if
(
!
empty
(
$v
[
'video_id'
])){
$a
=
[];
$v
[
'video_id'
]
=
unserialize
(
$v
[
'video_id'
]);
foreach
(
$v
[
'video_id'
]
as
&
$v1
){
$user
=
Db
::
name
(
'user'
)
->
where
(
'id'
,
$ids
)
->
find
();
if
(
$user
[
'type'
]
==
1
){
$type
=
new
\app\admin\model\Pic
();
$video
=
new
\app\admin\model\Video
();
//以往购买的订单
$one
=
Db
::
name
(
'order'
)
->
where
(
'status'
,
2
)
->
where
(
'user_id'
,
$ids
)
->
count
();
$one_info
=
Db
::
name
(
'order'
)
->
where
(
'status'
,
2
)
->
where
(
'user_id'
,
$ids
)
->
field
(
'createtime,paytime,shou_status,invoice_status'
,
true
)
->
select
();
foreach
(
$one_info
as
&
$v
){
$type_ids
=
$type
->
whereIn
(
'id'
,
$v
[
'pic_id'
])
->
column
(
'title'
);
if
(
!
empty
(
$v
[
'video_id'
])){
$a
=
[];
$v
[
'video_id'
]
=
unserialize
(
$v
[
'video_id'
]);
foreach
(
$v
[
'video_id'
]
as
&
$v1
){
//获取视频标题
$v1
[
'id'
]
=
$video
->
where
(
'id'
,
$v1
[
'id'
])
->
column
(
'title'
);
//判断视频属性
if
(
$v1
[
'attr'
]
==
1
){
$v1
[
'attr'
]
=
'2k'
;
}
elseif
(
$v1
[
'attr'
]
==
2
){
$v1
[
'attr'
]
=
'4k'
;
}
else
{
$v1
[
'attr'
]
=
'8k'
;
}
array_push
(
$a
,
$v1
[
'id'
]);
}
$v
[
'video_id'
]
=
$a
;
}
$v
[
'pic_id'
]
=
trim
(
implode
(
','
,
$type_ids
),
','
);
}
//苹果登录后的订单
$two
=
Db
::
name
(
'iphone'
)
->
where
(
'status'
,
2
)
->
where
(
'user_id'
,
$ids
)
->
count
();
$two_info
=
Db
::
name
(
'iphone'
)
->
where
(
'status'
,
2
)
->
where
(
'user_id'
,
$ids
)
->
field
(
'createtime,updatetime'
,
true
)
->
select
();
foreach
(
$two_info
as
&
$v
){
$type_ids
=
$type
->
whereIn
(
'id'
,
$v
[
'pic_id'
])
->
column
(
'title'
);
if
(
!
empty
(
$v
[
'video_id'
])){
$a
=
[];
$v
[
'video_id'
]
=
unserialize
(
$v
[
'video_id'
]);
//获取视频标题
$v
1
[
'id'
]
=
$video
->
where
(
'id'
,
$v1
[
'id'
])
->
column
(
'title'
);
$v
[
'video_id'
][
'id'
]
=
$video
->
where
(
'id'
,
$v
[
'video_id'
]
[
'id'
])
->
column
(
'title'
);
//判断视频属性
if
(
$v1
[
'attr'
]
==
1
){
$v1
[
'attr'
]
=
'2k'
;
}
elseif
(
$v1
[
'attr'
]
==
2
){
$v1
[
'attr'
]
=
'4k'
;
if
(
$v
[
'video_id'
][
'attr'
]
==
1
){
$v
[
'video_id'
][
'attr'
]
=
'2k'
;
}
elseif
(
$v
[
'video_id'
][
'attr'
]
==
2
){
$v
[
'video_id'
][
'attr'
]
=
'4k'
;
}
else
{
$v
1
[
'attr'
]
=
'8k'
;
$v
[
'video_id'
]
[
'attr'
]
=
'8k'
;
}
array_push
(
$a
,
$v1
[
'id'
]);
array_push
(
$a
,
$v
[
'video_id'
][
'id'
]);
$v
[
'video_id'
]
=
$a
;
}
$v
[
'
video_id'
]
=
$a
;
$v
[
'
pic_id'
]
=
trim
(
implode
(
','
,
$type_ids
),
','
)
;
}
$v
[
'pic_id'
]
=
trim
(
implode
(
','
,
$type_ids
),
','
);
$total
=
$one
+
$two
;
//总条数
$list
=
array_merge
(
$one_info
,
$two_info
);
$result
=
array
(
"total"
=>
$total
,
"rows"
=>
$list
);
return
json
(
$result
);
}
else
{
$total
=
$this
->
model
->
with
([
'user'
])
->
where
(
'user_id'
,
$ids
)
->
where
(
$where
)
->
order
(
$sort
,
$order
)
->
count
();
$list
=
$this
->
model
->
with
([
'user'
])
->
where
(
'user_id'
,
$ids
)
->
where
(
$where
)
->
order
(
$sort
,
$order
)
->
limit
(
$offset
,
$limit
)
->
select
();
$list
=
collection
(
$list
)
->
toArray
();
$type
=
new
\app\admin\model\Pic
();
$video
=
new
\app\admin\model\Video
();
foreach
(
$list
as
&
$v
){
$type_ids
=
$type
->
whereIn
(
'id'
,
$v
[
'pic_id'
])
->
column
(
'title'
);
if
(
!
empty
(
$v
[
'video_id'
])){
$a
=
[];
$v
[
'video_id'
]
=
unserialize
(
$v
[
'video_id'
]);
foreach
(
$v
[
'video_id'
]
as
&
$v1
){
//获取视频标题
$v1
[
'id'
]
=
$video
->
where
(
'id'
,
$v1
[
'id'
])
->
column
(
'title'
);
//判断视频属性
if
(
$v1
[
'attr'
]
==
1
){
$v1
[
'attr'
]
=
'2k'
;
}
elseif
(
$v1
[
'attr'
]
==
2
){
$v1
[
'attr'
]
=
'4k'
;
}
else
{
$v1
[
'attr'
]
=
'8k'
;
}
array_push
(
$a
,
$v1
[
'id'
]);
}
$v
[
'video_id'
]
=
$a
;
}
$v
[
'pic_id'
]
=
trim
(
implode
(
','
,
$type_ids
),
','
);
}
$result
=
array
(
"total"
=>
$total
,
"rows"
=>
$list
);
return
json
(
$result
);
}
$result
=
array
(
"total"
=>
$total
,
"rows"
=>
$list
);
return
json
(
$result
);
}
$this
->
assignconfig
(
'ids'
,
$ids
);
return
$this
->
view
->
fetch
();
...
...
请
注册
或
登录
后发表评论