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
ce43f6b7
authored
Mar 29, 2021
by
朱继来
Browse files
Options
_('Browse Files')
Download
Plain Diff
m
parents
a9cbebe2
31357a21
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
2 deletions
app/Http/Controllers/ApiController.php
app/Model/InquiryItemsModel.php
app/Http/Controllers/ApiController.php
View file @
ce43f6b7
...
...
@@ -247,4 +247,10 @@ class ApiController extends Controller
Export
((
new
InquiryItemsReportModel
())
->
checkOrder
(
$input
));
}
// 检测是否存在已经存在的询价单
public
function
ApiCheckGoods
(
$input
,
$id
)
{
Export
((
new
InquiryItemsModel
())
->
checkGoods
(
$input
));
}
}
app/Model/InquiryItemsModel.php
View file @
ce43f6b7
...
...
@@ -224,7 +224,7 @@ class InquiryItemsModel extends Model
if
(
$b
[
"pur_s"
]
!==
""
){
$purArr
=
json_decode
(
$b
[
"pur_s"
],
true
);
$assignInsert
=
[];
#指定领取人
foreach
(
$purArr
as
$
b
=>
$c
){
foreach
(
$purArr
as
$
f
=>
$c
){
array_push
(
$assignInsert
,[
"inquiry_items_id"
=>
$inquiryItemsId
,
"assign_uid"
=>
$c
[
"uid"
],
...
...
@@ -242,7 +242,7 @@ class InquiryItemsModel extends Model
'types'
=>
1
,
'relation_id'
=>
$inquiryItemsId
,
#明细id
'relation_sn'
=>
(
new
InquiryModel
())
->
FindInquirySn
(
$b
[
"inquiry_id"
]),
'content'
=>
'
批量导入
询价'
,
'content'
=>
'
单个添加
询价'
,
'create_uid'
=>
$b
[
'user_id'
],
'create_name'
=>
$b
[
"user_name"
],
]);
...
...
@@ -520,6 +520,28 @@ class InquiryItemsModel extends Model
return
count
(
$err
)
==
0
?
[
0
,
$goodsInfo
]
:
[
1
,
implode
(
'; '
,
$err
)];
}
/*
* 检测是否存在已经存在的询价单
*/
public
function
checkGoods
(
$input
){
if
(
empty
(
$input
[
"inquiry_id"
]))
return
[
1003
,
"询价单ID不得为空"
];
if
(
empty
(
$input
[
"brand_s"
]))
return
[
1003
,
"请选择品牌名称名称"
];
if
(
empty
(
$input
[
"inquiry_number"
]))
return
[
1003
,
"请输入询价数量"
];
if
(
empty
(
$input
[
"batch"
]))
return
[
1003
,
"请输入批次要求"
];
if
(
empty
(
$input
[
"delivery_time"
]))
return
[
1003
,
"请选择交货日期"
];
$brandInfo
=
json_decode
(
$input
[
"brand_s"
],
true
);
$check
=
$this
->
select
(
"inquiry_id"
)
->
where
([
"goods_name"
=>
$input
[
"goods_name"
],
"inquiry_number"
=>
$input
[
"inquiry_number"
],
"brand_name"
=>
$brandInfo
[
0
][
"brand_name"
]])
->
whereRaw
(
"create_time > "
.
strtotime
(
date
(
'Y-m-d'
)))
->
first
();
if
(
$check
){
$user_name
=
(
new
InquiryModel
())
->
where
(
"id"
,
$check
->
inquiry_id
)
->
value
(
"user_name"
);
return
[
1001
,
"此型号 "
.
$user_name
.
" 在询,仍然询价吗?"
];
}
return
[
0
,
"通过"
];
}
}
\ No newline at end of file
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