切换导航条
此项目
正在载入...
登录
郭盛
/
areial
·
提交
转到一个项目
GitLab
转到仪表盘
项目
活动
文件
提交
管道
0
构建
0
图表
里程碑
问题
0
合并请求
0
成员
标记
维基
派生
网络
创建新的问题
下载为
邮件补丁
差异文件
浏览文件
作者
郭盛
5 years ago
提交
30f8ad13331e8fa06ab3870ccd4528a35902da03
1 个父辈
7c6eaf64
1 个管道 的构建
通过
耗费 1 秒
订单支付回调调试
变更
1
构建
1
隐藏空白字符变更
内嵌
并排对比
正在显示
1 个修改的文件
包含
72 行增加
和
37 行删除
application/api/controller/User.php
application/api/controller/User.php
查看文件 @
30f8ad1
...
...
@@ -283,46 +283,44 @@ class User extends Api
unset
(
$shu
[
$k
]);
}
}
//定义一个空数组
$ids
=
[];
foreach
(
$shu
as
&
$v
){
$id1
=
Db
::
name
(
'video'
)
->
where
(
'keyword'
,
'like'
,
"%
$v
%"
)
->
whereOr
(
'title'
,
'like'
,
"%
$v
%"
)
->
column
(
'id'
);
foreach
(
$id1
as
$val
){
array_push
(
$ids
,
$val
);
}
$id2
=
Db
::
name
(
'words'
)
->
where
(
'name'
,
$v
)
->
field
(
'id,type'
)
->
find
();
if
(
!
empty
(
$id2
)){
if
(
$id2
[
'type'
]
==
1
){
$a
=
Db
::
name
(
'video'
)
->
where
(
'address_ids'
,
'like'
,
'%,'
.
$id2
[
'id'
]
.
',%'
)
->
order
(
'is_show desc'
)
->
column
(
'id'
);
}
elseif
(
$id2
[
'type'
]
==
2
){
$a
=
Db
::
name
(
'video'
)
->
where
(
'text_ids'
,
'like'
,
'%,'
.
$id2
[
'id'
]
.
',%'
)
->
order
(
'is_show desc'
)
->
column
(
'id'
);
}
foreach
(
$a
as
$val
){
if
(
$param
[
'type_id'
]
==
1
){
//定义一个空数组
$ids
=
[];
foreach
(
$shu
as
&
$v
){
$id1
=
Db
::
name
(
'video'
)
->
where
(
'keyword'
,
'like'
,
"%
$v
%"
)
->
whereOr
(
'title'
,
'like'
,
"%
$v
%"
)
->
column
(
'id'
);
foreach
(
$id1
as
$val
){
array_push
(
$ids
,
$val
);
}
$id2
=
Db
::
name
(
'words'
)
->
where
(
'name'
,
$v
)
->
field
(
'id,type'
)
->
find
();
if
(
!
empty
(
$id2
)){
if
(
$id2
[
'type'
]
==
1
){
$a
=
Db
::
name
(
'video'
)
->
where
(
'address_ids'
,
'like'
,
'%,'
.
$id2
[
'id'
]
.
',%'
)
->
order
(
'is_show desc'
)
->
column
(
'id'
);
}
elseif
(
$id2
[
'type'
]
==
2
){
$a
=
Db
::
name
(
'video'
)
->
where
(
'text_ids'
,
'like'
,
'%,'
.
$id2
[
'id'
]
.
',%'
)
->
order
(
'is_show desc'
)
->
column
(
'id'
);
}
foreach
(
$a
as
$val
){
array_push
(
$ids
,
$val
);
}
}
}
$ids2
=
array_unique
(
$ids
);
if
(
$ids2
===
$ids
){
$result
=
$ids
;
}
else
{
$result
=
array_diff_assoc
(
$ids
,
$ids2
);
}
}
$ids2
=
array_unique
(
$ids
);
if
(
$ids2
===
$ids
){
$result
=
$ids
;
}
else
{
$result
=
array_diff_assoc
(
$ids
,
$ids2
);
}
if
(
$param
[
'type_id'
]
==
1
){
$data
=
Db
::
name
(
'video'
)
->
whereIn
(
'id'
,
$result
)
->
field
(
'id,title,thumbnail'
)
...
...
@@ -334,6 +332,43 @@ class User extends Api
}
$this
->
success
(
'success'
,
$data
);
}
else
{
//定义一个空数组
$ids
=
[];
foreach
(
$shu
as
&
$v
){
$id1
=
Db
::
name
(
'pic'
)
->
where
(
'keyword'
,
'like'
,
"%
$v
%"
)
->
whereOr
(
'title'
,
'like'
,
"%
$v
%"
)
->
column
(
'id'
);
foreach
(
$id1
as
$val
){
array_push
(
$ids
,
$val
);
}
$id2
=
Db
::
name
(
'words'
)
->
where
(
'name'
,
$v
)
->
field
(
'id,type'
)
->
find
();
if
(
!
empty
(
$id2
)){
if
(
$id2
[
'type'
]
==
1
){
$a
=
Db
::
name
(
'pic'
)
->
where
(
'address_ids'
,
'like'
,
'%,'
.
$id2
[
'id'
]
.
',%'
)
->
order
(
'is_show desc'
)
->
column
(
'id'
);
}
elseif
(
$id2
[
'type'
]
==
2
){
$a
=
Db
::
name
(
'pic'
)
->
where
(
'text_ids'
,
'like'
,
'%,'
.
$id2
[
'id'
]
.
',%'
)
->
order
(
'is_show desc'
)
->
column
(
'id'
);
}
foreach
(
$a
as
$val
){
array_push
(
$ids
,
$val
);
}
}
}
$ids2
=
array_unique
(
$ids
);
if
(
$ids2
===
$ids
){
$result
=
$ids
;
}
else
{
$result
=
array_diff_assoc
(
$ids
,
$ids2
);
}
$data
=
Db
::
name
(
'pic'
)
->
whereIn
(
'id'
,
$result
)
->
field
(
'id,title,thumbnail'
)
...
...
请
注册
或
登录
后发表评论