|
|
@@ -49,7 +49,7 @@ class ProductRepository extends BaseRepository
|
|
49
|
49
|
{
|
|
50
|
50
|
|
|
51
|
51
|
protected $dao;
|
|
52
|
|
- protected $filed = 'concession_pri,product_id,mer_id,brand_id,unit_name,rate,reply_count,store_info,cate_id,ficti,image,slider_image,store_name,keyword,sort,is_show,sales,price,refusal,cost,ot_price,stock,is_gift_bag,care_count,status,is_used,create_time,seckill,plate_mer_profit,type';
|
|
|
52
|
+ protected $filed = 'is_status,concession_pri,product_id,mer_id,brand_id,unit_name,rate,reply_count,store_info,cate_id,ficti,image,slider_image,store_name,keyword,sort,is_show,sales,price,refusal,cost,ot_price,stock,is_gift_bag,care_count,status,is_used,create_time,seckill,plate_mer_profit,type';
|
|
53
|
53
|
|
|
54
|
54
|
/**
|
|
55
|
55
|
* ProductRepository constructor.
|
|
|
@@ -1944,16 +1944,18 @@ class ProductRepository extends BaseRepository
|
|
1944
|
1944
|
->where('product_id', $product_id)
|
|
1945
|
1945
|
->select()->toArray();
|
|
1946
|
1946
|
$attrInfo = array_column($attrInfo, null, 'gong_sku_id');
|
|
1947
|
|
- $updateData = [];
|
|
|
1947
|
+ $updateData = [];
|
|
1948
|
1948
|
// 组装数据
|
|
1949
|
1949
|
foreach ($skuArr as $key => $value) {
|
|
1950
|
1950
|
if (isset($attrInfo[$value['sku_id']])) {
|
|
|
1951
|
+
|
|
1951
|
1952
|
if ($value['edit_price'] > $attrInfo[$value['sku_id']]['gong_market_price']) {
|
|
1952
|
1953
|
// 上调价格计算创客利润
|
|
1953
|
1954
|
$diff = bcsub($value['edit_price'], $attrInfo[$value['sku_id']]['gong_market_price'], 2);
|
|
1954
|
|
- $diff_profit = bcmul($diff, 0.7, 2);
|
|
|
1955
|
+ // $diff_profit = bcmul($diff, 0.7, 2);
|
|
|
1956
|
+ $diff_profit = $diff;
|
|
1955
|
1957
|
$plate_mer_profit = bcadd($attrInfo[$value['sku_id']]['gong_mer_profit'], $diff_profit, 2);
|
|
1956
|
|
- } else {
|
|
|
1958
|
+ } else {
|
|
1957
|
1959
|
// 下调价格计算创客利润
|
|
1958
|
1960
|
$diff = bcsub($attrInfo[$value['sku_id']]['gong_market_price'], $value['edit_price'], 2);
|
|
1959
|
1961
|
$plate_mer_profit = bcsub($attrInfo[$value['sku_id']]['gong_mer_profit'], $diff, 2);
|
|
|
@@ -2041,7 +2043,7 @@ class ProductRepository extends BaseRepository
|
|
2041
|
2043
|
// 供应链商品上下架
|
|
2042
|
2044
|
public function changeStatus($ids, $is_show)
|
|
2043
|
2045
|
{
|
|
2044
|
|
- $data = ['is_show' => $is_show];
|
|
|
2046
|
+ $data = ['is_show' => $is_show, 'is_status' => 1];
|
|
2045
|
2047
|
$this->dao->updates($ids, $data);
|
|
2046
|
2048
|
|
|
2047
|
2049
|
foreach ($ids as $id) {
|