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
64283d47
authored
Mar 31, 2021
by
朱继来
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
调整导入
parent
38d792f1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
14 deletions
app/Model/CommonModel.php
app/Model/QuoteModel.php
config/quote.php
app/Model/CommonModel.php
View file @
64283d47
...
...
@@ -207,8 +207,7 @@ class CommonModel extends Model
// 判断型号是否存在
public
function
isGoodsNameExists
(
$goods_name
)
{
$SpuModel
=
new
SpuModel
;
return
$SpuModel
->
where
(
'spu_name'
,
$goods_name
)
->
value
(
'_id'
);
return
DB
::
connection
(
'mongodb'
)
->
collection
(
'spu'
)
->
where
(
'spu_name'
,
$goods_name
)
->
value
(
'_id'
);
}
// 判断品牌是否存在
...
...
app/Model/QuoteModel.php
View file @
64283d47
...
...
@@ -48,11 +48,10 @@ class QuoteModel extends Model
->
toArray
();
if
(
!
$list
)
return
[
20001
,
'没有数据'
];
foreach
(
$list
[
'data'
]
as
$k
=>&
$v
){
$currency_sign
=
InquiryMap
::
$currency_sign
[
$v
[
"currency"
]];
$v
[
"price_origin"
]
=
$v
[
"currency"
]
>
1
?
$currency_sign
.
$v
[
"price_origin"
]
:
"--"
;
$v
[
"price_rmb"
]
=
$v
[
"currency"
]
==
1
?
$currency_sign
.
$v
[
"price_rmb"
]
:
"--"
;
$v
[
"price_origin"
]
=
$v
[
"currency"
]
==
2
?
"$"
.
$v
[
"price_origin"
]
:
"--"
;
$v
[
"price_rmb"
]
=
$v
[
"currency"
]
==
1
?
"¥"
.
$v
[
"price_rmb"
]
:
"--"
;
$v
[
'status'
]
=
QuoteMap
::
$status
[
$v
[
"status"
]];
if
(
$v
[
"
remark
"
]
==
"digikey"
){
if
(
$v
[
"
create_name
"
]
==
"digikey"
){
$v
[
"create_name"
]
=
"digikey(包装:"
.
$v
[
"raw_goods_packing"
]
.
")"
;
}
}
...
...
@@ -201,16 +200,13 @@ class QuoteModel extends Model
case
"brand_name"
:
$query
->
where
(
'it.brand_name'
,
'like'
,
$b
.
'%'
);
break
;
case
"inquiry_items_id"
:
$query
->
where
(
'it.id'
,
'<>'
,
$b
);
break
;
}
}
$query
->
whereIn
(
'q.status'
,
[
1
,
2
,
3
]);
});
$list
=
$list
->
orderBy
(
'id'
,
'desc'
)
->
paginate
(
$limit
,
[
'*'
],
'page'
,
$page
)
->
toArray
();
foreach
(
$list
[
'data'
]
as
$b
=>&
$v
)
{
foreach
(
$list
[
'data'
]
as
$b
=>&
$v
)
{
if
(
$v
[
'currency'
]
==
1
){
$v
[
"price_origin"
]
=
"--"
;
}
else
{
...
...
@@ -610,19 +606,34 @@ class QuoteModel extends Model
$CommonModel
=
new
CommonModel
();
$err
=
[];
// 提示信息
array_walk
(
$excel
,
function
(
$val
,
$key
)
use
(
$required
,
$required_keys
,
&
$err
)
{
array_walk
(
$excel
,
function
(
$val
,
$key
)
use
(
$
CommonModel
,
$
required
,
$required_keys
,
&
$err
)
{
// 跳过第一条
if
(
$key
!=
0
)
{
if
(
$val
[
'goods_name'
])
{
// 判断型号是否存在
$res
=
$CommonModel
->
isGoodsNameExists
(
$val
[
'goods_name'
]);
if
(
!
$res
)
{
$err
[]
=
'第'
.
(
$key
+
1
)
.
'行,型号'
.
$val
[
'goods_name'
]
.
'不存在于系统'
;
return
;
}
}
if
(
$val
[
'brand_name'
])
{
// 判断型号是否存在
if
(
$val
[
'brand_name'
])
{
// 判断品牌是否存在
$res
=
$CommonModel
->
isBrandNameExists
(
$val
[
'brand_name'
]);
if
(
!
$res
)
{
$err
[]
=
'第'
.
(
$key
+
1
)
.
'行,品牌'
.
$val
[
'brand_name'
]
.
'不存在于系统'
;
return
;
}
}
if
(
$val
[
'supplier_name'
])
{
// 判断型号是否存在
if
(
$val
[
'supplier_name'
])
{
// 判断供应商是否存在
$res
=
$CommonModel
->
isSupplierNameExists
(
$val
[
'supplier_name'
]);
if
(
!
$res
)
{
$err
[]
=
'第'
.
(
$key
+
1
)
.
'行,供应商'
.
$val
[
'supplier_name'
]
.
'不存在于系统'
;
return
;
}
}
if
(
$val
[
'currency'
]
!=
'人民币'
&&
$val
[
'price_origin'
]
<=
0
)
{
...
...
config/quote.php
View file @
64283d47
...
...
@@ -29,7 +29,7 @@ return [
2
=>
'美元'
,
3
=>
'港币'
,
4
=>
'欧元'
,
5
=>
'英
磅
'
,
5
=>
'英
镑
'
,
],
'currency_sign'
=>
[
...
...
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