Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
黄成意
/
php_frq_api
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
c6eef749
authored
May 14, 2021
by
朱继来
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
调整采购接口
parent
5061ce52
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
3 deletions
app/Model/CommonModel.php
app/Model/CommonModel.php
View file @
c6eef749
...
...
@@ -7,6 +7,7 @@ use Request;
use
DB
;
use
App\Model\CmsModel
;
use
App\Model\Mongo\SpuModel
;
use
App\Http\Controllers\PermController
;
//公共模型
class
CommonModel
extends
Model
...
...
@@ -86,10 +87,27 @@ class CommonModel extends Model
/*
* 查询采购名称
*/
public
function
UserList
(
$k
,
$types
=
1
){
public
function
UserList
(
$k
,
$types
=
1
)
{
$dbcms
=
DB
::
connection
();
if
(
$types
==
1
)
{
#模糊搜索
$purInfo
=
$dbcms
->
select
(
"select userId as value,name as name from user_info where name like '%"
.
$k
.
"%' limit 10"
);
if
(
$types
==
1
)
{
#模糊搜索
$perm
=
new
PermController
;
$perm
->
getSubDepartmentId
(
8
,
$department_ids
);
// 获取采购所有部门
$CmsModel
=
new
CmsModel
;
$purInfo
=
$CmsModel
->
where
(
'status'
,
0
)
->
whereIn
(
'department_id'
,
$department_ids
)
->
where
(
function
(
$query
)
use
(
$k
)
{
if
(
$k
)
{
$query
->
where
(
'name'
,
'like'
,
'%'
.
$k
.
'%'
);
}
})
->
select
(
'userId as value'
,
'name'
)
->
get
()
->
toArray
();
// $purInfo = $dbcms->select("select userId as value,name as name from user_info where department_id in (".json_encode($department_ids).") and status = 0 and name like '%".$k."%'");
echo
json_encode
(
$purInfo
,
JSON_UNESCAPED_UNICODE
)
;
exit
();
}
else
{
...
...
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