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
588ac347
authored
Apr 08, 2021
by
hcy001
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
1
parent
237df3ab
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
16 deletions
app/Http/function.php
app/Model/InquiryItemsReportModel.php
app/Http/function.php
View file @
588ac347
<?php
/*
* 币种价格转换
* @param $price 当前价格
* @param $price_rate 当前币种转人民币汇率
* @param $target_rate 目标币种转人民币汇率
* @return 返回转换后的目标币种价格
*/
function
changRate
(
$price
,
$price_rate
,
$target_rate
){
return
$price
*
$price_rate
/
$target_rate
;
}
/*
* 生成订单号
*/
function
createSn
(
$model
,
$field
,
$prefix
=
''
,
$suffix
=
''
)
...
...
app/Model/InquiryItemsReportModel.php
View file @
588ac347
...
...
@@ -142,7 +142,7 @@ class InquiryItemsReportModel extends Model
$quote_id
=
$data
[
"quote_id"
];
#报价id
$status
=
$data
[
"status"
];
#状态: 2 选中 3 确定
$delivery_time
=
$data
[
"delivery_time"
];
#货期
$sale_price
=
@
$data
[
"price"
]
?
$data
[
"price"
]
:
0
;
#销售报价
$sale_price
=
@
$data
[
"price"
]
?
$data
[
"price"
]
:
0
;
#销售报价
,已转询价主币种报价
if
(
$inquiry_items_id
<=
0
)
return
[
1001
,
"询价明细ID不得为空"
];
if
(
$quote_id
<=
0
)
return
[
1001
,
"报价ID不得为空"
];
...
...
@@ -166,22 +166,18 @@ class InquiryItemsReportModel extends Model
return
[
0
,
"撤销成功"
];
}
if
(
$status
==
2
&&
$itemInfo
[
"status"
]
==
5
){
#选中之前判断有没有确定的报价
return
[
1007
,
"请先撤销已确认的报价"
];
}
$price_rmb
=
$price_origin
=
$sale_price
;
// if ($mainCurrency == 1 && $currency != $mainCurrency ){ #询价币种人民币
// $rate1 = $CommonModel->getRate($currency); #获取汇率
// $price_rmb = round($sale_price*$rate1,6);
// }
// if ($mainCurrency >1 && $currency != $mainCurrency ){ #询价单其他币种转人民币
// $rate2 = $CommonModel->getRate($currency); #转人民币汇率
// $rate3 = $CommonModel->getRate($mainCurrency); #获取汇率
// $salePrice = $sale_price*$rate2;
// $price_origin = round($salePrice/$rate3,6);
// if ($status == 2 && $itemInfo["status"] == 5 ){ #选中之前判断有没有确定的报价
// return [1007,"请先撤销已确认的报价"];
// }
$price_rmb
=
$price_origin
=
$price_profile
=
$sale_price
;
$main_rate
=
$CommonModel
->
getRate
(
$mainCurrency
);
//询价转人民币汇率
$quote_rate
=
$CommonModel
->
getRate
(
$currency
);
//报价转人民币汇率
$price_profile
=
changRate
(
$sale_price
,
$main_rate
,
$quote_rate
);
$temp
=
[
"currency"
=>
$mainCurrency
,
"goods_name"
=>
$itemInfo
[
"goods_name"
],
...
...
@@ -199,7 +195,7 @@ class InquiryItemsReportModel extends Model
"raw_brand_name"
=>
$quoteItem
[
"raw_brand_name"
],
"price_rmb"
=>
$price_rmb
,
"price_origin"
=>
$price_origin
,
"price_profile"
=>
$
sale_pric
e
,
"price_profile"
=>
$
price_profil
e
,
"inquiry_number"
=>
$quoteItem
[
"quote_number"
],
"delivery_time"
=>
$delivery_time
,
"batch"
=>
$quoteItem
[
"batch"
],
...
...
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