|
@@ -2725,11 +2725,12 @@ class Goodup extends Base
|
|
|
public function onlineZixunGoods()
|
|
|
{
|
|
|
|
|
|
- $param = $this->request->only(['platform', 'codes', 'online_reason', 'online_remark', 'token'], 'post', 'trim');
|
|
|
+ $param = $this->request->only(['platform', "is_fixed",'codes', 'online_reason', 'online_remark', 'token'], 'post', 'trim');
|
|
|
|
|
|
$val = Validate::rule([
|
|
|
'platform|所选上线平台' => 'require|number|gt:0',
|
|
|
'codes|所选上线商品编号' => 'require',
|
|
|
+ 'is_fixed|是否一口价' => 'require|number|in:0,1',
|
|
|
'online_reason|上线原因' => 'require',
|
|
|
'online_remark|上线备注' => 'require',
|
|
|
'token' => 'require',
|
|
@@ -2756,7 +2757,6 @@ class Goodup extends Base
|
|
|
->toArray();
|
|
|
|
|
|
if (!empty($isonline)) {
|
|
|
-
|
|
|
foreach ($isonline as &$v) {
|
|
|
$spec = Db::name("good_spec")
|
|
|
->where(["spuCode" => $v['spuCode'], "is_del" => 0])
|
|
@@ -2816,7 +2816,9 @@ class Goodup extends Base
|
|
|
if (!empty($all_good_basic)) return error_show(1004, '请从商品成本提交该商品上线');
|
|
|
|
|
|
foreach ($param['codes'] as $value) {
|
|
|
-
|
|
|
+ if($good_zixun_list[$value]['is_gold_price']==1&&$param['is_fixed']==1){
|
|
|
+ return error_show(1004," {$good_zixun_list[$value]['good_name']}商品使用实时金价,不可使用一口价!");
|
|
|
+ }
|
|
|
//改变编码规则,将原来的skuCode后两位换成序列号
|
|
|
//str_pad字符串填充
|
|
|
$skuCode = makeNo("SN");
|
|
@@ -2829,6 +2831,7 @@ class Goodup extends Base
|
|
|
"online_remark" => $param['online_remark'],
|
|
|
"exam_status" => isset($all_nakes[$value]) ? ($all_nakes[$value] > 0 ? 2 : 1) : 1,
|
|
|
"is_online" => 0,
|
|
|
+ "is_fixed" =>$param['is_fixed'],
|
|
|
"status" => 0,
|
|
|
"is_del" => 0,
|
|
|
"creater" => $creater,
|
|
@@ -2975,14 +2978,15 @@ class Goodup extends Base
|
|
|
$spec_list = json_decode($good_zixun_list[$value]['specinfo'], true);
|
|
|
|
|
|
foreach ($spec_list as $spec) {
|
|
|
+ $specid = $spec['specid']?:$spec['spec_id'];
|
|
|
$temp = Db::name('good_spec')
|
|
|
->field('id')
|
|
|
- ->where(['spuCode' => $value, 'spec_id' => $spec['specid'], 'spec_value_id' => $spec['spec_value_id'], 'is_del' => 0])
|
|
|
+ ->where(['spuCode' => $value, 'spec_id' => $specid, 'spec_value_id' => $spec['spec_value_id'], 'is_del' => 0])
|
|
|
->find();
|
|
|
if (!empty($temp)) {
|
|
|
$good_spec_insert_data[] = [
|
|
|
'spuCode' => $value,
|
|
|
- 'spec_id' => $spec['specid'],
|
|
|
+ 'spec_id' => $specid,
|
|
|
'spec_value_id' => $spec['spec_value_id'],
|
|
|
'is_del' => 0,
|
|
|
'addtime' => date('Y-m-d H:i:s'),
|