切换导航条
此项目
正在载入...
登录
郭盛
/
enterprise
·
提交
转到一个项目
GitLab
转到仪表盘
项目
活动
文件
提交
管道
0
构建
0
图表
里程碑
问题
0
合并请求
0
成员
标记
维基
派生
网络
创建新的问题
下载为
差异文件
浏览文件
作者
何书鹏
4 years ago
提交
351144bba19a1c3b150c575f400e297bb424e103
2 个父辈
fef1c533
4da59531
1 个管道 的构建
通过
耗费 1 秒
合并分支 'heshupeng' 到 'master'
代码完善 查看合并请求
!165
变更
3
构建
1
隐藏空白字符变更
内嵌
并排对比
正在显示
3 个修改的文件
包含
37 行增加
和
7 行删除
application/admin/view/mobile/statistic/index.html
application/mobile/controller/Course.php
application/mobile/controller/Secret.php
application/admin/view/mobile/statistic/index.html
查看文件 @
351144b
...
...
@@ -4,7 +4,7 @@
{:build_heading(null,FALSE)}
<ul
class=
"nav nav-tabs"
data-field=
"type"
>
{foreach name="typeList" item="vo"}
<li><a
href=
"#{$key}"
data-value=
"{$key}"
data-toggle=
"tab"
>
{$vo}
</a></li>
<li
{
in
name=
"key"
value=
"day"
}
class=
"active"
{/
in
}
><a
href=
"#{$key}"
data-value=
"{$key}"
data-toggle=
"tab"
>
{$vo}
</a></li>
{/foreach}
</ul>
</div>
...
...
application/mobile/controller/Course.php
查看文件 @
351144b
...
...
@@ -221,7 +221,35 @@ class Course extends Api
$v
[
'childlist'
]
=
$childlist
;
}
// 是否已购买
$order
=
CourseOrder
::
where
(
'user_id'
,
$this
->
auth
->
id
)
// 我加入的企业购买是否购买了此课程
$company_course_list
=
CourseOrder
::
alias
(
'a'
)
->
join
(
'mobile_company_user b'
,
'b.company_id = a.company_id'
)
->
join
(
'user c'
,
'c.id = b.user_id'
)
->
where
(
'a.course_id'
,
$course_id
)
->
where
(
'b.user_id'
,
$this
->
auth
->
id
)
->
where
(
'b.status'
,
'1'
)
->
where
(
'c.group_id'
,
1
)
->
field
(
'a.id,a.company_id,a.people_num,a.is_top'
)
->
select
();
// 查询我是否可以享受企业课程(按企业审核时间排队,没在队伍里就无法享受企业课程)
$order_id_arr
=
[];
foreach
(
$company_course_list
as
$v
)
{
if
(
$v
[
'is_top'
]
==
'1'
){
$order_id_arr
[]
=
$v
[
'id'
];
continue
;
}
$user_id_arr
=
CompanyUser
::
where
(
'company_id'
,
$v
[
'company_id'
])
->
where
(
'status'
,
'1'
)
->
order
(
'updatetime asc'
)
->
limit
(
$v
[
'people_num'
])
->
column
(
'user_id'
);
if
(
in_array
(
$this
->
auth
->
id
,
$user_id_arr
)){
$order_id_arr
[]
=
$v
[
'id'
];
}
}
$order
=
CourseOrder
::
where
(
function
(
$query
)
use
(
$order_id_arr
){
$query
->
where
(
'user_id'
,
$this
->
auth
->
id
)
->
whereor
(
'id'
,
'in'
,
$order_id_arr
);
})
->
where
(
'course_id'
,
$course_id
)
->
where
(
'pay_status'
,
'1'
)
->
field
(
'id'
)
...
...
application/mobile/controller/Secret.php
查看文件 @
351144b
...
...
@@ -53,15 +53,17 @@ class Secret extends Api
// 我加入的企业购买的密卷
$company_secret_list
=
SecretOrder
::
alias
(
'a'
)
->
join
(
'mobile_company_user b'
,
'b.company_id = a.company_id'
)
->
join
(
'user c'
,
'c.id = b.user_id'
)
->
where
(
'b.user_id'
,
$this
->
auth
->
id
)
->
where
(
'b.status'
,
'1'
)
->
where
(
'c.group_id'
,
1
)
->
field
(
'a.id,a.company_id,a.people_num,a.is_top'
)
->
select
();
// 查询我是否可以享受企业密卷(按企业审核时间排队,没在队伍里就无法享受企业密卷)
$
secret
_id_arr
=
[];
$
order
_id_arr
=
[];
foreach
(
$company_secret_list
as
$v
)
{
if
(
$v
[
'is_top'
]
==
'1'
){
$
secret
_id_arr
[]
=
$v
[
'id'
];
$
order
_id_arr
[]
=
$v
[
'id'
];
continue
;
}
$user_id_arr
=
CompanyUser
::
where
(
'company_id'
,
$v
[
'company_id'
])
...
...
@@ -70,12 +72,12 @@ class Secret extends Api
->
limit
(
$v
[
'people_num'
])
->
column
(
'user_id'
);
if
(
in_array
(
$this
->
auth
->
id
,
$user_id_arr
)){
$
secret
_id_arr
[]
=
$v
[
'id'
];
$
order
_id_arr
[]
=
$v
[
'id'
];
}
}
// 查找所有我购买的和企业购买的密卷
$secret_order
=
SecretOrder
::
where
(
function
(
$query
)
use
(
$secret_id_arr
){
$query
->
where
(
'user_id'
,
$this
->
auth
->
id
)
->
whereor
(
'id'
,
'in'
,
$secret_id_arr
);
$secret_order
=
SecretOrder
::
where
(
function
(
$query
)
use
(
$order_id_arr
){
$query
->
where
(
'user_id'
,
$this
->
auth
->
id
)
->
whereor
(
'id'
,
'in'
,
$order_id_arr
);
})
->
where
(
'pay_status'
,
'1'
)
->
limit
(
1
)
...
...
请
注册
或
登录
后发表评论