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
dc8e65dd
authored
Mar 29, 2021
by
hcy001
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
1
parent
1684b763
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
10 deletions
app/Http/Controllers/HdController.php
app/Model/QuoteModel.php
app/Http/Controllers/HdController.php
View file @
dc8e65dd
...
...
@@ -25,13 +25,13 @@ 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;
$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
);
...
...
app/Model/QuoteModel.php
View file @
dc8e65dd
...
...
@@ -350,11 +350,12 @@ class QuoteModel extends Model
$params
[
'brand_name'
]
=
$quote_info
[
'brand_name'
];
$SearchModel
=
new
SearchModel
;
$res
=
$SearchModel
->
getClassName
(
json_encode
(
$params
));
// 获取型号分类
$res
=
$SearchModel
->
getClassName
(
json_encode
(
[
$params
]
));
// 获取型号分类
if
(
$res
)
{
$quote_info
[
'class_id2'
]
=
$res
[
$params
[
'spu_name'
]][
'class_id2'
];
$quote_info
[
'class_id2_name'
]
=
$res
[
$params
[
'spu_name'
]][
'class_id2_name'
];
$classInfo
=
$res
[
$params
[
'spu_name'
]
.
"#"
.
strtoupper
(
$params
[
"brand_name"
])];
$quote_info
[
'class_id2'
]
=
$classInfo
[
'class_id2'
];
$quote_info
[
'class_id2_name'
]
=
$classInfo
[
'class_id2_name'
];
}
$quote_info
[
'status'
]
=
1
;
// 已报价
...
...
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