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
42f563aa
authored
Mar 30, 2021
by
朱继来
Browse files
Options
_('Browse Files')
Download
Plain Diff
merge
parents
89dc2c22
0e63f1a7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
8 deletions
app/Model/InquiryItemsModel.php
app/Model/InquiryItemsModel.php
View file @
42f563aa
...
...
@@ -391,7 +391,7 @@ class InquiryItemsModel extends Model
$con
->
beginTransaction
();
$assignInsert
=
[];
#指定领取人
$c
=
0
;
#重复
$c
opy
=
""
;
#重复型号
foreach
(
$goodsData
[
1
]
as
$k
=>&
$b
){
$insertArr
=
[
...
...
@@ -413,16 +413,11 @@ class InquiryItemsModel extends Model
#判断是否已经存在此品牌+型号
$check
=
$this
->
where
([
"inquiry_id"
=>
$inquiry_id
,
"goods_name"
=>
$b
[
"goods_name"
],
"brand_name"
=>
$b
[
"brand_name"
]])
->
count
();
if
(
$check
>
0
){
$c
++
;
$c
opy
=
$copy
.
$b
[
"goods_name"
]
.
","
;
continue
;
#throw new Exception("型号:".$b["goods_name"]." 品牌:".$b["brand_name"]."不得重复上传");
}
if
(
count
(
$goodsData
[
1
])
==
$c
){
throw
new
Exception
(
"所有数据都存在重复!"
);
}
#插入明细
$inquiryItemsId
=
$this
->
insertGetId
(
$insertArr
);
...
...
@@ -461,7 +456,7 @@ class InquiryItemsModel extends Model
$con
->
commit
();
return
[
0
,
'批量导入询价成功'
];
return
[
0
,
'批量导入询价成功'
.
(
$copy
==
""
?
""
:
",存在重复型号:"
.
$copy
)
];
}
catch
(
\Exception
$e
)
{
$con
->
rollBack
();
return
[
1001
,
"添加失败:"
.
$e
->
getMessage
()];
...
...
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