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
bb9ed0d9
authored
Mar 05, 2021
by
朱继来
Browse files
Options
_('Browse Files')
Download
Plain Diff
merge
parents
ea8e2f5f
d7438df8
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
114 additions
and
75 deletions
app/Http/Controllers/ApiController.php
app/Model/CommonModel.php
app/Model/InquiryItemsModel.php
app/Model/InquiryModel.php
app/Model/QuoteModel.php
app/Http/Controllers/ApiController.php
View file @
bb9ed0d9
...
...
@@ -71,7 +71,7 @@ class ApiController extends Controller
}
//创建询价明细
private
function
ApiCreateOneItems
(
$input
,
$id
){
Export
((
new
InquiryItemsModel
())
->
addItems
(
1
,[
$input
]
));
Export
((
new
InquiryItemsModel
())
->
addItems
(
$input
));
}
//更新询价明细
private
function
ApiUpdateOneItems
(
$input
,
$id
){
...
...
@@ -165,6 +165,11 @@ class ApiController extends Controller
{
Export
((
new
QuoteModel
())
->
import
(
$input
));
}
// 批量导入询价
public
function
ApiImportInquiry
(
$input
,
$id
)
{
Export
((
new
InquiryItemsModel
())
->
import
(
$input
));
}
// 删除报价草稿
public
function
ApiDeleteQuoteDraft
(
$input
,
$id
)
...
...
app/Model/CommonModel.php
View file @
bb9ed0d9
...
...
@@ -10,11 +10,44 @@ use DB;
class
CommonModel
extends
Model
{
//搜索联营品牌
public
function
BrandList
(
$k
)
public
function
BrandList
(
$k
,
$types
=
1
)
{
$brandInfo
=
DB
::
connection
(
"spu"
)
->
select
(
"select brand_id as value,brand_name as name from lie_brand where brand_name like '%"
.
$k
.
"%' limit 10"
);
echo
json_encode
(
$brandInfo
,
JSON_UNESCAPED_UNICODE
)
;
exit
();
$dbspu
=
DB
::
connection
(
"spu"
);
if
(
$types
==
1
)
{
#模糊搜索
$brandInfo
=
$dbspu
->
select
(
"select brand_id as value,brand_name as name from lie_brand where brand_name like '%"
.
$k
.
"%' limit 10"
);
echo
json_encode
(
$brandInfo
,
JSON_UNESCAPED_UNICODE
)
;
exit
();
}
else
{
$brandInfo
=
$dbspu
->
select
(
"select brand_id as brand_id,brand_name as name from lie_brand where brand_name = '"
.
$k
.
"' limit 1"
);
if
(
!
$brandInfo
){
return
false
;
}
else
{
return
$brandInfo
[
0
][
"brand_id"
];
}
}
}
/*
* 查询采购名称
*/
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"
);
echo
json_encode
(
$purInfo
,
JSON_UNESCAPED_UNICODE
)
;
exit
();
}
else
{
$k
=
explode
(
","
,
$k
);
$str
=
[];
foreach
(
$k
as
$k
=>
$b
){
$purInfo
=
$dbcms
->
select
(
"select userId as uid,name as user_name from user_info where name = '"
.
$b
.
"'"
);
if
(
!
$purInfo
){
return
false
;
}
array_push
(
$str
,[
"uid"
=>
$purInfo
[
0
][
"uid"
],
"user_name"
=>
$purInfo
[
0
][
"user_name"
]]);
}
return
$str
;
}
}
//导出pdf
...
...
@@ -48,14 +81,6 @@ class CommonModel extends Model
echo
json_encode
(
$temp
,
JSON_UNESCAPED_UNICODE
)
;
}
/*
* 查询采购名称
*/
public
function
UserList
(
$k
){
$purInfo
=
DB
::
connection
()
->
select
(
"select userId as value,name as name from user_info where name like '%"
.
$k
.
"%' limit 10"
);
echo
json_encode
(
$purInfo
,
JSON_UNESCAPED_UNICODE
)
;
}
// 搜索供应商
public
function
SupplierList
(
$k
)
{
...
...
app/Model/InquiryItemsModel.php
View file @
bb9ed0d9
This diff is collapsed.
Click to expand it.
app/Model/InquiryModel.php
View file @
bb9ed0d9
...
...
@@ -294,6 +294,15 @@ class InquiryModel extends Model
return
$inqueryId
;
}
//生成草稿id
public
function
FindInquirySn
(
$inquiry_id
=
''
){
$result
=
$this
->
where
(
'id'
,
'='
,
$inquiry_id
)
->
select
(
'inquiry_sn'
)
->
first
();
if
(
!
$result
){
return
false
;
}
else
{
return
$result
->
inquiry_sn
;
}
}
...
...
app/Model/QuoteModel.php
View file @
bb9ed0d9
This diff is collapsed.
Click to expand it.
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