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
17d4adeb
authored
Mar 31, 2021
by
hcy001
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
1
parent
143a8bfc
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
11 deletions
app/Model/InquiryItemsReportModel.php
resources/views/pdf/sale.blade.php
app/Model/InquiryItemsReportModel.php
View file @
17d4adeb
...
@@ -32,6 +32,7 @@ class InquiryItemsReportModel extends Model
...
@@ -32,6 +32,7 @@ class InquiryItemsReportModel extends Model
try
{
try
{
$con
=
DB
::
connection
(
'rfq'
);
$con
=
DB
::
connection
(
'rfq'
);
$con
->
beginTransaction
();
$con
->
beginTransaction
();
$InquiryUsersModel
=
new
InquiryUsersModel
();
#更新客户资料
#更新客户资料
$user
=
[
$user
=
[
...
@@ -40,13 +41,25 @@ class InquiryItemsReportModel extends Model
...
@@ -40,13 +41,25 @@ class InquiryItemsReportModel extends Model
"fax"
=>
$input
[
"fax"
],
"fax"
=>
$input
[
"fax"
],
"tel"
=>
$input
[
"tel"
],
"tel"
=>
$input
[
"tel"
],
];
];
$InquiryUsersModel
->
where
(
"id"
,
$input
[
"com_id"
])
->
update
(
$user
);
(
new
InquiryUsersModel
())
->
where
(
"id"
,
$input
[
"com_id"
])
->
update
(
$user
);
#添加销售资料
$user2
=
[
"types"
=>
2
,
"user_name"
=>
$input
[
"sale_user_name"
],
"contact"
=>
$input
[
"sale_contact"
],
"fax"
=>
$input
[
"sale_fax"
],
"tel"
=>
$input
[
"sale_tel"
],
];
$sale_user_id
=
$InquiryUsersModel
->
where
(
$user2
)
->
value
(
"id"
);
if
(
!
$sale_user_id
){
$sale_user_id
=
$InquiryUsersModel
->
insertGetId
(
$user2
);
}
#更新报价明细
#更新报价明细
foreach
(
$input
[
"items"
]
as
$k
=>
$inquiry_items_id
){
foreach
(
$input
[
"items"
]
as
$k
=>
$inquiry_items_id
){
$temp
=
[
$temp
=
[
"inquiry_id"
=>
$inquiry_id
,
"inquiry_id"
=>
$inquiry_id
,
"sale_user_id"
=>
$sale_user_id
,
"inquiry_items_id"
=>
$inquiry_items_id
,
"inquiry_items_id"
=>
$inquiry_items_id
,
"goods_name"
=>@
$input
[
"goods_name"
][
$k
]
?
$input
[
"goods_name"
][
$k
]
:
""
,
"goods_name"
=>@
$input
[
"goods_name"
][
$k
]
?
$input
[
"goods_name"
][
$k
]
:
""
,
"goods_name_pro"
=>@
$input
[
"goods_name_pro"
][
$k
]
?
$input
[
"goods_name_pro"
][
$k
]
:
""
,
"goods_name_pro"
=>@
$input
[
"goods_name_pro"
][
$k
]
?
$input
[
"goods_name_pro"
][
$k
]
:
""
,
...
@@ -82,18 +95,19 @@ class InquiryItemsReportModel extends Model
...
@@ -82,18 +95,19 @@ class InquiryItemsReportModel extends Model
if
(
$inquiry_id
==
""
){
if
(
$inquiry_id
==
""
){
return
[
1001
,
"询价单号不得为空!"
];
return
[
1001
,
"询价单号不得为空!"
];
}
}
$InquiryUsersModel
=
new
InquiryUsersModel
();
#主表信息
#主表信息
$mainArr
=
(
new
InquiryModel
())
->
where
(
"id"
,
$inquiry_id
)
->
first
()
->
toArray
();
$mainArr
=
(
new
InquiryModel
())
->
where
(
"id"
,
$inquiry_id
)
->
first
()
->
toArray
();
#本公司信息
$company_info_origin
=
Config
(
"website.company_info_origin"
);
$data
[
"company"
]
=
$company_info_origin
[
$mainArr
[
"delivery_place"
]];
#公司信息
#客户信息
#客户信息
$data
[
"user"
]
=
(
new
InquiryUsersModel
())
->
where
(
"id"
,
$mainArr
[
"user_id"
])
->
first
()
->
toArray
();
$data
[
"user"
]
=
$InquiryUsersModel
->
where
(
"id"
,
$mainArr
[
"user_id"
])
->
first
()
->
toArray
();
#
询价
明细
#
报表
明细
$itemsArr
=
$this
->
whereIn
(
"inquiry_items_id"
,
explode
(
","
,
$inquiry_items_ids
))
->
get
()
->
toArray
();
$itemsArr
=
$this
->
whereIn
(
"inquiry_items_id"
,
explode
(
","
,
$inquiry_items_ids
))
->
get
()
->
toArray
();
#查询销售资料
$data
[
"company"
]
=
$InquiryUsersModel
->
where
(
"id"
,
$itemsArr
[
0
][
"sale_user_id"
])
->
first
()
->
toArray
();
$quote_price_count
=
0
;
$quote_price_count
=
0
;
foreach
(
$itemsArr
as
$k
=>&
$v
){
foreach
(
$itemsArr
as
$k
=>&
$v
){
$v
[
"quote_account"
]
=
$v
[
"price_rmb"
]
>
0
?
$v
[
"price_rmb"
]
*
$v
[
"inquiry_number"
]
:
$v
[
"price_origin"
]
*
$v
[
"inquiry_number"
];
$v
[
"quote_account"
]
=
$v
[
"price_rmb"
]
>
0
?
$v
[
"price_rmb"
]
*
$v
[
"inquiry_number"
]
:
$v
[
"price_origin"
]
*
$v
[
"inquiry_number"
];
...
...
resources/views/pdf/sale.blade.php
View file @
17d4adeb
...
@@ -51,8 +51,8 @@
...
@@ -51,8 +51,8 @@
<td><b>
Tel
</b>
: {{ @$user["tel"] }}
</td>
<td><b>
Tel
</b>
: {{ @$user["tel"] }}
</td>
</tr>
</tr>
<tr>
<tr>
<td><b>
From
</b>
:{{ @$company["name"] }}
</td>
<td><b>
From
</b>
:{{ @$company["
user_
name"] }}
</td>
<td><b>
C.C
</b>
:{{ @$company["c
c
"] }}
</td>
<td><b>
C.C
</b>
:{{ @$company["c
ontact
"] }}
</td>
<td><b>
Fax
</b>
:{{ @$company["fax"] }}
</td>
<td><b>
Fax
</b>
:{{ @$company["fax"] }}
</td>
<td><b>
Tel
</b>
: {{ @$company["tel"] }}
</td>
<td><b>
Tel
</b>
: {{ @$company["tel"] }}
</td>
</tr>
</tr>
...
...
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