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
d0c81d9d
authored
Mar 18, 2021
by
hcy001
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
1
parent
5e96e0a7
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
8 deletions
app/Http/Controllers/HdController.php
app/Model/QuoteModel.php
app/Http/Controllers/HdController.php
View file @
d0c81d9d
...
...
@@ -25,15 +25,17 @@ class HdController extends Controller
//添加参数
private
function
cf
(){
$param
=
[
[
"spu_name"
=>
"RCP0603W110RGS3"
,
"brand_name"
=>
"vishay"
]
];
$res
=
(
new
SearchModel
())
->
getClassName
(
\GuzzleHttp\json_encode
(
$param
));
print_r
(
$res
);
return
;
$t
=
'{"0":{"inquiry_id":"1","inquiry_sn":"A161398670712345","inquiry_items_id":"1","currency":2,"goods_id":"353535","goods_name":"
LM358","brand_id":"0","brand_name":"TI
","supplier_id":7,"supplier_name":"digikey","quote_number":"25","status":1,"create_uid":0,"create_name":"digikey","price_origin":2.9,"raw_goods_sn":"1597-1134-ND","raw_goods_packing":"Bulk","raw_brand_name":"Seeed Technology Co., Ltd"}}'
;
//
$param = [
//
["spu_name"=>"RCP0603W110RGS3","brand_name"=>"vishay"]
//
];
//
$res = (new SearchModel())->getClassName(\GuzzleHttp\json_encode($param));
//
print_r($res);
//
//
return;
$t
=
'{"0":{"inquiry_id":"1","inquiry_sn":"A161398670712345","inquiry_items_id":"1","currency":2,"goods_id":"353535","goods_name":"
RCP0603W110RGS3","brand_id":"0","brand_name":"vishay
","supplier_id":7,"supplier_name":"digikey","quote_number":"25","status":1,"create_uid":0,"create_name":"digikey","price_origin":2.9,"raw_goods_sn":"1597-1134-ND","raw_goods_packing":"Bulk","raw_brand_name":"Seeed Technology Co., Ltd"}}'
;
$res
=
(
new
QuoteModel
())
->
addBatch
(
$t
);
print_r
(
$res
);
die
();
}
//pdf添加
...
...
app/Model/QuoteModel.php
View file @
d0c81d9d
...
...
@@ -237,8 +237,23 @@ class QuoteModel extends Model
$con
->
beginTransaction
();
$QuoteModel
=
new
QuoteModel
();
#批量获取品牌
$param
=
[];
foreach
(
$input
as
$a
=>
$b
){
array_push
(
$param
,[
"spu_name"
=>
strtoupper
(
$b
[
"goods_name"
]),
"brand_name"
=>
strtoupper
(
$b
[
"brand_name"
])]);
}
$classArr
=
(
new
SearchModel
())
->
getClassName
(
\GuzzleHttp\json_encode
(
$param
));
#拼接批量插入明细
foreach
(
$input
as
$k
=>&
$v
){
if
(
$classArr
!==
false
){
$classInfo
=
@
$classArr
[
strtoupper
(
$v
[
"goods_name"
])
.
"#"
.
strtoupper
(
$v
[
"brand_name"
])];
if
(
count
(
$classInfo
)
>
0
){
$v
[
"class_id2"
]
=
$classInfo
[
"class_id2"
];
$v
[
"class_id2_name"
]
=
$classInfo
[
"class_id2_name"
];
}
}
$quote_sn
=
$this
->
where
([
"inquiry_items_id"
=>
$inquiry_items_id
,
"raw_goods_sn"
=>
$v
[
"raw_goods_sn"
]])
->
value
(
"quote_sn"
);
if
(
$quote_sn
){
#存在更新
...
...
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