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
You need to sign in or sign up before continuing.
Commit
aba2da9a
authored
Mar 08, 2021
by
hcy001
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
1
parent
a1652186
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
8 deletions
app/Model/InquiryItemsReportModel.php
app/Model/InquiryItemsReportModel.php
View file @
aba2da9a
...
...
@@ -27,15 +27,12 @@ class InquiryItemsReportModel extends Model
$con
=
DB
::
connection
(
'rfq'
);
$con
->
beginTransaction
();
$report_sn
=
generateSnWithPreStringShort
(
"R"
);
//报表单号
$inquiry_id
=
$input
[
"inquiry_id"
];
$currency
=
$input
[
"currency"
];
#币种
$insertArr
=
[];
//批量插入数组
foreach
(
$input
[
"items"
]
as
$k
=>
$inquiry_items_id
){
$temp
=
[
"types"
=>
$types
,
"report_sn"
=>
$report_sn
,
"inquiry_id"
=>
$inquiry_id
,
"inquiry_items_id"
=>
$inquiry_items_id
,
"goods_name"
=>@
$input
[
"goods_name"
][
$k
]
?
$input
[
"goods_name"
][
$k
]
:
""
,
...
...
@@ -62,18 +59,18 @@ class InquiryItemsReportModel extends Model
$this
->
insert
(
$insertArr
);
//批量插入
$con
->
commit
();
return
[
0
,
"成功"
,[
"
report_sn"
=>
$report_sn
]];
return
[
0
,
"成功"
,[
"
inquiry_id"
=>
$inquiry_id
]];
}
catch
(
\Exception
$e
)
{
return
[
1001
,
"提交失败,请重试!"
.
$e
->
getMessage
()];
}
}
//生成报价pdf
public
function
createSalePdf
(
$
report_sn
=
""
){
if
(
$
report_sn
==
""
){
return
[
1001
,
"
报表
单号不得为空!"
];
public
function
createSalePdf
(
$
inquiry_id
=
""
){
if
(
$
inquiry_id
==
""
){
return
[
1001
,
"
询价
单号不得为空!"
];
}
$itemsArr
=
$this
->
where
(
"
report_sn"
,
$report_sn
)
->
get
()
->
toArray
();
$itemsArr
=
$this
->
where
(
"
inquiry_id"
,
$inquiry_id
)
->
get
()
->
toArray
();
$quote_price_count
=
0
;
foreach
(
$itemsArr
as
$k
=>&
$v
){
$v
[
"quote_account"
]
=
$v
[
"price_rmb"
]
>
0
?
$v
[
"price_rmb"
]
*
$v
[
"inquiry_number"
]
:
$v
[
"price_origin"
]
*
$v
[
"inquiry_number"
];
...
...
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