From 2bac7d300b40099e89a8d21ad3f8f7508b765635 Mon Sep 17 00:00:00 2001 From: devil Date: Wed, 2 Sep 2020 19:35:02 +0800 Subject: [PATCH] =?UTF-8?q?web=E7=AB=AF=E5=95=86=E5=93=81=E5=8F=82?= =?UTF-8?q?=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/common.php | 9 +- application/index/controller/Goods.php | 1 + .../index/view/default/goods/index.html | 70 ++++++------ application/service/GoodsService.php | 21 +++- application/service/UserService.php | 1 + public/static/index/default/css/goods.css | 103 +++++++----------- public/static/index/default/js/buy.js | 2 +- 7 files changed, 105 insertions(+), 102 deletions(-) diff --git a/application/common.php b/application/common.php index 3e8c2c920..9b6807d19 100755 --- a/application/common.php +++ b/application/common.php @@ -2086,20 +2086,23 @@ function ParamsChecked($data, $params) } if(empty($data[$v['key_name']])) { - return $v['error_msg']; + return str_replace('{$var}', 'unique验证', $v['error_msg']); } $temp = db($v['checked_data'])->where([$v['key_name']=>$data[$v['key_name']]])->find(); if(!empty($temp)) { + // 错误数据变量替换 + $error_msg = str_replace('{$var}', $data[$v['key_name']], $v['error_msg']); + // 是否需要排除当前操作数据 if(isset($v['checked_key'])) { if(empty($data[$v['checked_key']]) || (isset($temp[$v['checked_key']]) && $temp[$v['checked_key']] != $data[$v['checked_key']])) { - return str_replace('{$var}', $data[$v['key_name']], $v['error_msg']); + return $error_msg; } } else { - return $v['error_msg']; + return $error_msg; } } break; diff --git a/application/index/controller/Goods.php b/application/index/controller/Goods.php index c1feda17d..87ae9185b 100755 --- a/application/index/controller/Goods.php +++ b/application/index/controller/Goods.php @@ -56,6 +56,7 @@ class Goods extends Common ], 'is_photo' => true, 'is_spec' => true, + 'is_params' => true, ]; $ret = GoodsService::GoodsList($params); if(empty($ret['data'][0]) || $ret['data'][0]['is_delete_time'] != 0) diff --git a/application/index/view/default/goods/index.html b/application/index/view/default/goods/index.html index 497a1322f..66e0d5dbc 100755 --- a/application/index/view/default/goods/index.html +++ b/application/index/view/default/goods/index.html @@ -226,7 +226,7 @@ {{/if}} - + + {{if !empty($goods['parameters']) and !empty($goods['parameters']['base'])}} + + + {{/if}} + {{if $goods['is_shelves'] == 1 and $goods['inventory'] gt 0}}
@@ -257,7 +269,7 @@
-