mirror of
https://gitee.com/hzchunfen/erp.git
synced 2025-12-01 06:30:49 +00:00
48 lines
1.2 KiB
PHP
48 lines
1.2 KiB
PHP
<?php
|
|
|
|
namespace App\Jobs;
|
|
|
|
use App\Models\BusinessOrderItem;
|
|
use App\Models\GoodsSku;
|
|
use App\Services\Business\BusinessFactory;
|
|
use Illuminate\Bus\Queueable;
|
|
use Illuminate\Contracts\Queue\ShouldQueue;
|
|
use Illuminate\Foundation\Bus\Dispatchable;
|
|
use Illuminate\Queue\InteractsWithQueue;
|
|
use Illuminate\Queue\SerializesModels;
|
|
|
|
class BusinessGoodsSkuIncrQuantity implements ShouldQueue
|
|
{
|
|
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
|
|
|
public $shop;
|
|
public $businessOrderItem;
|
|
public $num;
|
|
public $isIncremental = true;
|
|
|
|
/**
|
|
* Create a new job instance.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function __construct($shop, BusinessOrderItem $businessOrderItem, $num, $isIncremental)
|
|
{
|
|
$this->shop = $shop;
|
|
$this->businessOrderItem = $businessOrderItem;
|
|
$this->num = $num;
|
|
$this->isIncremental = $isIncremental;
|
|
}
|
|
|
|
/**
|
|
* Execute the job.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function handle()
|
|
{
|
|
if ($this->businessOrderItem) {
|
|
BusinessFactory::init()->make($this->shop['plat_id'])->setShopWithId($this->shop['id'])->incrQuantity($this->businessOrderItem, $this->num, $this->isIncremental);
|
|
}
|
|
}
|
|
}
|