Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
朱继来
/
后台订单管理
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
2f891d12
authored
Aug 05, 2020
by
孙龙
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
up
parent
83d3f890
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
4 deletions
app/Model/Bom/BomItemMatchModel.php
app/Services/Bom/BomService.php
resources/views/web/BomView.blade.php
app/Model/Bom/BomItemMatchModel.php
View file @
2f891d12
...
...
@@ -21,7 +21,9 @@ class BomItemMatchModel extends BomItemMatchBaseModel{
public
function
getBomAmount
(
$bom_id
){
$suffix
=
substr
(
strrev
(
$bom_id
),
0
,
1
);
return
self
::
suffix
(
$suffix
)
->
where
(
'bom_id'
,
$bom_id
)
->
where
(
"status"
,
1
)
->
selectRaw
(
"sum(price*number) as amount"
)
->
first
();
$taoshu
=
BomModel
::
where
([
"bom_id"
=>
$bom_id
])
->
value
(
"amount"
);
$taoshu
=
$taoshu
?
intval
(
$taoshu
)
:
1
;
return
self
::
suffix
(
$suffix
)
->
where
(
'bom_id'
,
$bom_id
)
->
where
(
"status"
,
1
)
->
selectRaw
(
"sum(price*number*
{
$taoshu
}
) as amount"
)
->
first
();
}
...
...
app/Services/Bom/BomService.php
View file @
2f891d12
...
...
@@ -472,6 +472,7 @@ class BomService {
$extend
[
"delivery_type"
]
=
$delivery_type
;
$extend
[
"currency"
]
=
$currency
;
$extend
[
"bom_id"
]
=
$bom_id
;
$extend
[
"taoshu"
]
=
$bom
->
amount
;
$extend
[
"bom_sn"
]
=
$bom
->
bom_sn
;
$address_id
=
$this
->
getAddress
(
$user_id
);
$extend
[
"address_id"
]
=
$address_id
;
...
...
@@ -505,7 +506,7 @@ class BomService {
//自营
$ziying
[
$k
][
"id"
]
=
$item
[
"match_goods_id"
];
$ziying
[
$k
][
"num"
]
=
$item
[
"match_number"
];
$ziying
[
$k
][
"num"
]
=
$item
[
"match_number"
]
*
$extend
[
"taoshu"
]
;
$ziying
[
$k
][
"delivery_place"
]
=
$delivery_type
;
$ziying
[
$k
][
"matching_id"
]
=
$item
[
"matching_id"
];
}
else
{
...
...
@@ -523,7 +524,7 @@ class BomService {
$lianying
[
$k
][
"matching_id"
]
=
$item
[
'matching_id'
];
$lianying
[
$k
][
"goods_name"
]
=
$item
[
'match_goods_name'
];
$lianying
[
$k
][
"brand_name"
]
=
$item
[
'match_brand_name'
];
$lianying
[
$k
][
"num"
]
=
$item
[
'match_number'
];
$lianying
[
$k
][
"num"
]
=
$item
[
'match_number'
]
*
$extend
[
"taoshu"
]
;
$lianying
[
$k
][
"goods_price"
]
=
$item
[
'match_price'
];
$lianying
[
$k
][
"delivery_time"
]
=
$item
[
'match_delivery'
];
$lianying
[
$k
][
"supplier_name"
]
=
$item
[
'match_supplier_name'
];
...
...
resources/views/web/BomView.blade.php
View file @
2f891d12
...
...
@@ -37,7 +37,7 @@
<td>
BOM名称
</td>
<td>
{{$bomInfo->bom_name}}
</td>
<td>
BOM套数
</td>
<td></td>
<td>
{{$bomInfo->amount}}
</td>
<td>
</td>
<td>
</td>
</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