diff --git a/app/shop/controller/goods/Goods.php b/app/shop/controller/goods/Goods.php index e7b3b1fc..db8d60af 100755 --- a/app/shop/controller/goods/Goods.php +++ b/app/shop/controller/goods/Goods.php @@ -255,7 +255,6 @@ class Goods extends ShopBase $goods_id = $this->request->get('goods_id'); $a = MallCategoryLogic::getAllTree(); $b = GoodsLogic::info($goods_id); - $second_pid = array(); $arr = $arr1 = array(); if ($b['base']['second_cate_id'] != 0) { @@ -280,12 +279,10 @@ class Goods extends ShopBase $b['base']['first_cate_id'] = explode(",", $b['base']['first_cate_id']); $b['base']['second_cate_id'] = explode(",", $b['base']['second_cate_id']); $b['base']['third_cate_id'] = explode(",", $b['base']['third_cate_id']); - $subsidy = []; if ($b['base']['subsidy_id']) { $subsidy = (new GoodsSubsidy())->getSubsidyById($b['base']['subsidy_id']); } - return view('goods/goods/add', [ 'category_lists_new' => $a, 'category_first' => $b['base']['first_cate_id'], diff --git a/app/shop/view/goods/goods/add.html b/app/shop/view/goods/goods/add.html index f05b7c61..3092463f 100755 --- a/app/shop/view/goods/goods/add.html +++ b/app/shop/view/goods/goods/add.html @@ -843,6 +843,7 @@ var goods_info= {$info|raw|default=''}; // 商品类型 + $("input[name=is_new_goods]").prop("checked", goods_info['base']['is_new_goods'] == 1); $("input[name=type]").prop("disabled",true); $("input[name=type][value="+goods_info['base']['type']+"]").prop("checked",true); switchGoodsType(goods_info['base']['type']); diff --git a/app/shop/view/goods/goods/goods_base.html b/app/shop/view/goods/goods/goods_base.html index f7224fed..871c379f 100755 --- a/app/shop/view/goods/goods/goods_base.html +++ b/app/shop/view/goods/goods/goods_base.html @@ -24,6 +24,15 @@ class="layui-input"> + + +
+ +
+ +
+
+
diff --git a/database/migrations/20241223053219_add_is_new_goods_fields_to_goods.php b/database/migrations/20241223053219_add_is_new_goods_fields_to_goods.php new file mode 100644 index 00000000..1afde62e --- /dev/null +++ b/database/migrations/20241223053219_add_is_new_goods_fields_to_goods.php @@ -0,0 +1,44 @@ +table('goods'); + $table->addColumn('is_new_goods', 'tinyinteger', [ + 'limit' => 1, 'default' => 0, 'null' => false, 'comment' => '是否是新品:0不是 1是;' + ])->update(); // 更新表结构 + } + + public function down() + { + // 回滚操作删除添加的字段 + $table = $this->table('goods_subsidy'); + $table->removeColumn('store_subsidy') + ->update(); + } +}