修改定时更新出库商品供货价
This commit is contained in:
parent
c55533e764
commit
e2a3472a11
@ -138,6 +138,7 @@ class Task
|
||||
*/
|
||||
public function setPurchase()
|
||||
{
|
||||
new Crontab('0 0 * * * *', function () {
|
||||
$list = WarehouseProduct::where('purchase', 0)->order('id desc')->limit(100)->select()->toArray();
|
||||
$productIds = array_unique(array_column($list, 'product_id'));
|
||||
$products = StoreProduct::whereIn('id', $productIds)->field('id,purchase')->select()->toArray();
|
||||
@ -154,6 +155,7 @@ class Task
|
||||
];
|
||||
}
|
||||
(new WarehouseProduct())->saveAll($update);
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user