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
3e65b700
authored
Mar 29, 2021
by
hcy001
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
1
parent
cd739cc9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
0 deletions
app/Model/InquiryItemsModel.php
app/Model/InquiryItemsModel.php
View file @
3e65b700
...
...
@@ -189,12 +189,19 @@ class InquiryItemsModel extends Model
if
(
empty
(
$b
[
"batch"
]))
return
[
1003
,
"请输入批次要求"
];
if
(
empty
(
$b
[
"delivery_time"
]))
return
[
1003
,
"请选择交货日期"
];
try
{
$con
=
DB
::
connection
(
'rfq'
);
$con
->
beginTransaction
();
#插入明细
$brandInfo
=
json_decode
(
$b
[
"brand_s"
],
true
);
$check
=
$this
->
where
([
"inquiry_id"
=>
$b
[
"inquiry_id"
],
"goods_name"
=>
$b
[
"goods_name"
],
"brand_name"
=>
$brandInfo
[
0
][
"name"
]])
->
count
();
if
(
$check
>
0
){
throw
new
Exception
(
"已存在重复此型号品牌!"
);
}
$insertArr
=
[
"inquiry_id"
=>
$b
[
"inquiry_id"
]
,
"goods_name"
=>@
$b
[
"goods_name"
]
?
$b
[
"goods_name"
]
:
""
,
...
...
@@ -531,6 +538,11 @@ class InquiryItemsModel extends Model
if
(
empty
(
$input
[
"delivery_time"
]))
return
[
1003
,
"请选择交货日期"
];
$brandInfo
=
json_decode
(
$input
[
"brand_s"
],
true
);
$check
=
$this
->
where
([
"inquiry_id"
=>
$input
[
"inquiry_id"
],
"goods_name"
=>
$input
[
"goods_name"
],
"brand_name"
=>
$brandInfo
[
0
][
"name"
]])
->
count
();
if
(
$check
>
0
){
return
[
1003
,
"重复数据,已存在此型号品牌"
];
}
$check
=
$this
->
select
(
"inquiry_id"
)
->
where
([
"goods_name"
=>
$input
[
"goods_name"
],
"inquiry_number"
=>
$input
[
"inquiry_number"
],
"brand_name"
=>
$brandInfo
[
0
][
"brand_name"
]])
...
...
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