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', '
![\"1547450880620837.png\"/](\"/static/upload/images/goods/2019/01/14/1547450880620837.png\")
![\"1547450880750687.png\"/](\"/static/upload/images/goods/2019/01/14/1547450880750687.png\")
![\"1547450880917418.png\"/](\"/static/upload/images/goods/2019/01/14/1547450880917418.png\")
', '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', '
![\"1547451595700972.jpg\"/](\"/static/upload/images/goods/2019/01/14/1547451595700972.jpg\")
![\"1547451595528800.jpg\"/](\"/static/upload/images/goods/2019/01/14/1547451595528800.jpg\")
![\"1547451595616298.jpg\"/](\"/static/upload/images/goods/2019/01/14/1547451595616298.jpg\")
', '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', '
![\"1547451947383902.jpg\"/](\"/static/upload/images/goods/2019/01/14/1547451947383902.jpg\")
![\"1547451947686990.jpg\"/](\"/static/upload/images/goods/2019/01/14/1547451947686990.jpg\")
![\"1547451947676180.jpg\"/](\"/static/upload/images/goods/2019/01/14/1547451947676180.jpg\")
![\"1547451947791154.jpg\"/](\"/static/upload/images/goods/2019/01/14/1547451947791154.jpg\")
', '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', '
![\"1547452505568604.jpg\"/](\"/static/upload/images/goods/2019/01/14/1547452505568604.jpg\")
![\"1547452505349986.jpg\"/](\"/static/upload/images/goods/2019/01/14/1547452505349986.jpg\")
![\"1547452505184884.jpg\"/](\"/static/upload/images/goods/2019/01/14/1547452505184884.jpg\")
', '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', '
![\"1547452760417982.jpg\"/](\"/static/upload/images/goods/2019/01/14/1547452760417982.jpg\")
![\"1547452760659259.jpg\"/](\"/static/upload/images/goods/2019/01/14/1547452760659259.jpg\")
![\"1547452760984656.jpg\"/](\"/static/upload/images/goods/2019/01/14/1547452760984656.jpg\")
', '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寸)
![\"1547453042405182.jpg\"/](\"/static/upload/images/goods/2019/01/14/1547453042405182.jpg\")
![\"1547453042614480.jpg\"/](\"/static/upload/images/goods/2019/01/14/1547453042614480.jpg\")
![\"1547453042816509.jpg\"/](\"/static/upload/images/goods/2019/01/14/1547453042816509.jpg\")
', '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', '
![\"1547453910353340.jpg\"/](\"/static/upload/images/goods/2019/01/14/1547453910353340.jpg\")
![\"1547453910505349.jpg\"/](\"/static/upload/images/goods/2019/01/14/1547453910505349.jpg\")
![\"1547453910394886.jpg\"/](\"/static/upload/images/goods/2019/01/14/1547453910394886.jpg\")
', '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', '
![\"1547454192301566.jpg\"/](\"/static/upload/images/goods/2019/01/14/1547454192301566.jpg\")
![\"1547454192448116.jpg\"/](\"/static/upload/images/goods/2019/01/14/1547454192448116.jpg\")
![\"1547454192474638.jpg\"/](\"/static/upload/images/goods/2019/01/14/1547454192474638.jpg\")
', '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', '
![\"1547454712270511.jpg\"/](\"/static/upload/images/goods/2019/01/14/1547454712270511.jpg\")
![\"1547454713556301.jpg\"/](\"/static/upload/images/goods/2019/01/14/1547454713556301.jpg\")
![\"1547454713800333.jpg\"/](\"/static/upload/images/goods/2019/01/14/1547454713800333.jpg\")
![\"1547454713456602.jpg\"/](\"/static/upload/images/goods/2019/01/14/1547454713456602.jpg\")
', '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号~下摆蕾丝拼接不会很平整的哦~
蕾丝花是手工修剪出来的,每件都有不同和不规则的哦,有小线头和节点是正常现象哦~请亲们谅解哦~
![\"1547455266234658.jpg\"/](\"/static/upload/images/goods/2019/01/14/1547455266234658.jpg\")
![\"1547455266527628.jpg\"/](\"/static/upload/images/goods/2019/01/14/1547455266527628.jpg\")
', '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号哦~
大圆领,每个人的身材曲线不同,领口不会很平的哦,请谅解~
肩膀那有暗扣哦,可以很好的隐藏了内衣的肩带哦~袖子那略硬哦~
![](\"/static/upload/images/goods/2019/01/14/1547455601898622.jpg\"/)
![](\"/static/upload/images/goods/2019/01/14/1547455601528614.jpg\"/)
![](\"/static/upload/images/goods/2019/01/14/1547455601314107.jpg\"/)
![](\"/static/upload/images/goods/2019/01/14/1547455601168384.jpg\"/)
', '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', '
11 | 22 | 33 | 44 | 55 | 66 |
q | w | e | r | t | y |
a | s | d | f | g | h |
z | x | c | v | b | n |
![\"1547456214155362.jpg\" \"d-1.jpg\"/](\"/static/upload/images/goods/2019/01/14/1547456214155362.jpg\")
![](\"/static/upload/images/goods/2019/01/14/1547455907486857.jpg\"/)
![](\"/static/upload/images/goods/2019/01/14/1547455907256518.jpg\"/)
![\"1547456228913731.jpg\" \"d-2.jpg\"/](\"/static/upload/images/goods/2019/01/14/1547456228913731.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', '
![\"1547450880620837.png\"/](\"/static/upload/images/goods/2019/01/14/1547450880620837.png\")
![\"1547450880750687.png\"/](\"/static/upload/images/goods/2019/01/14/1547450880750687.png\")
![\"1547450880917418.png\"/](\"/static/upload/images/goods/2019/01/14/1547450880917418.png\")
', '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', '
![\"1547451595700972.jpg\"/](\"/static/upload/images/goods/2019/01/14/1547451595700972.jpg\")
![\"1547451595528800.jpg\"/](\"/static/upload/images/goods/2019/01/14/1547451595528800.jpg\")
![\"1547451595616298.jpg\"/](\"/static/upload/images/goods/2019/01/14/1547451595616298.jpg\")
', '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', '
![\"1547451947383902.jpg\"/](\"/static/upload/images/goods/2019/01/14/1547451947383902.jpg\")
![\"1547451947686990.jpg\"/](\"/static/upload/images/goods/2019/01/14/1547451947686990.jpg\")
![\"1547451947676180.jpg\"/](\"/static/upload/images/goods/2019/01/14/1547451947676180.jpg\")
![\"1547451947791154.jpg\"/](\"/static/upload/images/goods/2019/01/14/1547451947791154.jpg\")
', '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', '
![\"1547452505568604.jpg\"/](\"/static/upload/images/goods/2019/01/14/1547452505568604.jpg\")
![\"1547452505349986.jpg\"/](\"/static/upload/images/goods/2019/01/14/1547452505349986.jpg\")
![\"1547452505184884.jpg\"/](\"/static/upload/images/goods/2019/01/14/1547452505184884.jpg\")
', '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', '
![\"1547452760417982.jpg\"/](\"/static/upload/images/goods/2019/01/14/1547452760417982.jpg\")
![\"1547452760659259.jpg\"/](\"/static/upload/images/goods/2019/01/14/1547452760659259.jpg\")
![\"1547452760984656.jpg\"/](\"/static/upload/images/goods/2019/01/14/1547452760984656.jpg\")
', '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寸)
![\"1547453042405182.jpg\"/](\"/static/upload/images/goods/2019/01/14/1547453042405182.jpg\")
![\"1547453042614480.jpg\"/](\"/static/upload/images/goods/2019/01/14/1547453042614480.jpg\")
![\"1547453042816509.jpg\"/](\"/static/upload/images/goods/2019/01/14/1547453042816509.jpg\")
', '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', '
![\"1547453910353340.jpg\"/](\"/static/upload/images/goods/2019/01/14/1547453910353340.jpg\")
![\"1547453910505349.jpg\"/](\"/static/upload/images/goods/2019/01/14/1547453910505349.jpg\")
![\"1547453910394886.jpg\"/](\"/static/upload/images/goods/2019/01/14/1547453910394886.jpg\")
', '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', '
![\"1547454192301566.jpg\"/](\"/static/upload/images/goods/2019/01/14/1547454192301566.jpg\")
![\"1547454192448116.jpg\"/](\"/static/upload/images/goods/2019/01/14/1547454192448116.jpg\")
![\"1547454192474638.jpg\"/](\"/static/upload/images/goods/2019/01/14/1547454192474638.jpg\")
', '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', '
![\"1547454712270511.jpg\"/](\"/static/upload/images/goods/2019/01/14/1547454712270511.jpg\")
![\"1547454713556301.jpg\"/](\"/static/upload/images/goods/2019/01/14/1547454713556301.jpg\")
![\"1547454713800333.jpg\"/](\"/static/upload/images/goods/2019/01/14/1547454713800333.jpg\")
![\"1547454713456602.jpg\"/](\"/static/upload/images/goods/2019/01/14/1547454713456602.jpg\")
', '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号~下摆蕾丝拼接不会很平整的哦~
蕾丝花是手工修剪出来的,每件都有不同和不规则的哦,有小线头和节点是正常现象哦~请亲们谅解哦~
![\"1547455266234658.jpg\"/](\"/static/upload/images/goods/2019/01/14/1547455266234658.jpg\")
![\"1547455266527628.jpg\"/](\"/static/upload/images/goods/2019/01/14/1547455266527628.jpg\")
', '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号哦~
大圆领,每个人的身材曲线不同,领口不会很平的哦,请谅解~
肩膀那有暗扣哦,可以很好的隐藏了内衣的肩带哦~袖子那略硬哦~
![](\"/static/upload/images/goods/2019/01/14/1547455601898622.jpg\"/)
![](\"/static/upload/images/goods/2019/01/14/1547455601528614.jpg\"/)
![](\"/static/upload/images/goods/2019/01/14/1547455601314107.jpg\"/)
![](\"/static/upload/images/goods/2019/01/14/1547455601168384.jpg\"/)
', '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', '
11 | 22 | 33 | 44 | 55 | 66 |
q | w | e | r | t | y |
a | s | d | f | g | h |
z | x | c | v | b | n |
![\"1547456214155362.jpg\" \"d-1.jpg\"/](\"/static/upload/images/goods/2019/01/14/1547456214155362.jpg\")
![](\"/static/upload/images/goods/2019/01/14/1547455907486857.jpg\"/)
![](\"/static/upload/images/goods/2019/01/14/1547455907256518.jpg\"/)
![\"1547456228913731.jpg\" \"d-2.jpg\"/](\"/static/upload/images/goods/2019/01/14/1547456228913731.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
*/