|
|
@@ -319,12 +319,14 @@ class StoreService
|
|
|
$GLOBALS["FEE_INFO"] = [];
|
|
|
list($id,$money,$taxFee) = $service->matching($store, Feature::MAPPING["store"], $store->owner_id, "入库");
|
|
|
|
|
|
+ $amount = 0;
|
|
|
+ if ($store->storeItems)foreach ($store->storeItems as $item)$amount += $item->amount;
|
|
|
if (!app("OwnerFeeDetailService")->create([
|
|
|
"owner_id" => $store->owner_id,
|
|
|
"worked_at" => $store->updated_at,
|
|
|
"type" => "收货",
|
|
|
"operation_bill" => $store->asn_code,
|
|
|
- "commodity_amount" => array_sum(array_column($store->storeItems->toArray(), "amount")),
|
|
|
+ "commodity_amount" => $amount,
|
|
|
"work_fee" => $money,
|
|
|
"owner_price_operation_id" => $id,
|
|
|
"created_at" => date('Y-m-d H:i:s'),
|
|
|
@@ -332,8 +334,6 @@ class StoreService
|
|
|
"outer_table_name" => "stores",
|
|
|
"work_tax_fee" => $taxFee,
|
|
|
])) return false;
|
|
|
- $amount = 0;
|
|
|
- if ($store->storeItems)foreach ($store->storeItems as $item)$amount += $item->amount;
|
|
|
$this->setStoreAmount($store->owner_id,$amount);
|
|
|
Cache::put("owner_fee_details:stores_".$store->id,1,86400);
|
|
|
if ($money>0)$this->constructFeeInfo([
|