修复错误
This commit is contained in:
parent
63546eca45
commit
811d472acb
@ -182,6 +182,7 @@ class SpuRepository extends BaseRepository
|
||||
try {
|
||||
switch ($productType) {
|
||||
case 0:
|
||||
case 98:
|
||||
$where = [
|
||||
'activity_id' => 0,
|
||||
'product_id' => $id,
|
||||
@ -280,14 +281,14 @@ class SpuRepository extends BaseRepository
|
||||
}
|
||||
$ret = $make->getWhere(['product_id' => $where['product_id']]);
|
||||
if (!$ret || $ret['status'] !== 1 || $ret['mer_status'] !== 1 || $ret['is_del']) $status = 0;
|
||||
if (in_array($productType, [0, 1]) && ($ret['is_show'] !== 1 || $ret['is_used'] !== 1)) $status = 0;
|
||||
if (in_array($productType, [0, 1,98]) && ($ret['is_show'] !== 1 || $ret['is_used'] !== 1)) $status = 0;
|
||||
$result = $this->dao->getSearch($where)->find();
|
||||
if (!$result && $ret) $result = $this->create($ret->toArray(), $where['product_id'], $where['activity_id'], $productType);
|
||||
if ($result) $this->dao->update($result['spu_id'], ['status' => $status]);
|
||||
if ($status == 1 && $productType == 0) {
|
||||
if ($status == 1 && in_array($productType, [0, 98])) {
|
||||
Queue(SendSmsJob::class, ['tempId' => 'PRODUCT_INCREASE', 'id' => $id]);
|
||||
}
|
||||
if ($productType == 0) Queue::push(SyncProductTopJob::class,[]);
|
||||
if (in_array($productType, [0, 98])) Queue::push(SyncProductTopJob::class,[]);
|
||||
} catch (\Exception $exception) {
|
||||
Log::info($exception->getMessage());
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user