mirror of
https://gitee.com/hzchunfen/erp.git
synced 2025-11-30 22:20:45 +00:00
commit
e6d88f1c50
@ -190,17 +190,17 @@ class ShopsController extends Controller
|
||||
public function syncStock(Request $request)
|
||||
{
|
||||
$shopId = $request->get('shop_id');
|
||||
$skus = GoodsSku::query()
|
||||
->where('status', '>', 0)
|
||||
->whereNotNull('external_sku_id')
|
||||
->pluck('stock', 'external_sku_id')
|
||||
->toArray();
|
||||
$builder = Shop::query()->where('expires_at', '>', time());
|
||||
if ('all' === $shopId) {
|
||||
$shops = $builder->get();
|
||||
} else {
|
||||
$shops = $builder->where('id', $shopId)->get();
|
||||
}
|
||||
$skus = GoodsSku::query()
|
||||
->where('updated_at', '>', date('Y-m-d 07:01:00'))
|
||||
->whereNotNull('external_sku_id')
|
||||
->pluck('stock', 'external_sku_id')
|
||||
->toArray();
|
||||
foreach ($shops as $shop) {
|
||||
$business = BusinessFactory::init()->make($shop->plat_id);
|
||||
$business->setShop($shop);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user