diff --git a/app/admin/controller/goods/Goods.php b/app/admin/controller/goods/Goods.php index 32a56636..cf4032d7 100755 --- a/app/admin/controller/goods/Goods.php +++ b/app/admin/controller/goods/Goods.php @@ -30,6 +30,7 @@ use app\common\model\Freight; use app\common\model\goods\Goods as GoodsModel; use app\common\model\goods\GoodsBrand; use app\common\model\goods\GoodsItem; +use app\common\model\goods\GoodsSubsidy; use app\common\model\goods\GoodsUnit; use app\common\model\goods\Supplier; use app\common\server\JsonServer; @@ -70,6 +71,14 @@ class Goods extends AdminBase { $goods_id = $this->request->get('goods_id'); $shop_id = GoodsModel::where('id', $goods_id)->value('shop_id'); + + $info = GoodsLogic::info($goods_id); + + $subsidy = []; + if ($info['base']['subsidy_id']) { + $subsidy = (new GoodsSubsidy())->getSubsidyById($info['base']['subsidy_id']); + } + return view('goods/goods/add', [ 'category_lists' => json_encode(MallCategoryLogic::getAllTree(), JSON_UNESCAPED_UNICODE), 'shop_category_lists' => json_encode(ShopCategoryLogic::listAll($shop_id), JSON_UNESCAPED_UNICODE), @@ -77,7 +86,8 @@ class Goods extends AdminBase 'supplier_lists' => json_encode(Supplier::getNameColumn(), JSON_UNESCAPED_UNICODE), 'unit_lists' => json_encode(GoodsUnit::getNameColumn(), JSON_UNESCAPED_UNICODE), 'freight_lists' => json_encode(Freight::getNameColumn($shop_id), JSON_UNESCAPED_UNICODE), - 'info' => json_encode(GoodsLogic::info($goods_id), JSON_UNESCAPED_UNICODE) + 'info' => json_encode($info, JSON_UNESCAPED_UNICODE), + 'subsidy' => json_encode($subsidy, JSON_UNESCAPED_UNICODE), ]); } diff --git a/app/admin/view/goods/goods/add.html b/app/admin/view/goods/goods/add.html index aa6bf51f..51b1ec68 100755 --- a/app/admin/view/goods/goods/add.html +++ b/app/admin/view/goods/goods/add.html @@ -205,6 +205,31 @@ area: ['60%', '60%'] }); }); + + var subsidy = {$subsidy | raw}; + if (subsidy.profit) { + const h = ` +
| 商家利润比例 | +商品让利比例 | +商品全返比例 | +
|---|---|---|
| ${subsidy.profit} | +${subsidy.discount} | +${subsidy.subsidy} | +