添加商品售罄图片
This commit is contained in:
parent
34ee0a2e2c
commit
110c4c4fb1
@ -94,6 +94,8 @@ class StoreActivityDao extends BaseDao
|
|||||||
$list[$k]['limited_price'] = '2.00';
|
$list[$k]['limited_price'] = '2.00';
|
||||||
if (isset($oldProductList[$v['product']['old_product_id']])) {
|
if (isset($oldProductList[$v['product']['old_product_id']])) {
|
||||||
$list[$k]['product']['stock'] = $oldProductList[$v['product']['old_product_id']]['stock'];
|
$list[$k]['product']['stock'] = $oldProductList[$v['product']['old_product_id']]['stock'];
|
||||||
|
$list[$k]['stock'] = $oldProductList[$v['product']['old_product_id']]['stock'];
|
||||||
|
$list[$k]['product']['image'] = $list[$k]['product']->sellOutImage;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($value['product_id'] == $v['product_id']) {
|
if ($value['product_id'] == $v['product_id']) {
|
||||||
|
@ -38,6 +38,9 @@ class Product extends BaseModel
|
|||||||
protected $deleteTime = 'is_del';
|
protected $deleteTime = 'is_del';
|
||||||
protected $defaultSoftDelete = 0;
|
protected $defaultSoftDelete = 0;
|
||||||
|
|
||||||
|
/** @var string $sellOutImage 售罄图片 */
|
||||||
|
public $sellOutImage = 'https://lihai001.oss-cn-chengdu.aliyuncs.com/def/7300e202401251053563156.png';
|
||||||
|
|
||||||
const IS_SHOW = 1; //上架
|
const IS_SHOW = 1; //上架
|
||||||
const IS_NOT_SHOW = 0; //下架
|
const IS_NOT_SHOW = 0; //下架
|
||||||
|
|
||||||
|
@ -1285,8 +1285,16 @@ class ProductRepository extends BaseRepository
|
|||||||
|
|
||||||
$attr = $this->detailAttr($res['attr']);
|
$attr = $this->detailAttr($res['attr']);
|
||||||
$attrValue = (in_array($res['product_type'], [3, 4])) ? $res['oldAttrValue'] : $res['attrValue'];
|
$attrValue = (in_array($res['product_type'], [3, 4])) ? $res['oldAttrValue'] : $res['attrValue'];
|
||||||
|
$oldProduct = Product::where('product_id', $res['old_product_id'])->field('product_id,stock')->find();
|
||||||
|
$activityId = CloudProduct::where('product_id', $res['product_id'])->value('activity_id');
|
||||||
$sku = $this->detailAttrValue($attrValue, $userInfo, $productType, $activityId);
|
$sku = $this->detailAttrValue($attrValue, $userInfo, $productType, $activityId);
|
||||||
|
if ($activityId == 2 && isset($oldProduct['stock'])) {
|
||||||
|
$res['stock'] = $oldProduct['stock'];
|
||||||
|
$res['slider_image'] = $res->sellOutImage;
|
||||||
|
foreach ($sku as &$skuItem) {
|
||||||
|
$skuItem['stock'] = $oldProduct['stock'];
|
||||||
|
}
|
||||||
|
}
|
||||||
$res['isRelation'] = $isRelation ?? false;
|
$res['isRelation'] = $isRelation ?? false;
|
||||||
$care = false;
|
$care = false;
|
||||||
if ($userInfo) {
|
if ($userInfo) {
|
||||||
@ -1366,11 +1374,6 @@ class ProductRepository extends BaseRepository
|
|||||||
$res['merchant']['village_name']=$village_name.'集体经营合作店铺';
|
$res['merchant']['village_name']=$village_name.'集体经营合作店铺';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$oldProduct = Product::where('product_id', $res['old_product_id'])->field('product_id,stock')->find();
|
|
||||||
$activityId = CloudProduct::where('product_id', $res['product_id'])->value('activity_id');
|
|
||||||
if ($activityId == 2 && isset($oldProduct['stock'])) {
|
|
||||||
$res['stock'] = $oldProduct['stock'];
|
|
||||||
}
|
|
||||||
return $res;
|
return $res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user