Commit 2f891d12 by 孙龙

up

parent 83d3f890
......@@ -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();
}
......
......@@ -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'];
......
......@@ -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>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment