diff --git a/application/admin/controller/Common.php b/application/admin/controller/Common.php index d5d499dd0c79dc0dc348c27e10bf07bafcb38c12..4f9aedde992d110179dbe7b5baf56606c67f2203 100755 --- a/application/admin/controller/Common.php +++ b/application/admin/controller/Common.php @@ -12,9 +12,9 @@ namespace app\admin\controller; use think\facade\Hook; use think\Controller; +use app\module\FormHandleModule; use app\service\AdminPowerService; use app\service\ConfigService; -use app\module\FormHandleModule; /** * 管理员公共控制器 @@ -39,13 +39,9 @@ class Common extends Controller protected $controller_name; protected $action_name; - // 输入参数 post + // 输入参数 post|get|request protected $data_post; - - // 输入参数 get protected $data_get; - - // 输入参数 request protected $data_request; // 分页信息 @@ -70,14 +66,14 @@ class Common extends Controller { parent::__construct(); - // 系统初始化 - $this->SystemInit(); - // 输入参数 $this->data_post = input('post.'); $this->data_get = input('get.'); $this->data_request = input(); + // 系统初始化 + $this->SystemInit(); + // 管理员信息 $this->admin = session('admin'); @@ -204,6 +200,12 @@ class Common extends Controller $this->assign('controller_name', $this->controller_name); $this->assign('action_name', $this->action_name); + // 管理员 + $this->assign('admin', $this->admin); + + // 权限菜单 + $this->assign('left_menu', $this->left_menu); + // 分页信息 $this->page = max(1, isset($this->data_request['page']) ? intval($this->data_request['page']) : 1); $this->page_size = MyC('admin_page_number', 10, true); @@ -222,12 +224,6 @@ class Common extends Controller $module_js .= file_exists(ROOT_PATH.'static'.DS.$module_js.'.'.$this->action_name.'.js') ? '.'.$this->action_name.'.js' : '.js'; $this->assign('module_js', file_exists(ROOT_PATH.'static'.DS.$module_js) ? $module_js : ''); - // 权限菜单 - $this->assign('left_menu', $this->left_menu); - - // 用户 - $this->assign('admin', $this->admin); - // 图片host地址 $this->assign('attachment_host', config('shopxo.attachment_host')); diff --git a/application/admin/controller/Goods.php b/application/admin/controller/Goods.php index 868114222c1b8f537d62bf67321b389089d899e3..8da34948bfa9cdcd3b84d2a0f110123bd6460c59 100755 --- a/application/admin/controller/Goods.php +++ b/application/admin/controller/Goods.php @@ -11,7 +11,6 @@ namespace app\admin\controller; use think\facade\Hook; -use app\service\ResourcesService; use app\service\GoodsService; use app\service\RegionService; use app\service\BrandService; @@ -53,12 +52,6 @@ class Goods extends Common */ public function Index() { - // 参数 - $params = $this->data_request; - - // 条件 - //$where = GoodsService::GetAdminIndexWhere($params); - // 总数 $total = GoodsService::GoodsTotal($this->form_where); @@ -66,7 +59,7 @@ class Goods extends Common $page_params = array( 'number' => $this->page_size, 'total' => $total, - 'where' => $params, + 'where' => $this->data_request, 'page' => $this->page, 'url' => MyUrl('admin/goods/index'), ); @@ -81,19 +74,7 @@ class Goods extends Common ]; $ret = GoodsService::GoodsList($data_params); - // 商品分类 - $this->assign('goods_category_list', GoodsService::GoodsCategoryAll()); - - // 品牌分类 - $this->assign('brand_list', BrandService::CategoryBrand()); - - // 是否上下架 - $this->assign('common_is_shelves_list', lang('common_is_shelves_list')); - - // 是否首页推荐 - $this->assign('common_is_text_list', lang('common_is_text_list')); - - $this->assign('params', $params); + $this->assign('params', $this->data_request); $this->assign('page_html', $page->GetPageHtml()); $this->assign('data_list', $ret['data']); return $this->fetch(); diff --git a/application/admin/controller/Plugins.php b/application/admin/controller/Plugins.php index 7430d7602701deb7a9174c83bb381581e856302d..d9688720629450990ee295c62c966be0f99acf5d 100755 --- a/application/admin/controller/Plugins.php +++ b/application/admin/controller/Plugins.php @@ -32,12 +32,6 @@ class Plugins extends Common public function __construct() { parent::__construct(); - - // 登录校验 - $this->IsLogin(); - - // 权限校验 - $this->IsPower(); } /** @@ -50,7 +44,7 @@ class Plugins extends Common public function Index() { // 参数 - $params = input(); + $params = $this->GetClassVars(); // 请求参数校验 $p = [ @@ -70,7 +64,7 @@ class Plugins extends Common 'error_msg' => '应用操作方法有误', ], ]; - $ret = ParamsChecked($params, $p); + $ret = ParamsChecked($params['data_request'], $p); if($ret !== true) { if(IS_AJAX) @@ -83,9 +77,10 @@ class Plugins extends Common } // 应用名称/控制器/方法 - $pluginsname = $params['pluginsname']; - $pluginscontrol = strtolower($params['pluginscontrol']); - $pluginsaction = strtolower($params['pluginsaction']); + $pluginsname = $params['data_request']['pluginsname']; + $pluginscontrol = strtolower($params['data_request']['pluginscontrol']); + $pluginsaction = strtolower($params['data_request']['pluginsaction']); + unset($params['data_request']['pluginsname'], $params['data_request']['pluginscontrol'], $params['data_request']['pluginsaction']); // 视图初始化 $this->PluginsViewInit($pluginsname, $pluginscontrol, $pluginsaction); @@ -110,6 +105,28 @@ class Plugins extends Common } } + /** + * 获取类属性数据 + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @date 2020-06-07 + * @desc description + */ + public function GetClassVars() + { + $data = []; + $vers = get_class_vars(get_class()); + foreach($vers as $k=>$v) + { + if(property_exists($this, $k)) + { + $data[$k] = $this->$k; + } + } + return $data; + } + /** * 视图初始化 * @author Devil diff --git a/application/admin/form/Goods.php b/application/admin/form/Goods.php index e8efbc2b615fe9dd9734210c3f8a3359060ff028..aa8e6a521f68d57f055752861e4e9773e25f620e 100644 --- a/application/admin/form/Goods.php +++ b/application/admin/form/Goods.php @@ -48,6 +48,9 @@ class Goods 'status_field' => 'is_shelves', 'is_search' => 1, 'search_url' => MyUrl('admin/goods/index'), + 'is_delete' => 1, + 'delete_url' => MyUrl('admin/goods/delete'), + 'delete_key' => 'ids', ], // 表单配置 'form' => [ @@ -59,16 +62,11 @@ class Goods 'align' => 'center', 'width' => 80, ], - [ - 'view_type' => 'radio', - 'align' => 'center', - 'width' => 50, - ], [ 'label' => '商品ID', 'view_type' => 'field', 'view_key' => 'id', - 'width' => 80, + 'width' => 120, 'search_config' => [ 'form_type' => 'input', 'form_name' => 'id', @@ -188,6 +186,20 @@ class Goods 'where_type' => 'in', ], ], + [ + 'label' => '生产地', + 'view_type' => 'field', + 'view_key' => 'place_origin_name', + 'search_config' => [ + 'form_type' => 'select', + 'form_name' => 'place_origin', + 'data' => RegionService::RegionItems(['pid'=>0]), + 'data_key' => 'id', + 'data_name' => 'name', + 'where_type' => 'in', + 'is_multiple' => 1, + ], + ], [ 'label' => '创建时间', 'view_type' => 'field', diff --git a/application/admin/view/default/goods/module/info.html b/application/admin/view/default/goods/module/info.html index 700555acff1769f0ca02318dd3859fdefe609749..baece3a922b8886068893452e323b7b1acdb7e18 100644 --- a/application/admin/view/default/goods/module/info.html +++ b/application/admin/view/default/goods/module/info.html @@ -1,8 +1,8 @@ {{if !empty($module_data)}} -
+
- + {{$module_data.title}} {{if !empty($module_data['simple_desc'])}} diff --git a/application/admin/view/default/goods/module/operate.html b/application/admin/view/default/goods/module/operate.html index 98d69741e5603da739d4167a797d44f3448ce3d6..02704ea4035243d7742e9acfef80995ccbe0c39a 100644 --- a/application/admin/view/default/goods/module/operate.html +++ b/application/admin/view/default/goods/module/operate.html @@ -7,7 +7,7 @@ 编辑 - \ No newline at end of file diff --git a/application/admin/view/default/public/form.html b/application/admin/view/default/public/form.html index bac13b09f4af18a18e3d9f6eb544bca578d5218c..bf15ac31d56da4eaa83d41b56994f24ff0fcd027 100644 --- a/application/admin/view/default/public/form.html +++ b/application/admin/view/default/public/form.html @@ -50,8 +50,19 @@
{{block name="form_operate_top"}} - 重置 - + + {{if isset($form_table['base']['is_delete']) and $form_table['base']['is_delete'] eq 1}} + + {{/if}} {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}} @@ -73,13 +84,19 @@ } } {{/php}} + + + {{if isset($form_table['base']['is_search']) and $form_table['base']['is_search'] eq 1}} + 重置 + + {{/if}} {{/block}}
- +
{{foreach $form_table['form'] as $t}} @@ -243,7 +260,14 @@ {{else /}} {{if isset($data_list[$i][$t['view_key']])}} - {{$data_list[$i][$t['view_key']]|raw}} + + {{if !empty($t['view_data']) and is_array($t['view_data']) and isset($t['view_data'][$data_list[$i][$t['view_key']]])}} + {{$t['view_data'][$data_list[$i][$t['view_key']]]}} + + + {{else /}} + {{$data_list[$i][$t['view_key']]|raw}} + {{/if}} {{/if}} {{/if}} {{/case}} @@ -297,7 +321,7 @@ {{if isset($data_list[$i][$form_table['base']['key_field']])}}
{{/if}} @@ -306,7 +330,7 @@ {{if isset($data_list[$i][$form_table['base']['key_field']])}}
{{/if}} @@ -363,6 +387,10 @@ {{/block}} + + {{block name="form_extend"}}{{/block}} + + {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}}
diff --git a/application/api/controller/Common.php b/application/api/controller/Common.php index 10b601b0847a79373d212262d16f683746d53bb7..e29e19d5f1e128e38c0277ce0ff22e98f3a98cd8 100755 --- a/application/api/controller/Common.php +++ b/application/api/controller/Common.php @@ -27,13 +27,9 @@ class Common extends Controller // 用户信息 protected $user; - // 输入参数 post + // 输入参数 post|get|request protected $data_post; - - // 输入参数 get protected $data_get; - - // 输入参数 request protected $data_request; /** @@ -48,14 +44,14 @@ class Common extends Controller { parent::__construct(); - // 系统运行开始 - SystemService::SystemBegin(); - // 输入参数 $this->data_post = input('post.'); $this->data_get = input('get.'); $this->data_request = input(); + // 系统运行开始 + SystemService::SystemBegin(); + // 系统初始化 $this->SystemInit(); diff --git a/application/api/controller/Plugins.php b/application/api/controller/Plugins.php index 7778e4fbebc5f6d02a5a113d3dbec679bba2aefd..71b4757615d7770a948796987821221d27d400de 100644 --- a/application/api/controller/Plugins.php +++ b/application/api/controller/Plugins.php @@ -44,6 +44,9 @@ class Plugins extends Common */ public function Index() { + // 参数 + $params = $this->GetClassVars(); + // 请求参数校验 $p = [ [ @@ -69,12 +72,13 @@ class Plugins extends Common } // 应用名称/控制器/方法 - $pluginsname = $this->data_request['pluginsname']; - $pluginscontrol = strtolower($this->data_request['pluginscontrol']); - $pluginsaction = strtolower($this->data_request['pluginsaction']); + $pluginsname = $params['data_request']['pluginsname']; + $pluginscontrol = strtolower($params['data_request']['pluginscontrol']); + $pluginsaction = strtolower($params['data_request']['pluginsaction']); + unset($params['data_request']['pluginsname'], $params['data_request']['pluginscontrol'], $params['data_request']['pluginsaction']); // 调用 - $ret = PluginsService::PluginsControlCall($pluginsname, $pluginscontrol, $pluginsaction, 'api', $this->data_request); + $ret = PluginsService::PluginsControlCall($pluginsname, $pluginscontrol, $pluginsaction, 'api', $params); if($ret['code'] == 0) { return $ret['data']; @@ -83,5 +87,27 @@ class Plugins extends Common // 调用失败 return $ret; } + + /** + * 获取类属性数据 + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @date 2020-06-07 + * @desc description + */ + public function GetClassVars() + { + $data = []; + $vers = get_class_vars(get_class()); + foreach($vers as $k=>$v) + { + if(property_exists($this, $k)) + { + $data[$k] = $this->$k; + } + } + return $data; + } } ?> \ No newline at end of file diff --git a/application/index/controller/Common.php b/application/index/controller/Common.php index aefa0666bb0d90b998b2b26f7306e80d5834e17b..b35f42e3ead3d50a1a0e5bb16cf67165b5cae52a 100755 --- a/application/index/controller/Common.php +++ b/application/index/controller/Common.php @@ -12,6 +12,7 @@ namespace app\index\controller; use think\facade\Hook; use think\Controller; +use app\module\FormHandleModule; use app\service\SystemService; use app\service\GoodsService; use app\service\NavigationService; @@ -44,6 +45,26 @@ class Common extends Controller // 请求参数 protected $params; + // 当前操作名称 + protected $module_name; + protected $controller_name; + protected $action_name; + + // 输入参数 post|get|request + protected $data_post; + protected $data_get; + protected $data_request; + + // 分页信息 + protected $page; + protected $page_size; + + // 动态表格 + protected $form_table; + protected $form_where; + protected $form_params; + protected $form_error; + /** * 构造方法 * @author Devil @@ -56,6 +77,11 @@ class Common extends Controller { parent::__construct(); + // 输入参数 + $this->data_post = input('post.'); + $this->data_get = input('get.'); + $this->data_request = input(); + // 系统初始化 $this->SystemInit(); @@ -74,6 +100,9 @@ class Common extends Controller // 视图初始化 $this->ViewInit(); + // 动态表格初始化 + $this->FormTableInit(); + // 公共钩子初始化 $this->CommonPluginsInit(); } @@ -148,10 +177,7 @@ class Common extends Controller * @desc description */ private function SystemInit() - { - // 公共参数 - $this->params = input(); - + { // 配置信息初始化 ConfigService::ConfigInit(); @@ -162,9 +188,9 @@ class Common extends Controller } // 推荐人 - if(!empty($this->params['referrer'])) + if(!empty($this->data_request['referrer'])) { - session('share_referrer_id', $this->params['referrer']); + session('share_referrer_id', $this->data_request['referrer']); } } @@ -211,7 +237,7 @@ class Common extends Controller public function ViewInit() { // 公共参数 - $this->assign('params', $this->params); + $this->assign('params', $this->data_request); // 价格符号 $this->assign('price_symbol', config('shopxo.price_symbol')); @@ -319,6 +345,37 @@ class Common extends Controller $this->assign('is_load_baidu_map_api', 0); } + /** + * 动态表格初始化 + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @date 2020-06-02 + * @desc description + */ + public function FormTableInit() + { + // 获取表格模型 + $module = FormModulePath($this->data_request); + if(!empty($module)) + { + // 调用表格处理 + $res = (new FormHandleModule())->Run($module, $this->data_request); + if($res['code'] == 0) + { + $this->form_table = $res['data']['table']; + $this->form_where = $res['data']['where']; + $this->form_params = $res['data']['params']; + + $this->assign('form_table', $this->form_table); + $this->assign('form_params', $this->form_params); + } else { + $this->form_error = $res['msg']; + $this->assign('form_error', $this->form_error); + } + } + } + /** * [NavInit 导航初始化] * @author Devil diff --git a/application/index/controller/Plugins.php b/application/index/controller/Plugins.php index 346acf4fdf6d038f3e18c709a7baaf8d07a84a71..0803f3e6a70202301b747b3547578b6f8684fb93 100755 --- a/application/index/controller/Plugins.php +++ b/application/index/controller/Plugins.php @@ -44,7 +44,7 @@ class Plugins extends Common public function Index() { // 参数 - $params = input(); + $params = $this->GetClassVars(); // 请求参数校验 $p = [ @@ -77,9 +77,10 @@ class Plugins extends Common } // 应用名称/控制器/方法 - $pluginsname = $params['pluginsname']; - $pluginscontrol = strtolower($params['pluginscontrol']); - $pluginsaction = strtolower($params['pluginsaction']); + $pluginsname = $params['data_request']['pluginsname']; + $pluginscontrol = strtolower($params['data_request']['pluginscontrol']); + $pluginsaction = strtolower($params['data_request']['pluginsaction']); + unset($params['data_request']['pluginsname'], $params['data_request']['pluginscontrol'], $params['data_request']['pluginsaction']); // 视图初始化 $this->PluginsViewInit($pluginsname, $pluginscontrol, $pluginsaction); @@ -104,6 +105,28 @@ class Plugins extends Common } } + /** + * 获取类属性数据 + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @date 2020-06-07 + * @desc description + */ + public function GetClassVars() + { + $data = []; + $vers = get_class_vars(get_class()); + foreach($vers as $k=>$v) + { + if(property_exists($this, $k)) + { + $data[$k] = $this->$k; + } + } + return $data; + } + /** * 视图初始化 * @author Devil diff --git a/application/index/controller/Search.php b/application/index/controller/Search.php index a4f9ea8a041bde4358b7dd3849cf6f72a04fd994..dfb1d5b0e80475c463ec454e4be22e8be82041fb 100755 --- a/application/index/controller/Search.php +++ b/application/index/controller/Search.php @@ -56,16 +56,16 @@ class Search extends Common $this->ParamsInit(); // 品牌列表 - $this->assign('brand_list', BrandService::CategoryBrandList(['category_id'=>$this->params['category_id'], 'keywords'=>$this->params['wd']])); + $this->assign('brand_list', BrandService::CategoryBrandList(['category_id'=>$this->data_request['category_id'], 'keywords'=>$this->data_request['wd']])); // 商品分类 - $this->assign('category_list', SearchService::GoodsCategoryList(['category_id'=>$this->params['category_id']])); + $this->assign('category_list', SearchService::GoodsCategoryList(['category_id'=>$this->data_request['category_id']])); // 筛选价格区间 $this->assign('screening_price_list', SearchService::ScreeningPriceList(['field'=>'id,name'])); // 参数 - $this->assign('params', $this->params); + $this->assign('params', $this->data_request); // seo $this->SetSeo(); @@ -86,10 +86,10 @@ class Search extends Common */ private function SetSeo() { - $seo_title = $this->params['wd']; - if(!empty($this->params['category_id'])) + $seo_title = $this->data_request['wd']; + if(!empty($this->data_request['category_id'])) { - $category = GoodsService::GoodsCategoryRow(['id'=>$this->params['category_id'], 'field'=>'name,seo_title,seo_keywords,seo_desc']); + $category = GoodsService::GoodsCategoryRow(['id'=>$this->data_request['category_id'], 'field'=>'name,seo_title,seo_keywords,seo_desc']); if(!empty($category)) { $seo_title = empty($category['seo_title']) ? $category['name'] : $category['seo_title']; @@ -118,23 +118,23 @@ class Search extends Common private function ParamsInit() { // 品牌id - $this->params['brand_id'] = isset($this->params['brand_id']) ? intval($this->params['brand_id']) : 0; + $this->data_request['brand_id'] = isset($this->data_request['brand_id']) ? intval($this->data_request['brand_id']) : 0; // 分类id - $this->params['category_id'] = isset($this->params['category_id']) ? intval($this->params['category_id']) : 0; + $this->data_request['category_id'] = isset($this->data_request['category_id']) ? intval($this->data_request['category_id']) : 0; // 筛选价格id - $this->params['screening_price_id'] = isset($this->params['screening_price_id']) ? intval($this->params['screening_price_id']) : 0; + $this->data_request['screening_price_id'] = isset($this->data_request['screening_price_id']) ? intval($this->data_request['screening_price_id']) : 0; // 搜索关键字 - $this->params['wd'] = empty($this->params['wd']) ? '' : (IS_AJAX ? trim($this->params['wd']) : AsciiToStr($this->params['wd'])); + $this->data_request['wd'] = empty($this->data_request['wd']) ? '' : (IS_AJAX ? trim($this->data_request['wd']) : AsciiToStr($this->data_request['wd'])); // 排序方式 - $this->params['order_by_field'] = empty($this->params['order_by_field']) ? 'default' : $this->params['order_by_field']; - $this->params['order_by_type'] = empty($this->params['order_by_type']) ? 'desc' : $this->params['order_by_type']; + $this->data_request['order_by_field'] = empty($this->data_request['order_by_field']) ? 'default' : $this->data_request['order_by_field']; + $this->data_request['order_by_type'] = empty($this->data_request['order_by_type']) ? 'desc' : $this->data_request['order_by_type']; // 用户信息 - $this->params['user_id'] = isset($this->user['id']) ? $this->user['id'] : 0; + $this->data_request['user_id'] = isset($this->user['id']) ? $this->user['id'] : 0; } /** @@ -157,11 +157,11 @@ class Search extends Common $this->ParamsInit(); // 获取商品列表 - $this->params['keywords'] = $this->params['wd']; - $ret = SearchService::GoodsList($this->params); + $this->data_request['keywords'] = $this->data_request['wd']; + $ret = SearchService::GoodsList($this->data_request); // 搜索记录 - SearchService::SearchAdd($this->params); + SearchService::SearchAdd($this->data_request); // 无数据直接返回 if(empty($ret['data']['data']) || $ret['code'] != 0) diff --git a/application/module/FormHandleModule.php b/application/module/FormHandleModule.php index 7c7388637919bafaab53b02e6b661e403361ae50..5886174cc44740abad51b8925175568c1c739b4e 100644 --- a/application/module/FormHandleModule.php +++ b/application/module/FormHandleModule.php @@ -64,7 +64,7 @@ class FormHandleModule // 获取表格配置数据 $this->form_data = $this->module_obj->$action($this->out_params); - if(empty($this->form_data['base']) || empty($this->form_data['form'])) + if(empty($this->form_data['base']) || !is_array($this->form_data['base']) || empty($this->form_data['form']) || !is_array($this->form_data['form'])) { return DataReturn('表格配置有误['.$module.'][base|form]', -1); } @@ -78,9 +78,12 @@ class FormHandleModule // 基础条件 $this->BaseWhereHandle(); - // 表格处理数据 + // 表格数据处理 $this->FormDataHandle(); + // 基础数据结尾处理 + $this->FormBaseLastHandle(); + // 数据返回 $data = [ 'table' => $this->form_data, @@ -100,264 +103,317 @@ class FormHandleModule */ public function FormDataHandle() { - if(!empty($this->form_data['form'])) + foreach($this->form_data['form'] as $k=>&$v) { - foreach($this->form_data['form'] as $k=>&$v) + // 基础处理 + if(!empty($v['view_type'])) { - // 基础处理 - if(!empty($v['view_type'])) + switch($v['view_type']) { - switch($v['view_type']) - { - // 状态操作 - // 复选框 - // 单选框 - case 'status' : - case 'checkbox' : - case 'radio' : - // 未指定唯一字段名称则使用基础中的唯一字段 - if(empty($v['key_field'])) - { - $v['key_field'] = $this->form_data['base']['key_field']; - } + // 状态操作 + // 复选框 + // 单选框 + case 'status' : + case 'checkbox' : + case 'radio' : + // 未指定唯一字段名称则使用基础中的唯一字段 + if(empty($v['key_field'])) + { + $v['key_field'] = $this->form_data['base']['key_field']; + } - // 复选框 - if($v['view_type'] == 'checkbox') + // 复选框 + if($v['view_type'] == 'checkbox') + { + // 选择/未选中文本 + if(empty($v['checked_text'])) { - // 选择/未选中文本 - if(empty($v['checked_text'])) - { - $v['checked_text'] = '反选'; - } - if(empty($v['not_checked_text'])) - { - $v['not_checked_text'] = '全选'; - } - - // 是否选中 默认否 - $v['is_checked'] = isset($v['is_checked']) ? intval($v['is_checked']) : 0; - - // view key 默认 form_ids_checkbox - if(empty($v['view_key'])) - { - $v['view_key'] = 'form_checkbox_value'; - } - - // 提交参数处理 - if(isset($this->out_params[$v['view_key']])) - { - $value = urldecode($this->out_params[$v['view_key']]); - if(!is_array($value)) - { - $value = explode(',', $value); - } - $this->where_params[$v['view_key']] = $value; - } + $v['checked_text'] = '反选'; } - - // 单选框 - if($v['view_type'] == 'radio') + if(empty($v['not_checked_text'])) { - // 单选标题 - if(empty($v['label'])) - { - $v['label'] = '单选'; - } - - // view key 默认 form_ids_radio - if(empty($v['view_key'])) - { - $v['view_key'] = 'form_radio_value'; - } - - // 提交参数处理 - if(isset($this->out_params[$v['view_key']])) - { - $value = urldecode($this->out_params[$v['view_key']]); - $this->where_params[$v['view_key']] = $value; - } + $v['not_checked_text'] = '全选'; } - break; - } - } - - // 条件处理 - if(!empty($v['search_config']) && !empty($v['search_config']['form_type']) && !empty($v['search_config']['form_name'])) - { - // 基础数据处理 - // 显示名称 - $label = empty($v['label']) ? '' : $v['label']; - - // 唯一 formkey - $form_key = 'fp'.$k; - $v['form_key'] = $form_key; - - // 根据组件类型处理 - switch($v['search_config']['form_type']) - { - // 单个输入 - case 'input' : - // 提示信息处理 - if(empty($v['search_config']['placeholder'])) - { - $v['search_config']['placeholder'] = '请输入'.$label; - } - break; - - // 选择 - case 'select' : - // 提示信息处理 - if(empty($v['search_config']['placeholder'])) - { - $v['search_config']['placeholder'] = '请选择'.$label; - } + // 是否选中 默认否 + $v['is_checked'] = isset($v['is_checked']) ? intval($v['is_checked']) : 0; - // 选择数据 key=>name - if(empty($v['search_config']['data_key'])) + // view key 默认 form_ids_checkbox + if(empty($v['view_key'])) { - $v['search_config']['data_key'] = 'id'; + $v['view_key'] = 'form_checkbox_value'; } - if(empty($v['search_config']['data_name'])) - { - $v['search_config']['data_key'] = 'name'; - } - break; + } - // 区间 - case 'section' : - // 提示信息处理 - if(empty($v['search_config']['placeholder_min'])) - { - $v['search_config']['placeholder_min'] = '最小值'; - } - if(empty($v['search_config']['placeholder_max'])) + // 单选框 + if($v['view_type'] == 'radio') + { + // 单选标题 + if(empty($v['label'])) { - $v['search_config']['placeholder_max'] = '最大值'; + $v['label'] = '单选'; } - break; - // 时间 - case 'datetime' : - case 'date' : - // 提示信息处理 - if(empty($v['search_config']['placeholder_start'])) + // view key 默认 form_ids_radio + if(empty($v['view_key'])) { - $v['search_config']['placeholder_start'] = '开始'; + $v['view_key'] = 'form_radio_value'; } - if(empty($v['search_config']['placeholder_end'])) - { - $v['search_config']['placeholder_end'] = '结束'; - } - break; - } - - // 搜索条件数据处理 - // 表单字段名称 - $name = $v['search_config']['form_name']; - // 条件类型 - $type = isset($v['search_config']['where_type']) ? $v['search_config']['where_type'] : $v['search_config']['form_type']; - // 是否自定义条件处理方法 - $custom = isset($v['search_config']['where_custom']) ? $v['search_config']['where_custom'] : ''; - // 根据条件类型处理 - switch($type) - { - // 单个值 - case '=' : - case '<' : - case '>' : - case '<=' : - case '>=' : - case 'like' : - if(array_key_exists($form_key, $this->out_params) && $this->out_params[$form_key] !== null && $this->out_params[$form_key] !== '') - { - // 参数值 - $value = urldecode($this->out_params[$form_key]); - $this->where_params[$form_key] = $value; + } + break; + } + } + - // 条件值处理 - $value = $this->WhereValueHandle($value, $custom); + // 条件处理 + if(!empty($v['search_config']) && !empty($v['search_config']['form_type']) && !empty($v['search_config']['form_name'])) + { + // 基础数据处理 + // 显示名称 + $label = empty($v['label']) ? '' : $v['label']; - // 是否 like 条件 - if($type == 'like') - { - $value = '%'.$value.'%'; - } + // 唯一 formkey + $form_key = 'fp'.$k; + $v['form_key'] = $form_key; - // 条件 - $this->where[] = [$name, $type, $value]; - } - break; + // 根据组件类型处理 + switch($v['search_config']['form_type']) + { + // 单个输入 + case 'input' : + // 提示信息处理 + if(empty($v['search_config']['placeholder'])) + { + $v['search_config']['placeholder'] = '请输入'.$label; + } + break; + + // 选择 + case 'select' : + // 提示信息处理 + if(empty($v['search_config']['placeholder'])) + { + $v['search_config']['placeholder'] = '请选择'.$label; + } + + // 选择数据 key=>name + if(empty($v['search_config']['data_key'])) + { + $v['search_config']['data_key'] = 'id'; + } + if(empty($v['search_config']['data_name'])) + { + $v['search_config']['data_key'] = 'name'; + } + break; + + // 区间 + case 'section' : + // 提示信息处理 + if(empty($v['search_config']['placeholder_min'])) + { + $v['search_config']['placeholder_min'] = '最小值'; + } + if(empty($v['search_config']['placeholder_max'])) + { + $v['search_config']['placeholder_max'] = '最大值'; + } + break; + + // 时间 + case 'datetime' : + case 'date' : + // 提示信息处理 + if(empty($v['search_config']['placeholder_start'])) + { + $v['search_config']['placeholder_start'] = '开始'; + } + if(empty($v['search_config']['placeholder_end'])) + { + $v['search_config']['placeholder_end'] = '结束'; + } + break; + } - // in - case 'in' : - if(array_key_exists($form_key, $this->out_params) && $this->out_params[$form_key] !== null && $this->out_params[$form_key] !== '') + // 搜索条件数据处理 + // 表单字段名称 + $name = $v['search_config']['form_name']; + // 条件类型 + $type = isset($v['search_config']['where_type']) ? $v['search_config']['where_type'] : $v['search_config']['form_type']; + // 是否自定义条件处理方法 + $custom = isset($v['search_config']['where_custom']) ? $v['search_config']['where_custom'] : ''; + // 根据条件类型处理 + switch($type) + { + // 单个值 + case '=' : + case '<' : + case '>' : + case '<=' : + case '>=' : + case 'like' : + if(array_key_exists($form_key, $this->out_params) && $this->out_params[$form_key] !== null && $this->out_params[$form_key] !== '') + { + // 参数值 + $value = urldecode($this->out_params[$form_key]); + $this->where_params[$form_key] = $value; + + // 条件值处理 + $value = $this->WhereValueHandle($value, $custom); + + // 是否 like 条件 + if($type == 'like') { - // 参数值 - $value = urldecode($this->out_params[$form_key]); - if(!is_array($value)) - { - $value = explode(',', $value); - } - $this->where_params[$form_key] = $value; - - // 条件 - $this->where[] = [$name, $type, $this->WhereValueHandle($value, $custom)]; + $value = '%'.$value.'%'; } - break; - // 区间值 - case 'section' : - $key_min = $form_key.'_min'; - $key_max = $form_key.'_max'; - if(array_key_exists($key_min, $this->out_params) && $this->out_params[$key_min] !== null && $this->out_params[$key_min] !== '') + // 条件 + $this->where[] = [$name, $type, $value]; + } + break; + + // in + case 'in' : + if(array_key_exists($form_key, $this->out_params) && $this->out_params[$form_key] !== null && $this->out_params[$form_key] !== '') + { + // 参数值 + $value = urldecode($this->out_params[$form_key]); + if(!is_array($value)) { - // 参数值 - $value = urldecode($this->out_params[$key_min]); - $this->where_params[$key_min] = $value; - - // 条件 - $this->where[] = [$name, '>=', $this->WhereValueHandle($value, $custom, ['is_min'=>1])]; + $value = explode(',', $value); } - if(array_key_exists($key_max, $this->out_params) && $this->out_params[$key_max] !== null && $this->out_params[$key_max] !== '') - { - // 参数值 - $value = urldecode($this->out_params[$key_max]); - $this->where_params[$key_max] = $value; - - // 条件 - $this->where[] = [$name, '<=', $this->WhereValueHandle($value, $custom, ['is_end'=>1])]; - } - break; - - // 时间 - case 'datetime' : - case 'date' : - $key_start = $form_key.'_start'; - $key_end = $form_key.'_end'; - if(array_key_exists($key_start, $this->out_params) && $this->out_params[$key_start] !== null && $this->out_params[$key_start] !== '') - { - // 参数值 - $value = urldecode($this->out_params[$key_start]); - $this->where_params[$key_start] = $value; + $this->where_params[$form_key] = $value; + + // 条件 + $this->where[] = [$name, $type, $this->WhereValueHandle($value, $custom)]; + } + break; + + // 区间值 + case 'section' : + $key_min = $form_key.'_min'; + $key_max = $form_key.'_max'; + if(array_key_exists($key_min, $this->out_params) && $this->out_params[$key_min] !== null && $this->out_params[$key_min] !== '') + { + // 参数值 + $value = urldecode($this->out_params[$key_min]); + $this->where_params[$key_min] = $value; + + // 条件 + $this->where[] = [$name, '>=', $this->WhereValueHandle($value, $custom, ['is_min'=>1])]; + } + if(array_key_exists($key_max, $this->out_params) && $this->out_params[$key_max] !== null && $this->out_params[$key_max] !== '') + { + // 参数值 + $value = urldecode($this->out_params[$key_max]); + $this->where_params[$key_max] = $value; + + // 条件 + $this->where[] = [$name, '<=', $this->WhereValueHandle($value, $custom, ['is_end'=>1])]; + } + break; + + // 时间 + case 'datetime' : + case 'date' : + $key_start = $form_key.'_start'; + $key_end = $form_key.'_end'; + if(array_key_exists($key_start, $this->out_params) && $this->out_params[$key_start] !== null && $this->out_params[$key_start] !== '') + { + // 参数值 + $value = urldecode($this->out_params[$key_start]); + $this->where_params[$key_start] = $value; + + // 条件 + $this->where[] = [$name, '>=', $this->WhereValueHandle(strtotime($value), $custom, ['is_start'=>1])]; + } + if(array_key_exists($key_end, $this->out_params) && $this->out_params[$key_end] !== null && $this->out_params[$key_end] !== '') + { + // 参数值 + $value = urldecode($this->out_params[$key_end]); + $this->where_params[$key_end] = $value; + + // 条件 + $this->where[] = [$name, '<=', $this->WhereValueHandle(strtotime($value), $custom, ['is_end'=>1])]; + + } + break; + } + } + } + } - // 条件 - $this->where[] = [$name, '>=', $this->WhereValueHandle(strtotime($value), $custom, ['is_start'=>1])]; - } - if(array_key_exists($key_end, $this->out_params) && $this->out_params[$key_end] !== null && $this->out_params[$key_end] !== '') - { - // 参数值 - $value = urldecode($this->out_params[$key_end]); - $this->where_params[$key_end] = $value; + /** + * 基础数据结尾处理 + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @date 2020-06-06 + * @desc description + */ + public function FormBaseLastHandle() + { + // 异步请求超时时间 + if(empty($this->form_data['base']['timeout'])) + { + $this->form_data['base']['timeout'] = 30000; + } - // 条件 - $this->where[] = [$name, '<=', $this->WhereValueHandle(strtotime($value), $custom, ['is_end'=>1])]; + // 是否开启删除 + if(isset($this->form_data['base']['is_delete']) && $this->form_data['base']['is_delete'] == 1) + { + // 是否指定选择列字段名称 + // 默认一(第一个复选框) + // 默认二(第一个单选框) + if(empty($this->form_data['base']['delete_form'])) + { + // 所有 form 类型 + $form_type = array_column($this->form_data['form'], 'view_type'); + if(!empty($form_type)) + { + // 是否存在复选框 + if(in_array('checkbox', $form_type)) + { + $index = array_search('checkbox', $form_type); + if($index !== false) + { + $this->form_data['base']['delete_form'] = $this->form_data['form'][$index]['view_key']; + } + } - } - break; + // 是否存在单选框 + if(empty($this->form_data['base']['delete_form']) && in_array('radio', $form_type)) + { + $index = array_search('radio', $form_type); + if($index !== false) + { + $this->form_data['base']['delete_form'] = $this->form_data['form'][$index]['view_key']; + } } } + + // 未匹配到则默认 ids + if(empty($this->form_data['base']['delete_form'])) + { + $this->form_data['base']['delete_form'] = 'ids'; + } + } + + // 提交数据的字段名称 + if(empty($this->form_data['base']['delete_key'])) + { + $this->form_data['base']['delete_key'] = $this->form_data['base']['delete_form']; + } + + // 确认框信息 标题/描述 + if(empty($this->form_data['base']['confirm_title'])) + { + $this->form_data['base']['confirm_title'] = '温馨提示'; + } + if(empty($this->form_data['base']['confirm_msg'])) + { + $this->form_data['base']['confirm_msg'] = '删除后不可恢复、确认操作吗?'; } } } diff --git a/application/service/GoodsService.php b/application/service/GoodsService.php index 8ec5653a4d755a355c33a4ec500650c32c94f4a3..0ce3d0354aeb77f1a3390a4dcbd1b6f697eaaa8b 100755 --- a/application/service/GoodsService.php +++ b/application/service/GoodsService.php @@ -1790,43 +1790,48 @@ class GoodsService public static function GoodsDelete($params = []) { // 参数是否有误 - if(empty($params['id'])) + if(empty($params['ids'])) { return DataReturn('商品id有误', -1); } + // 是否数组 + if(!is_array($params['ids'])) + { + $params['ids'] = explode(',', $params['ids']); + } // 开启事务 Db::startTrans(); // 删除商品 - if(Db::name('Goods')->delete(intval($params['id']))) + if(Db::name('Goods')->where(['id'=>$params['ids']])->delete()) { // 商品规格 - if(Db::name('GoodsSpecType')->where(['goods_id'=>intval($params['id'])])->delete() === false) + if(Db::name('GoodsSpecType')->where(['goods_id'=>$params['ids']])->delete() === false) { Db::rollback(); return DataReturn('规格类型删除失败', -100); } - if(Db::name('GoodsSpecValue')->where(['goods_id'=>intval($params['id'])])->delete() === false) + if(Db::name('GoodsSpecValue')->where(['goods_id'=>$params['ids']])->delete() === false) { Db::rollback(); return DataReturn('规格值删除失败', -100); } - if(Db::name('GoodsSpecBase')->where(['goods_id'=>intval($params['id'])])->delete() === false) + if(Db::name('GoodsSpecBase')->where(['goods_id'=>$params['ids']])->delete() === false) { Db::rollback(); return DataReturn('规格基础删除失败', -100); } // 相册 - if(Db::name('GoodsPhoto')->where(['goods_id'=>intval($params['id'])])->delete() === false) + if(Db::name('GoodsPhoto')->where(['goods_id'=>$params['ids']])->delete() === false) { Db::rollback(); return DataReturn('相册删除失败', -100); } // app内容 - if(Db::name('GoodsContentApp')->where(['goods_id'=>intval($params['id'])])->delete() === false) + if(Db::name('GoodsContentApp')->where(['goods_id'=>$params['ids']])->delete() === false) { Db::rollback(); return DataReturn('相册删除失败', -100); diff --git a/application/service/PluginsService.php b/application/service/PluginsService.php index 9848abd405e406b4781263d349c6663444ec38f1..749127662a67e8ff2e582f55899dbd7e170c6f2f 100755 --- a/application/service/PluginsService.php +++ b/application/service/PluginsService.php @@ -241,7 +241,7 @@ class PluginsService // 调用方法 $action = ucfirst($action); - $obj = new $plugins(); + $obj = new $plugins($params); if(!method_exists($obj, $action)) { return DataReturn('应用方法未定义['.$action.']', -1); diff --git a/config/shopxo.sql b/config/shopxo.sql index 2696e3562848065c363b4ad9c873cf2ea143e7e5..d52c3670f0cd1d9899e9bae6204b2dfc2b61326c 100644 --- a/config/shopxo.sql +++ b/config/shopxo.sql @@ -11,7 +11,7 @@ Target Server Version : 50729 File Encoding : utf-8 - Date: 06/03/2020 13:37:47 PM + Date: 06/07/2020 10:10:59 AM */ SET NAMES utf8mb4; @@ -40,7 +40,7 @@ CREATE TABLE `s_admin` ( -- Records of `s_admin` -- ---------------------------- BEGIN; -INSERT INTO `s_admin` VALUES ('1', 'admin', '235d071df1d35d9ac03663967e8ddb88', '621573', '17688888888', '0', '482', '1590748962', '1', '1481350313', '1551341520'), ('4', 'shopxo', '29297307e33b6c4b4b1a218b2c5bd0af', '162258', '', '0', '3', '1588067855', '13', '1580807200', '1588067050'); +INSERT INTO `s_admin` VALUES ('1', 'admin', '01f56f3c1427206daadeb762ecb50def', '963989', '17688888888', '0', '484', '1591268533', '1', '1481350313', '1551341520'), ('4', 'shopxo', '29297307e33b6c4b4b1a218b2c5bd0af', '162258', '', '0', '3', '1588067855', '13', '1580807200', '1588067050'); COMMIT; -- ---------------------------- @@ -428,7 +428,7 @@ CREATE TABLE `s_goods` ( -- Records of `s_goods` -- ---------------------------- BEGIN; -INSERT INTO `s_goods` VALUES ('1', '1', 'MIUI/小米 小米手机4 小米4代 MI4智能4G手机包邮 黑色 D-LTE(4G)/TD-SCD', '', '', '', '0', '102', '步', '/static/upload/images/goods/2019/01/14/1547450781101144.jpg', '3200.00', '3200.00', '3200.00', '2100.00', '2100.00', '2100.00', '10', '1', '0', '1', '1', '1', '


', '2', '10', '182', '', '/static/upload/images/goods/2019/01/14/1547450781101144.jpg', '0', '', '

https://pan.baidu.com/s/18xyUNruvohr5JCdorvaz5w     提取码 v3y4

', '', '', '', '0', '1547450921', '1590673869'), ('2', '2', '苹果(Apple)iPhone 6 Plus (A1524)移动联通电信4G手机 金色 16G', '', '', 'iPhone 6 Plus', '0', '1646', '步', '/static/upload/images/goods/2019/01/14/1547451274847894.jpg', '6000.00-7600.00', '6000.00', '7600.00', '4500.00-6800.00', '4500.00', '6800.00', '30', '1', '0', '1', '1', '1', '


', '2', '35', '1402', '/static/upload/video/goods/2019/01/14/1547458876723311.mp4', '/static/upload/images/goods/2019/01/14/1547451274847894.jpg', '1', '', '', '', '', '', '0', '1547451624', '1577693715'), ('3', '2', 'Samsung/三星 SM-G8508S GALAXY Alpha四核智能手机 新品 闪耀白', '', '', '', '0', '222', '步', '/static/upload/images/goods/2019/01/14/1547451909951171.jpg', '6866.00', '6866.00', '6866.00', '3888.00', '3888.00', '3888.00', '20', '1', '0', '1', '1', '1', '


', '2', '4', '232', '', '/static/upload/images/goods/2019/01/14/1547451909951171.jpg', '0', null, null, '', '', '', '0', '1547452007', '1547452007'), ('4', '1', 'Huawei/华为 H60-L01 荣耀6 移动4G版智能手机 安卓', '', '', '', '0', '523', '步', '/static/upload/images/goods/2019/01/14/1547452474332334.jpg', '2300.00', '2300.00', '2300.00', '1999.00', '1999.00', '1999.00', '19', '1', '0', '1', '1', '1', '


', '2', '4', '235', '', '/static/upload/images/goods/2019/01/14/1547452474332334.jpg', '0', null, null, '', '', '', '0', '1547452553', '1547452553'), ('5', '2', 'Meizu/魅族 MX4 Pro移动版 八核大屏智能手机 黑色 16G', '', '', '', '0', '412', '步', '/static/upload/images/goods/2019/01/14/1547452714324599.jpg', '3200.00', '3200.00', '3200.00', '2499.00', '2499.00', '2499.00', '56', '1', '0', '1', '1', '1', '


', '2', '10', '519', '', '/static/upload/images/goods/2019/01/14/1547452714324599.jpg', '0', null, null, '', '', '', '0', '1547452798', '1547452798'), ('6', '1', 'vivo X5MAX L 移动4G 八核超薄大屏5.5吋双卡手机vivoX5max', '', '', '', '0', '310', '步', '/static/upload/images/goods/2019/01/14/1547453000703308.jpg', '3200.00', '3200.00', '3200.00', '2998.90', '2998.90', '2998.90', '65', '1', '0', '1', '1', '1', '

 X5L/SL/V/M (5.0寸)  X5max钢化膜(5.5寸)  X5pro钢化膜(5.2寸) 



', '2', '1', '363', '', '/static/upload/images/goods/2019/01/14/1547453000703308.jpg', '0', null, null, '', '', '', '0', '1547453135', '1564057484'), ('7', '1', '纽芝兰包包女士2018新款潮百搭韩版时尚单肩斜挎包少女小挎包链条', '', '', '', '0', '285', '件', '/static/upload/images/goods/2019/01/14/1547453895416529.jpg', '760.00', '760.00', '760.00', '168.00', '168.00', '168.00', '11', '1', '0', '1', '1', '1', '


', '2', '7', '459', '', '/static/upload/images/goods/2019/01/15/1547540603500383.jpg', '0', null, null, '', '', '', '0', '1547453967', '1554485498'), ('8', '1', 'MARNI Trunk 女士 中号拼色十字纹小牛皮 斜挎风琴包', '', '', '', '0', '25', '件', '/static/upload/images/goods/2019/01/14/1547454145355962.jpg', '0.00', '0.00', '0.00', '356.00', '356.00', '356.00', '8', '3', '6', '1', '1', '1', '



', '2', '1', '331', '', '/static/upload/images/goods/2019/01/14/1547454145355962.jpg', '0', '', '', '', '', '', '0', '1547454269', '1584869425'), ('9', '2', '睡衣女长袖春秋季纯棉韩版女士大码薄款春夏季全棉家居服两件套装', '', '', '', '0', '561', '件', '/static/upload/images/goods/2019/01/14/1547454702543219.jpg', '160.00-216.00', '160.00', '216.00', '120.00-158.00', '120.00', '158.00', '2', '1', '0', '1', '1', '1', '


', '3', '18', '406', '', '/static/upload/images/goods/2019/01/14/1547454567172116.jpg', '1', '', null, '', '', '', '0', '1547454786', '1570168238'), ('10', '0', '夏装女装古力娜扎明星同款一字领露肩蓝色蕾丝修身显瘦连衣裙礼服', '', '', '', '0', '43432', '件', '/static/upload/images/goods/2019/01/14/1547455240794230.jpg', '568.00', '568.00', '568.00', '228.00', '228.00', '228.00', '28', '1', '1', '1', '1', '0', '

【品牌】欧单 学媛风 猫咪良品

【吊牌】xueyuanfeng 猫咪良品

【面料质地】涤棉拼接蕾丝  后中拉链 有内衬(非专业机构鉴定,介意请慎拍)

好的衣服需要好好呵护,务必请冷水手洗(切记别浸泡)拧干就晾晒或则干洗哦~

【商品颜色】实物拍摄 蓝色 颜色很难拍有小色差属正常现象哦

【商品尺寸】XS/S/M/L 小高腰设计 胸口纽扣是装饰的哦


XS码尺寸: 悬挂衣长81CM.胸围80内合适.腰围63CM.臀围86CM


S码尺寸: 悬挂衣长82CM.胸围84内合适.腰围67CM.臀围90CM

M码尺寸: 悬挂衣长83CM.胸围88内合适.腰围71CM.臀围94CM

L码尺寸: 悬挂衣长84CM.胸围92内合适.腰围75CM.臀围98CM


(测量单位是CM,每个人的测量方式不一样,测量的尺寸数据可能会有1~3厘米的差异,请MM们谅解哦)

PS:常规码数,可按平时号选择哦。修身版型~如果上身偏大可以适当考虑大1号~下摆蕾丝拼接不会很平整的哦~

蕾丝花是手工修剪出来的,每件都有不同和不规则的哦,有小线头和节点是正常现象哦~请亲们谅解哦~


', '2', '7', '457', '', '/static/upload/images/goods/2019/01/14/1547455222990904.jpg', '0', '', '

https://pan.baidu.com/s/1XTSM-EJZwEgLmGx3ZyFMGQ   提取码:dcs4

', '', '', '', '0', '1547455375', '1590918953'), ('11', '0', '夏季复古ins风格网红SP同款 短袖大圆领香槟色蕾丝绣花钉珠连衣裙', '', '', '', '0', '36665965', '件', '/static/upload/images/goods/2019/01/14/1547455601314107.jpg', '268.00-422.00', '268.00', '422.00', '160.00-258.00', '160.00', '258.00', '1', '1', '0', '1', '1', '1', '

【品牌】欧单 学媛风 猫咪良品

【吊牌】xueyuanfeng 猫咪良品

【面料质地】网纱绣花钉珠拼接蕾丝 拉链有内衬(非专业机构鉴定,介意请慎拍)

好的衣服需要好好呵护,务必请冷水手洗(切记别浸泡)拧干就晾晒或则干洗哦~

【商品颜色】实物拍摄 香槟色 颜色很难拍有小色差属正常现象哦

【商品尺寸】XS/S/M/L 小高腰设计 胸那考虑撑开因素哦 微弹的哦


XS码尺寸: 衣长82CM.胸围80内合适.腰围63CM.臀围86CM


S码尺寸: 衣长83CM.胸围84内合适.腰围67CM.臀围90CM

M码尺寸: 衣长84CM.胸围88内合适.腰围71CM.臀围94CM

L码尺寸: 衣长85CM.胸围92内合适.腰围75CM.臀围98CM


(测量单位是CM,每个人的测量方式不一样,测量的尺寸数据可能会有1~3厘米的差异,请MM们谅解哦)

PS:常规码数,可按平时号选择哦。修身版型,如果腰粗可以适当考虑大1号哦~

大圆领,每个人的身材曲线不同,领口不会很平的哦,请谅解~

肩膀那有暗扣哦,可以很好的隐藏了内衣的肩带哦~袖子那略硬哦~



', '4', '2', '294', '', '/static/upload/images/goods/2019/01/14/1547455566118614.jpg', '1', '', '', '', '', '', '0', '1547455700', '1590918956'), ('12', '2', 'ZK星星绣花雪纺连衣裙中长款sukol裙少女心温柔超仙女chic裙子夏', '', '轻奢醋酸面料,高标准的生产要求,品质保证', 'xxxxhhhhhh商品型号', '0', '395', '件', '/static/upload/images/goods/2019/01/14/1547455890402147.jpg', '188.00', '188.00', '188.00', '0.01', '0.01', '0.01', '3', '1', '0', '1', '1', '0', '


112233445566
qwerty
asdfgh
zxcvbn


\"d-1.jpg\"/

\"d-2.jpg\"/

', '3', '3', '985', '', '/static/upload/images/goods/2019/01/14/1547455890402147.jpg', '1', '[{\"title\":\"\\u989c\\u8272\",\"value\":[\"\\u7c89\\u8272\",\"\\u767d\\u8272\"]},{\"title\":\"\\u5c3a\\u7801\",\"value\":[\"S\",\"M\",\"L\"]}]', '', 'ZK爆款连衣裙', '连衣裙,裙子', '夏季连衣裙,瘦身裙子', '0', '1547456230', '1590933899'); +INSERT INTO `s_goods` VALUES ('1', '1', 'MIUI/小米 小米手机4 小米4代 MI4智能4G手机包邮 黑色 D-LTE(4G)/TD-SCD', '', '', '', '0', '102', '步', '/static/upload/images/goods/2019/01/14/1547450781101144.jpg', '3200.00', '3200.00', '3200.00', '2100.00', '2100.00', '2100.00', '10', '1', '0', '1', '1', '1', '


', '2', '10', '182', '', '/static/upload/images/goods/2019/01/14/1547450781101144.jpg', '0', '', '

https://pan.baidu.com/s/18xyUNruvohr5JCdorvaz5w     提取码 v3y4

', '', '', '', '0', '1547450921', '1590673869'), ('2', '2', '苹果(Apple)iPhone 6 Plus (A1524)移动联通电信4G手机 金色 16G', '', '', 'iPhone 6 Plus', '0', '1646', '步', '/static/upload/images/goods/2019/01/14/1547451274847894.jpg', '6000.00-7600.00', '6000.00', '7600.00', '4500.00-6800.00', '4500.00', '6800.00', '30', '1', '0', '1', '1', '1', '


', '2', '35', '1402', '/static/upload/video/goods/2019/01/14/1547458876723311.mp4', '/static/upload/images/goods/2019/01/14/1547451274847894.jpg', '1', '', '', '', '', '', '0', '1547451624', '1577693715'), ('3', '2', 'Samsung/三星 SM-G8508S GALAXY Alpha四核智能手机 新品 闪耀白', '', '', '', '0', '222', '步', '/static/upload/images/goods/2019/01/14/1547451909951171.jpg', '6866.00', '6866.00', '6866.00', '3888.00', '3888.00', '3888.00', '20', '1', '0', '1', '1', '1', '


', '2', '4', '233', '', '/static/upload/images/goods/2019/01/14/1547451909951171.jpg', '0', null, null, '', '', '', '0', '1547452007', '1547452007'), ('4', '1', 'Huawei/华为 H60-L01 荣耀6 移动4G版智能手机 安卓', '', '', '', '0', '523', '步', '/static/upload/images/goods/2019/01/14/1547452474332334.jpg', '2300.00', '2300.00', '2300.00', '1999.00', '1999.00', '1999.00', '19', '1', '0', '1', '1', '1', '


', '2', '4', '235', '', '/static/upload/images/goods/2019/01/14/1547452474332334.jpg', '0', null, null, '', '', '', '0', '1547452553', '1547452553'), ('5', '2', 'Meizu/魅族 MX4 Pro移动版 八核大屏智能手机 黑色 16G', '', '', '', '0', '412', '步', '/static/upload/images/goods/2019/01/14/1547452714324599.jpg', '3200.00', '3200.00', '3200.00', '2499.00', '2499.00', '2499.00', '56', '1', '0', '1', '1', '1', '


', '2', '10', '519', '', '/static/upload/images/goods/2019/01/14/1547452714324599.jpg', '0', null, null, '', '', '', '0', '1547452798', '1547452798'), ('6', '1', 'vivo X5MAX L 移动4G 八核超薄大屏5.5吋双卡手机vivoX5max', '', '', '', '0', '310', '步', '/static/upload/images/goods/2019/01/14/1547453000703308.jpg', '3200.00', '3200.00', '3200.00', '2998.90', '2998.90', '2998.90', '65', '1', '0', '1', '1', '1', '

 X5L/SL/V/M (5.0寸)  X5max钢化膜(5.5寸)  X5pro钢化膜(5.2寸) 



', '2', '1', '363', '', '/static/upload/images/goods/2019/01/14/1547453000703308.jpg', '0', null, null, '', '', '', '0', '1547453135', '1564057484'), ('7', '1', '纽芝兰包包女士2018新款潮百搭韩版时尚单肩斜挎包少女小挎包链条', '', '', '', '0', '285', '件', '/static/upload/images/goods/2019/01/14/1547453895416529.jpg', '760.00', '760.00', '760.00', '168.00', '168.00', '168.00', '11', '1', '0', '1', '1', '1', '


', '2', '7', '459', '', '/static/upload/images/goods/2019/01/15/1547540603500383.jpg', '0', null, null, '', '', '', '0', '1547453967', '1554485498'), ('8', '1', 'MARNI Trunk 女士 中号拼色十字纹小牛皮 斜挎风琴包', '', '', '', '0', '25', '件', '/static/upload/images/goods/2019/01/14/1547454145355962.jpg', '0.00', '0.00', '0.00', '356.00', '356.00', '356.00', '8', '3', '6', '1', '1', '1', '



', '2', '1', '331', '', '/static/upload/images/goods/2019/01/14/1547454145355962.jpg', '0', '', '', '', '', '', '0', '1547454269', '1584869425'), ('9', '2', '睡衣女长袖春秋季纯棉韩版女士大码薄款春夏季全棉家居服两件套装', '', '', '', '0', '561', '件', '/static/upload/images/goods/2019/01/14/1547454702543219.jpg', '160.00-216.00', '160.00', '216.00', '120.00-158.00', '120.00', '158.00', '2', '1', '0', '1', '1', '1', '


', '3', '18', '406', '', '/static/upload/images/goods/2019/01/14/1547454567172116.jpg', '1', '', null, '', '', '', '0', '1547454786', '1570168238'), ('10', '0', '夏装女装古力娜扎明星同款一字领露肩蓝色蕾丝修身显瘦连衣裙礼服', '', '', '', '0', '43432', '件', '/static/upload/images/goods/2019/01/14/1547455240794230.jpg', '568.00', '568.00', '568.00', '228.00', '228.00', '228.00', '28', '1', '1', '1', '1', '0', '

【品牌】欧单 学媛风 猫咪良品

【吊牌】xueyuanfeng 猫咪良品

【面料质地】涤棉拼接蕾丝  后中拉链 有内衬(非专业机构鉴定,介意请慎拍)

好的衣服需要好好呵护,务必请冷水手洗(切记别浸泡)拧干就晾晒或则干洗哦~

【商品颜色】实物拍摄 蓝色 颜色很难拍有小色差属正常现象哦

【商品尺寸】XS/S/M/L 小高腰设计 胸口纽扣是装饰的哦


XS码尺寸: 悬挂衣长81CM.胸围80内合适.腰围63CM.臀围86CM


S码尺寸: 悬挂衣长82CM.胸围84内合适.腰围67CM.臀围90CM

M码尺寸: 悬挂衣长83CM.胸围88内合适.腰围71CM.臀围94CM

L码尺寸: 悬挂衣长84CM.胸围92内合适.腰围75CM.臀围98CM


(测量单位是CM,每个人的测量方式不一样,测量的尺寸数据可能会有1~3厘米的差异,请MM们谅解哦)

PS:常规码数,可按平时号选择哦。修身版型~如果上身偏大可以适当考虑大1号~下摆蕾丝拼接不会很平整的哦~

蕾丝花是手工修剪出来的,每件都有不同和不规则的哦,有小线头和节点是正常现象哦~请亲们谅解哦~


', '2', '7', '457', '', '/static/upload/images/goods/2019/01/14/1547455222990904.jpg', '0', '', '

https://pan.baidu.com/s/1XTSM-EJZwEgLmGx3ZyFMGQ   提取码:dcs4

', '', '', '', '0', '1547455375', '1590918953'), ('11', '0', '夏季复古ins风格网红SP同款 短袖大圆领香槟色蕾丝绣花钉珠连衣裙', '', '', '', '0', '36665965', '件', '/static/upload/images/goods/2019/01/14/1547455601314107.jpg', '268.00-422.00', '268.00', '422.00', '160.00-258.00', '160.00', '258.00', '1', '1', '0', '1', '1', '1', '

【品牌】欧单 学媛风 猫咪良品

【吊牌】xueyuanfeng 猫咪良品

【面料质地】网纱绣花钉珠拼接蕾丝 拉链有内衬(非专业机构鉴定,介意请慎拍)

好的衣服需要好好呵护,务必请冷水手洗(切记别浸泡)拧干就晾晒或则干洗哦~

【商品颜色】实物拍摄 香槟色 颜色很难拍有小色差属正常现象哦

【商品尺寸】XS/S/M/L 小高腰设计 胸那考虑撑开因素哦 微弹的哦


XS码尺寸: 衣长82CM.胸围80内合适.腰围63CM.臀围86CM


S码尺寸: 衣长83CM.胸围84内合适.腰围67CM.臀围90CM

M码尺寸: 衣长84CM.胸围88内合适.腰围71CM.臀围94CM

L码尺寸: 衣长85CM.胸围92内合适.腰围75CM.臀围98CM


(测量单位是CM,每个人的测量方式不一样,测量的尺寸数据可能会有1~3厘米的差异,请MM们谅解哦)

PS:常规码数,可按平时号选择哦。修身版型,如果腰粗可以适当考虑大1号哦~

大圆领,每个人的身材曲线不同,领口不会很平的哦,请谅解~

肩膀那有暗扣哦,可以很好的隐藏了内衣的肩带哦~袖子那略硬哦~



', '4', '2', '295', '', '/static/upload/images/goods/2019/01/14/1547455566118614.jpg', '1', '', '', '', '', '', '0', '1547455700', '1590918956'), ('12', '2', 'ZK星星绣花雪纺连衣裙中长款sukol裙少女心温柔超仙女chic裙子夏', '', '轻奢醋酸面料,高标准的生产要求,品质保证', 'xxxxhhhhhh商品型号', '0', '395', '件', '/static/upload/images/goods/2019/01/14/1547455890402147.jpg', '188.00', '188.00', '188.00', '0.01', '0.01', '0.01', '3', '1', '0', '1', '1', '0', '


112233445566
qwerty
asdfgh
zxcvbn


\"d-1.jpg\"/

\"d-2.jpg\"/

', '3', '3', '986', '', '/static/upload/images/goods/2019/01/14/1547455890402147.jpg', '1', '[{\"title\":\"\\u989c\\u8272\",\"value\":[\"\\u7c89\\u8272\",\"\\u767d\\u8272\"]},{\"title\":\"\\u5c3a\\u7801\",\"value\":[\"S\",\"M\",\"L\"]}]', '', 'ZK爆款连衣裙', '连衣裙,裙子', '夏季连衣裙,瘦身裙子', '0', '1547456230', '1591370137'); COMMIT; -- ---------------------------- @@ -1093,13 +1093,13 @@ CREATE TABLE `s_plugins` ( PRIMARY KEY (`id`), UNIQUE KEY `plugins` (`plugins`), KEY `is_enable` (`is_enable`) -) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='应用'; +) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='应用'; -- ---------------------------- -- Records of `s_plugins` -- ---------------------------- BEGIN; -INSERT INTO `s_plugins` VALUES ('1', 'neworderemail', null, '1', '1589020475', '1589020478'), ('2', 'orderremind', '{\"monitor_action\":\"1\",\"is_voice_notice\":\"1\"}', '1', '1589021304', '1589032717'); +INSERT INTO `s_plugins` VALUES ('1', 'neworderemail', null, '1', '1589020475', '1589020478'), ('2', 'orderremind', '{\"monitor_action\":\"1\",\"is_voice_notice\":\"1\"}', '1', '1589021304', '1589032717'), ('3', 'quotation', null, '1', '1591351804', '1591351827'); COMMIT; -- ---------------------------- @@ -1392,13 +1392,13 @@ CREATE TABLE `s_user` ( KEY `username` (`username`), KEY `token` (`token`), KEY `baidu_openid` (`baidu_openid`) -) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='用户'; +) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='用户'; -- ---------------------------- -- Records of `s_user` -- ---------------------------- BEGIN; -INSERT INTO `s_user` VALUES ('1', '', '', '', '', '', '', '', '', '0', '432207', 'a689e4dae15e1e72143643a4c195c690', '', 'qqqqqq', '', '', '', '0', '', '', '', '0', '', '0', '0', '0', '0', '1589032739', '1589521357'), ('2', '', '', '', '', '', '', '', '', '0', '727732', '85ef59c476a25453992661cfbc747fae', '', '', '', '', 'fuxiang.gong@qq.com', '0', '', '', '', '0', '', '0', '0', '0', '0', '1591158965', '1591161394'); +INSERT INTO `s_user` VALUES ('1', '', '', '', '', '', '', '', '', '0', '432207', 'a689e4dae15e1e72143643a4c195c690', '', 'qqqqqq', '', '', '', '0', '', '', '', '0', '', '0', '0', '0', '0', '1589032739', '1589521357'), ('2', '', '', '', '', '', '', '', '', '0', '727732', '85ef59c476a25453992661cfbc747fae', '', '', '', '', 'fuxiang.gong@qq.com', '0', '', '', '', '0', '', '0', '0', '0', '0', '1591158965', '1591161394'), ('3', '', 'oblE347o4d3-Hwq3HODqona2J4Rk', '', '', '', '', '', '', '0', '', '', '2165b89faef4edc7d367a5a0c74877a2', '', '雨声', '', '', '2', 'https://wx.qlogo.cn/mmopen/vi_32/Q0j4TwGTfTIBvc14pRJGEhWibYSQfw06bPVZaOffOSENEhwDXSeLXvFWsQo2TTxdpsQfjCsibZCHqHBPtUWDobFw/132', 'Shanghai', '', '0', '', '0', '0', '0', '0', '1591251891', '1591251891'); COMMIT; -- ---------------------------- diff --git a/public/static/admin/default/css/goods.css b/public/static/admin/default/css/goods.css index 2acfe956685a765f326a052fe3417aa6109bb2e5..5661a9e58b0cd9ea7801141837404f76a338b54f 100755 --- a/public/static/admin/default/css/goods.css +++ b/public/static/admin/default/css/goods.css @@ -1,16 +1,3 @@ -/** - * 列表 - */ -.goods .goods-images { - width:60px; - height:60px; - float:left; - margin-right:5px; -} -.goods { - overflow: hidden; -} - /** * 详情 */ diff --git a/public/static/common/js/common.js b/public/static/common/js/common.js index 48fa37e2caf1ccca423683a022cc5eacdf4dd448..e15f27c1b409b27b49adbe308496664fd5de07c2 100755 --- a/public/static/common/js/common.js +++ b/public/static/common/js/common.js @@ -847,25 +847,32 @@ function FomatFloat(value, pos) */ function DataDelete(e) { + // 参数获取 var id = e.attr('data-id'); + var key = e.attr('data-key') || 'id'; var url = e.attr('data-url'); var view = e.attr('data-view') || 'delete'; var value = e.attr('data-value') || null; var ext_delete_tag = e.attr('data-ext-delete-tag') || null; + // 参数校验 if((id || null) == null || (url || null) == null) { Prompt('参数配置有误'); return false; } + // 请求数据 + var data = {}; + data[key] = id; + // 请求删除数据 $.ajax({ url:url, type:'POST', dataType:"json", timeout:e.attr('data-timeout') || 30000, - data:{"id":id}, + data:data, success:function(result) { if(result.code == 0) @@ -973,19 +980,25 @@ function ConfirmDataDelete(e) */ function AjaxRequest(e) { + // 参数 var id = e.attr('data-id'); + var key = e.attr('data-key') || 'id'; var field = e.attr('data-field') || ''; var value = e.attr('data-value') || ''; var url = e.attr('data-url'); var view = e.attr('data-view') || ''; + // 请求数据 + var data = {"value": value, "field": field}; + data[key] = id; + // ajax $.ajax({ url:url, type:'POST', dataType:"json", timeout:e.attr('data-timeout') || 30000, - data:{"id":id, "value": value, "field": field}, + data:data, success:function(result) { if(result.code == 0) @@ -1652,6 +1665,103 @@ $(function() $(this).attr('data-value', value == 1 ? 0 : 1); }); + // 表格公共删除操作 + $('.form-table-operate-top-delete-submit').on('click', function() + { + // 请求 url + var url = $(this).data('url') || null; + if(url == null) + { + Prompt('url参数有误'); + return false; + } + + // form name 名称 + var form = $(this).data('form') || null; + if(form == null) + { + Prompt('form参数有误'); + return false; + } + + // 获取复选框选中的值 + var values = []; + $(document).find('input[name="'+form+'"]').each(function(key, tmp) + { + if($(this).is(':checked')) + { + values.push(tmp.value); + } + }); + + // 获取单选框的值 + if(values.length <= 0) + { + var val = $('input[name="'+form+'"]:checked').val(); + if(val != undefined) + { + values.push(val); + } + } + + // 是否有选择的数据 + if(values.length <= 0) + { + Prompt('请先选中数据'); + return false; + } + + // 提交字段名称|超时时间|标题|描述 + var key = $(this).data('key') || form; + var timeout = $(this).data('timeout') || 30000; + var title = $(this).data('confirm-title') || '温馨提示'; + var msg = $(this).data('confirm-msg') || '删除后不可恢复、确认操作吗?'; + + // 再次确认 + AMUI.dialog.confirm({ + title: title, + content: msg, + onConfirm: function(result) + { + // 数组转对象 + var data = {}; + data[key] = {}; + for(var i in values) + { + data[key][i] = values[i]; + } + + // ajax请求操作 + $.ajax({ + url: url, + type: 'POST', + dataType: "json", + timeout: timeout, + data: data, + success: function(result) + { + if(result.code == 0) + { + // 成功则删除数据列表 + Prompt(result.msg, 'success'); + for(var i in values) + { + $('#data-list-'+values[i]).remove(); + } + } else { + Prompt(result.msg); + } + }, + error: function(xhr, type) + { + Prompt('网络异常出错'); + } + }); + }, + onCancel: function(){} + }); + }); + /** * 页面加载 loading */