添加商品价格更新时间
This commit is contained in:
parent
463da3cef1
commit
970a7f07c5
@ -98,6 +98,7 @@ class StoreProductLists extends BaseAdminDataLists implements ListsSearchInterfa
|
|||||||
$list = $query->limit($this->limitOffset, $this->limitLength)
|
$list = $query->limit($this->limitOffset, $this->limitLength)
|
||||||
->order(['id' => 'desc'])
|
->order(['id' => 'desc'])
|
||||||
->select()->each(function ($item) use ($is_warehouse, $userShip, $order_type, $is_true) {
|
->select()->each(function ($item) use ($is_warehouse, $userShip, $order_type, $is_true) {
|
||||||
|
$item['price_update_time'] = !empty($item['price_update_time']) ? date('Y-m-d H:i:s', $item['price_update_time']) : '';
|
||||||
$item['product_id'] = $item['id'];
|
$item['product_id'] = $item['id'];
|
||||||
$item['bar_code_two'] = '';
|
$item['bar_code_two'] = '';
|
||||||
if (in_array($item['unit'], [2, 21])) {
|
if (in_array($item['unit'], [2, 21])) {
|
||||||
|
@ -49,7 +49,8 @@ class StoreProductPriceLogic extends BaseLogic
|
|||||||
'cost' => $model['cost'],
|
'cost' => $model['cost'],
|
||||||
'vip_price' => $model['vip_price'],
|
'vip_price' => $model['vip_price'],
|
||||||
'price' => $model['price'],
|
'price' => $model['price'],
|
||||||
'ot_price' => $model['price']
|
'ot_price' => $model['price'],
|
||||||
|
'price_update_time' => time(),
|
||||||
]);
|
]);
|
||||||
StoreBranchProduct::where('product_id', $model['product_id'])->update([
|
StoreBranchProduct::where('product_id', $model['product_id'])->update([
|
||||||
'purchase' => $model['purchase'],
|
'purchase' => $model['purchase'],
|
||||||
@ -129,7 +130,8 @@ class StoreProductPriceLogic extends BaseLogic
|
|||||||
'cost' => $find['cost'],
|
'cost' => $find['cost'],
|
||||||
'vip_price' => $find['vip_price'],
|
'vip_price' => $find['vip_price'],
|
||||||
'price' => $find['price'],
|
'price' => $find['price'],
|
||||||
'ot_price' => $find['price']
|
'ot_price' => $find['price'],
|
||||||
|
'price_update_time' => time(),
|
||||||
]);
|
]);
|
||||||
StoreBranchProduct::where('product_id', $find['product_id'])->update([
|
StoreBranchProduct::where('product_id', $find['product_id'])->update([
|
||||||
'purchase' => $find['purchase'],
|
'purchase' => $find['purchase'],
|
||||||
@ -211,6 +213,7 @@ class StoreProductPriceLogic extends BaseLogic
|
|||||||
'vip_price' => $find['vip_price'] ?? 0,
|
'vip_price' => $find['vip_price'] ?? 0,
|
||||||
'price' => $find['price'] ?? 0,
|
'price' => $find['price'] ?? 0,
|
||||||
'ot_price' => $find['price'] ?? 0,
|
'ot_price' => $find['price'] ?? 0,
|
||||||
|
'price_update_time' => time(),
|
||||||
]);
|
]);
|
||||||
StoreBranchProduct::where('product_id', $find['product_id'])->update([
|
StoreBranchProduct::where('product_id', $find['product_id'])->update([
|
||||||
'purchase' => $find['purchase'] ?? 0,
|
'purchase' => $find['purchase'] ?? 0,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user