feat/task1-c-wallet
devil_gong 2018-09-06 18:22:15 +08:00
parent ce93be07d8
commit 10c167e982
122 changed files with 567 additions and 124 deletions

View File

@ -0,0 +1,202 @@
<?php
namespace Admin\Controller;
/**
* 筛选价格管理
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2016-12-01T21:51:08+0800
*/
class ScreeningPriceController extends CommonController
{
/**
* [_initialize 前置操作-继承公共前置方法]
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2016-12-03T12:39:08+0800
*/
public function _initialize()
{
// 调用父类前置方法
parent::_initialize();
// 登录校验
$this->Is_Login();
// 权限校验
$this->Is_Power();
}
/**
* [Index 筛选价格列表]
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2016-12-06T21:31:53+0800
*/
public function Index()
{
$this->assign('common_is_enable_list', L('common_is_enable_list'));
$this->display('Index');
}
/**
* [GetNodeSon 获取节点子列表]
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2016-12-25T15:19:45+0800
*/
public function GetNodeSon()
{
// 是否ajax请求
if(!IS_AJAX)
{
$this->error(L('common_unauthorized_access'));
}
// 获取数据
$field = array('id', 'name', 'sort', 'is_enable', 'min_price', 'max_price');
$data = M('ScreeningPrice')->field($field)->where(array('pid'=>intval(I('id', 0))))->select();
if(!empty($data))
{
foreach($data as $k=>$v)
{
if(!empty($v['min_price']) && !empty($v['max_price']))
{
$alias = $v['min_price'].'-'.$v['max_price'];
}
if(empty($v['min_price']) && !empty($v['max_price']))
{
$alias = $v['max_price'].'以下';
}
if(!empty($v['min_price']) && empty($v['max_price']))
{
$alias = $v['min_price'].'以上';
}
$data[$k]['name_alias'] = $v['name'].' '.$alias;
$data[$k]['is_son'] = $this->IsExistSon($v['id']);
$data[$k]['ajax_url'] = U('Admin/ScreeningPrice/GetNodeSon', array('id'=>$v['id']));
$data[$k]['delete_url'] = U('Admin/ScreeningPrice/Delete');
$data[$k]['json'] = json_encode($v);
}
}
$msg = empty($data) ? L('common_not_data_tips') : L('common_operation_success');
$this->ajaxReturn($msg, 0, $data);
}
/**
* [IsExistSon 节点是否存在子数据]
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2016-12-25T15:22:47+0800
* @param [int] $id [节点id]
* @return [string] [有数据ok, 则no]
*/
private function IsExistSon($id)
{
if(!empty($id))
{
return (M('ScreeningPrice')->where(array('pid'=>$id))->count() > 0) ? 'ok' : 'no';
}
return 'no';
}
/**
* [Save 筛选价格保存]
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2016-12-25T22:36:12+0800
*/
public function Save()
{
// 是否ajax请求
if(!IS_AJAX)
{
$this->error(L('common_unauthorized_access'));
}
// id为空则表示是新增
$m = D('ScreeningPrice');
// 公共额外数据处理
$m->sort = intval(I('sort'));
// 添加
if(empty($_POST['id']))
{
if($m->create($_POST, 1))
{
// 额外数据处理
$m->add_time = time();
$m->min_price = intval(I('min_price'));
$m->max_price = intval(I('max_price'));
$m->name = I('name');
// 写入数据库
if($m->add())
{
$this->ajaxReturn(L('common_operation_add_success'));
} else {
$this->ajaxReturn(L('common_operation_add_error'), -100);
}
}
} else {
// 编辑
if($m->create($_POST, 2))
{
// 额外数据处理
$m->name = I('name');
$m->min_price = intval(I('min_price'));
$m->max_price = intval(I('max_price'));
$m->upd_time = time();
// 移除 id
unset($m->id);
// 更新数据库
if($m->where(array('id'=>I('id')))->save())
{
$this->ajaxReturn(L('common_operation_edit_success'));
} else {
$this->ajaxReturn(L('common_operation_edit_error'), -100);
}
}
}
$this->ajaxReturn($m->getError(), -1);
}
/**
* [Delete 筛选价格删除]
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2016-12-25T22:36:12+0800
*/
public function Delete()
{
if(!IS_AJAX)
{
$this->error(L('common_unauthorized_access'));
}
$m = D('ScreeningPrice');
if($m->create($_POST, 5))
{
if($m->delete(I('id')))
{
$this->ajaxReturn(L('common_operation_delete_success'));
} else {
$this->ajaxReturn(L('common_operation_delete_error'), -100);
}
} else {
$this->ajaxReturn($m->getError(), -1);
}
}
}
?>

View File

@ -1,7 +1,7 @@
<?php
/**
* 模块语言包-品牌分类分类
* 模块语言包-品牌分类
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
@ -9,7 +9,7 @@
*/
return array(
// 添加/编辑
'brand_category_add_name' => '品牌分类分类添加',
'brand_category_edit_name' => '品牌分类分类编辑',
'brand_category_add_name' => '品牌分类添加',
'brand_category_edit_name' => '品牌分类编辑',
);
?>

View File

@ -0,0 +1,23 @@
<?php
/**
* 模块语言包-筛选价格
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2016-12-01T21:51:08+0800
*/
return array(
// 添加/编辑
'screening_price_add_name' => '筛选价格添加',
'screening_price_edit_name' => '筛选价格编辑',
'screening_price_min_price_text' => '最小价格',
'screening_price_min_price_format' => '最小价格有误',
'screening_price_max_price_text' => '最大价格',
'screening_price_max_price_format' => '最大价格有误',
'screening_price_desc' => '最小价格0 - 最大价格100 则是小于100<br /> 最小价格1000 - 最大价格0 则是大于1000<br /> 最小价格100 - 最大价格500 则是大于等于100并且小于500<br />',
);
?>

View File

@ -0,0 +1,38 @@
<?php
namespace Admin\Model;
use Think\Model;
/**
* 筛选价格模型
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2016-12-01T21:51:08+0800
*/
class ScreeningPriceModel extends CommonModel
{
// 数据自动校验
protected $_validate = array(
// 添加,编辑
array('name', '2,16', '{%common_name_format}', 1, 'length', 3),
array('is_enable', array(0,1), '{%common_enable_tips}', 1, 'in', 3),
array('sort', 'CheckSort', '{%common_sort_error}', 1, 'function', 3),
// 删除校验是否存在子级
array('id', 'IsExistSon', '{%common_is_exist_son_error}', 1, 'callback', 5),
);
/**
* [IsExistSon 校验节点下是否存在子级数据]
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2016-12-10T14:09:40+0800
*/
public function IsExistSon()
{
return ($this->db(0)->where(array('pid'=>I('id')))->count() == 0);
}
}
?>

View File

@ -0,0 +1,68 @@
<include file="Public/Header" />
<!-- right content start -->
<div class="content-right">
<div class="content">
<!-- operation start -->
<div class="am-g">
<button class="am-btn am-btn-secondary am-radius am-btn-xs am-icon-plus tree-submit-add" data-am-modal="{target: '#data-save-win'}"> {{:L('common_operation_add')}}</button>
</div>
<!-- operation end -->
<!-- save win start -->
<div class="am-popup am-radius" id="data-save-win">
<div class="am-popup-inner">
<div class="am-popup-hd">
<h4 class="am-popup-title" data-add-title="{{:L('screening_price_add_name')}}" data-edit-title="{{:L('screening_price_edit_name')}}">{{:L('screening_price_add_name')}}</h4>
<span data-am-modal-close class="am-close">&times;</span>
</div>
<div class="am-popup-bd">
<div class="am-alert am-alert-secondary" data-am-alert>{{:L('screening_price_desc')}}</div>
<!-- form start -->
<form class="am-form form-validation admin-save" action="{{:U('Admin/ScreeningPrice/Save')}}" method="POST" request-type="ajax-reload" request-value="">
<div class="am-form-group">
<label>{{:L('common_name_text')}}</label>
<input type="text" placeholder="{{:L('common_name_text')}}" name="name" minlength="2" maxlength="16" data-validation-message="{{:L('common_name_format')}}" class="am-radius" required />
</div>
<div class="am-form-group">
<label>{{:L('screening_price_min_price_text')}}</label>
<input type="number" placeholder="{{:L('screening_price_min_price_text')}}" name="min_price"" maxlength="10" data-validation-message="{{:L('screening_price_min_price_format')}}" class="am-radius" value="0" required />
</div>
<div class="am-form-group">
<label>{{:L('screening_price_max_price_text')}}</label>
<input type="number" placeholder="{{:L('screening_price_max_price_text')}}" name="max_price" maxlength="10" data-validation-message="{{:L('screening_price_max_price_format')}}" class="am-radius" value="0" required />
</div>
<div class="am-form-group">
<label>{{:L('common_view_sort_title')}}</label>
<input type="number" placeholder="{{:L('common_view_sort_title')}}" name="sort" min="0" max="255" data-validation-message="{{:L('common_sort_error')}}" class="am-radius" value="0" required />
</div>
<include file="Lib/Enable" />
<div class="am-form-group">
<input type="hidden" name="id" />
<button type="submit" class="am-btn am-btn-primary am-radius btn-loading-example am-btn-sm w100" data-am-loading="{loadingText:'{{:L('common_form_loading_tips')}}'}">{{:L('common_operation_save')}}</button>
</div>
</form>
<!-- form end -->
</div>
</div>
</div>
<!-- save win end -->
<!-- list start -->
<div id="tree" class="m-t-15">
<div class="m-t-30 t-c">
<img src="__PUBLIC__/Common/Images/loading.gif" />
<p>{{:L('common_form_loading_tips')}}</p>
</div>
</div>
<!-- list end -->
</div>
</div>
<!-- right content end -->
<!-- footer start -->
<include file="Public/Footer" />
<!-- footer end -->
<script>
Tree(0, "{{:U('Admin/ScreeningPrice/GetNodeSon')}}", 0);
</script>

View File

@ -3,6 +3,7 @@
namespace Home\Controller;
use Service\GoodsService;
use Service\BrandService;
/**
* 搜索
@ -35,8 +36,34 @@ class SearchController extends CommonController
*/
public function Index()
{
$id = I('id');
// 分类id
$category_id = intval(I('category_id', 0));
// 搜索关键字
$keywords = trim(I('keywords'));
// 品牌列表
$this->assign('brand_list', BrandService::CategoryBrandList(['category_id'=>$category_id]));
// 根据分类id获取同级列表
$category = GoodsService::GoodsCategoryRow(['id'=>$category_id]);
$pid = empty($category['pid']) ? 0 : $category['pid'];
$this->assign('category_list', GoodsService::GoodsCategoryList(['pid'=>$pid]));
// 价格区间
$price_list = [
['id'=>1, 'name'=>'100以下'],
['id'=>2, 'name'=>'100-300'],
['id'=>3, 'name'=>'300-600'],
['id'=>4, 'name'=>'600-1000'],
['id'=>5, 'name'=>'1000-1500'],
['id'=>6, 'name'=>'1500-2000'],
['id'=>7, 'name'=>'2000-3000'],
['id'=>8, 'name'=>'3000-4000'],
['id'=>9, 'name'=>'5000-8000'],
['id'=>10, 'name'=>'10000y以上'],
];
$this->assign('price_list', $price_list);
$this->display('Index');
}

View File

@ -1,13 +1,23 @@
<include file="Public/Header" />
<!-- header nav start -->
<if condition="!isset($is_header) or $is_header eq 1">
<include file="Public/HeaderNav" />
</if>
<notempty name="is_header">
<!-- header top nav -->
<include file="Public/HeaderTopNav" />
<!-- search -->
<include file="Public/NavSearch" />
<!-- header nav -->
<include file="Public/HeaderNav" />
<!-- goods category -->
<include file="Public/GoodsCategory" />
</notempty>
<!-- header nav end -->
<!-- content start -->
<div class="am-g custom-content <if condition="!isset($data['is_full_screen']) or $data['is_full_screen'] eq 0">p-20</if>" <if condition="!empty($max_width_style)">style="{{$max_width_style}}"</if>>{{$data.content}}</div>
<div class="am-g custom-content" <if condition="!isset($data['is_full_screen']) or $data['is_full_screen'] eq 0"><if condition="!empty($max_width_style)">style="{{$max_width_style}}"</if></if>>{{$data.content}}</div>
<!-- content end -->
<!-- footer start -->

View File

@ -13,7 +13,7 @@
<div class="category-info">
<h3 class="category-name b-category-name">
<i><img src="{{$v.icon}}"></i>
<a class="ml-22" title="{{$v.name}}">{{$v.name}}</a>
<a href="{{:__MY_URL__}}search.php?category_id={{$v.id}}" class="ml-22" title="{{$v.name}}">{{$v.name}}</a>
</h3>
<em>&gt;</em>
</div>
@ -26,14 +26,14 @@
<foreach name="v.items" item="vs">
<dl class="dl-sort">
<dt>
<a title="{{$vs.name}}" href="#">
<a href="{{:__MY_URL__}}search.php?category_id={{$vs.id}}" title="{{$vs.name}}">
<span title="{{$vs.name}}">{{$vs.name}}</span>
</a>
</dt>
<if condition="!empty($vs['items'])">
<foreach name="vs.items" item="vss">
<dd>
<a title="{{$vss.name}}" href="#">
<a href="{{:__MY_URL__}}search.php?category_id={{$vss.id}}" title="{{$vss.name}}">
<span>{{$vss.name}}</span>
</a>
</dd>

View File

@ -1,8 +1,16 @@
<include file="Public/Header" />
<!-- header nav start -->
<!-- header top nav -->
<include file="Public/HeaderTopNav" />
<!-- search -->
<include file="Public/NavSearch" />
<!-- header nav -->
<include file="Public/HeaderNav" />
<!-- header nav end -->
<!-- goods category -->
<include file="Public/GoodsCategory" />
<!-- conntent start -->
<div class="am-g my-content" <if condition="!empty($max_width_style)">style="{{$max_width_style}}"</if>>

View File

@ -27,53 +27,59 @@
</div>
<ul class="select">
<p class="title-tips">
<span class="fl">松子</span>
<span class="total fl">搜索到<strong class="num">997</strong>件相关商品</span>
<span>分类</span>
<strong>复古复古</strong>
<span>筛选结果</span>
</p>
<li class="select-result">
<dl>
<dt>已选</dt>
<dd class="select-no"></dd>
<p class="eliminateCriteria">清除</p>
<p class="screening-remove-submit">清除</p>
</dl>
</li>
<li class="select-list">
<dl id="select1">
<dl id="screening-brand-dl">
<dt class="am-badge am-round">品牌</dt>
<div class="dd-conent">
<dd class="select-all selected"><a href="#">全部</a></dd>
<dd><a href="#">百草味</a></dd>
<dd><a href="#">良品铺子</a></dd>
<dd><a href="#">新农哥</a></dd>
<dd><a href="#">楼兰蜜语</a></dd>
<dd><a href="#">口水娃</a></dd>
<dd><a href="#">考拉兄弟</a></dd>
<div class="dd-conent" data-selected-tag="screening-brand">
<dd class="select-all selected"><a href="javascript:;">不限</a></dd>
<if condition="!empty($brand_list)">
<foreach name="brand_list" item="brand">
<dd><a href="javascript:;" data-value="{{$brand.id}}">{{$brand.name}}</a></dd>
</foreach>
<else />
<span class="not-tips">没有相关品牌</span>
</if>
</div>
</dl>
</li>
<li class="select-list">
<dl id="select2">
<dt class="am-badge am-round">种类</dt>
<div class="dd-conent">
<dd class="select-all selected"><a href="#">全部</a></dd>
<dd><a href="#">东北松子</a></dd>
<dd><a href="#">巴西松子</a></dd>
<dd><a href="#">夏威夷果</a></dd>
<dd><a href="#">松子</a></dd>
<dl id="screening-category-dl">
<dt class="am-badge am-round">分类</dt>
<div class="dd-conent" data-selected-tag="screening-category">
<dd class="select-all selected"><a href="javascript:;">不限</a></dd>
<if condition="!empty($category_list)">
<foreach name="category_list" item="category">
<dd><a href="javascript:;">{{$category.name}}</a></dd>
</foreach>
<else />
<span class="not-tips">没有相关分类</span>
</if>
</div>
</dl>
</li>
<li class="select-list">
<dl id="select3">
<dt class="am-badge am-round">选购热点</dt>
<div class="dd-conent">
<dd class="select-all selected"><a href="#">全部</a></dd>
<dd><a href="#">手剥松子</a></dd>
<dd><a href="#">薄壳松子</a></dd>
<dd><a href="#">进口零食</a></dd>
<dd><a href="#">有机零食</a></dd>
<dl id="screening-price-dl">
<dt class="am-badge am-round">价格</dt>
<div class="dd-conent" data-selected-tag="screening-price">
<dd class="select-all selected"><a href="javascript:;">不限</a></dd>
<if condition="!empty($price_list)">
<foreach name="price_list" item="price">
<dd><a href="javascript:;">{{$price.name}}</a></dd>
</foreach>
<else />
<span class="not-tips">没有相关价格</span>
</if>
</div>
</dl>
</li>

View File

View File

View File

View File

@ -1,3 +1,3 @@
<?php
//000000000000a:124:{i:41;s:12:"config_index";i:42;s:11:"config_save";i:81;s:10:"site_index";i:103;s:10:"site_index";i:105;s:9:"site_save";i:104;s:9:"sms_index";i:107;s:8:"sms_save";i:219;s:11:"email_index";i:220;s:10:"email_save";i:221;s:15:"email_emailtest";i:199;s:9:"seo_index";i:200;s:8:"seo_save";i:1;s:11:"power_index";i:22;s:11:"admin_index";i:19;s:14:"admin_saveinfo";i:20;s:10:"admin_save";i:21;s:12:"admin_delete";i:4;s:10:"power_role";i:17;s:18:"power_rolesaveinfo";i:18;s:14:"power_rolesave";i:23;s:16:"power_roledelete";i:13;s:11:"power_index";i:15;s:15:"power_powersave";i:16;s:17:"power_powerdelete";i:126;s:10:"user_index";i:127;s:10:"user_index";i:128;s:13:"user_saveinfo";i:129;s:9:"user_save";i:130;s:11:"user_delete";i:146;s:16:"user_excelexport";i:38;s:11:"goods_index";i:39;s:11:"goods_index";i:57;s:14:"goods_saveinfo";i:58;s:10:"goods_save";i:59;s:12:"goods_delete";i:181;s:19:"goods_statusshelves";i:218;s:27:"goods_statushomerecommended";i:201;s:19:"goodscategory_index";i:202;s:18:"goodscategory_save";i:203;s:20:"goodscategory_delete";i:177;s:11:"order_index";i:178;s:11:"order_index";i:179;s:12:"order_delete";i:180;s:12:"order_cancel";i:213;s:12:"answer_index";i:214;s:12:"answer_index";i:215;s:11:"answer_save";i:216;s:13:"answer_delete";i:217;s:19:"answer_statusupdate";i:222;s:16:"navigation_index";i:223;s:16:"navigation_index";i:226;s:15:"navigation_save";i:227;s:17:"navigation_delete";i:228;s:23:"navigation_statusupdate";i:234;s:16:"customview_index";i:235;s:19:"customview_saveinfo";i:236;s:15:"customview_save";i:237;s:17:"customview_delete";i:238;s:23:"customview_statusupdate";i:239;s:10:"link_index";i:240;s:13:"link_saveinfo";i:241;s:9:"link_save";i:242;s:11:"link_delete";i:243;s:17:"link_statusupdate";i:244;s:11:"theme_index";i:245;s:10:"theme_save";i:246;s:12:"theme_upload";i:247;s:12:"theme_delete";i:252;s:11:"brand_index";i:249;s:11:"brand_index";i:256;s:14:"brand_saveinfo";i:250;s:10:"brand_save";i:257;s:17:"brand_stateupdate";i:251;s:12:"brand_delete";i:253;s:19:"brandcategory_index";i:254;s:18:"brandcategory_save";i:255;s:20:"brandcategory_delete";i:204;s:13:"article_index";i:205;s:13:"article_index";i:206;s:16:"article_saveinfo";i:207;s:12:"article_save";i:208;s:14:"article_delete";i:209;s:20:"article_statusupdate";i:248;s:29:"article_statushomerecommended";i:210;s:21:"articlecategory_index";i:211;s:20:"articlecategory_save";i:212;s:22:"articlecategory_delete";i:162;s:15:"marketing_index";i:163;s:12:"coupon_index";i:164;s:18:"coupon_stateupdate";i:165;s:15:"coupon_saveinfo";i:166;s:11:"coupon_save";i:167;s:11:"coupon_user";i:168;s:13:"coupon_delete";i:169;s:15:"coupon_sendinfo";i:170;s:11:"coupon_send";i:171;s:16:"coupon_userquery";i:182;s:10:"data_index";i:183;s:13:"message_index";i:184;s:14:"message_delete";i:185;s:12:"paylog_index";i:186;s:21:"userintegrallog_index";i:187;s:15:"complaint_index";i:188;s:14:"complaint_save";i:189;s:16:"complaint_delete";i:152;s:15:"resources_index";i:153;s:12:"region_index";i:154;s:11:"region_save";i:155;s:13:"region_delete";i:156;s:13:"express_index";i:157;s:12:"express_save";i:158;s:14:"express_delete";i:172;s:11:"slide_index";i:173;s:14:"slide_saveinfo";i:174;s:10:"slide_save";i:175;s:17:"slide_stateupdate";i:176;s:12:"slide_delete";i:193;s:15:"agreement_index";i:194;s:14:"agreement_save";i:118;s:10:"tool_index";i:119;s:11:"cache_index";i:120;s:16:"cache_siteupdate";i:121;s:20:"cache_templateupdate";i:122;s:18:"cache_moduleupdate";}
//000000000000a:125:{i:41;s:12:"config_index";i:42;s:11:"config_save";i:81;s:10:"site_index";i:103;s:10:"site_index";i:105;s:9:"site_save";i:104;s:9:"sms_index";i:107;s:8:"sms_save";i:219;s:11:"email_index";i:220;s:10:"email_save";i:221;s:15:"email_emailtest";i:199;s:9:"seo_index";i:200;s:8:"seo_save";i:1;s:11:"power_index";i:22;s:11:"admin_index";i:19;s:14:"admin_saveinfo";i:20;s:10:"admin_save";i:21;s:12:"admin_delete";i:4;s:10:"power_role";i:17;s:18:"power_rolesaveinfo";i:18;s:14:"power_rolesave";i:23;s:16:"power_roledelete";i:13;s:11:"power_index";i:15;s:15:"power_powersave";i:16;s:17:"power_powerdelete";i:126;s:10:"user_index";i:127;s:10:"user_index";i:128;s:13:"user_saveinfo";i:129;s:9:"user_save";i:130;s:11:"user_delete";i:146;s:16:"user_excelexport";i:38;s:11:"goods_index";i:39;s:11:"goods_index";i:57;s:14:"goods_saveinfo";i:58;s:10:"goods_save";i:59;s:12:"goods_delete";i:181;s:19:"goods_statusshelves";i:218;s:27:"goods_statushomerecommended";i:201;s:19:"goodscategory_index";i:202;s:18:"goodscategory_save";i:203;s:20:"goodscategory_delete";i:177;s:11:"order_index";i:178;s:11:"order_index";i:179;s:12:"order_delete";i:180;s:12:"order_cancel";i:213;s:12:"answer_index";i:214;s:12:"answer_index";i:215;s:11:"answer_save";i:216;s:13:"answer_delete";i:217;s:19:"answer_statusupdate";i:222;s:16:"navigation_index";i:223;s:16:"navigation_index";i:226;s:15:"navigation_save";i:227;s:17:"navigation_delete";i:228;s:23:"navigation_statusupdate";i:234;s:16:"customview_index";i:235;s:19:"customview_saveinfo";i:236;s:15:"customview_save";i:237;s:17:"customview_delete";i:238;s:23:"customview_statusupdate";i:239;s:10:"link_index";i:240;s:13:"link_saveinfo";i:241;s:9:"link_save";i:242;s:11:"link_delete";i:243;s:17:"link_statusupdate";i:244;s:11:"theme_index";i:245;s:10:"theme_save";i:246;s:12:"theme_upload";i:247;s:12:"theme_delete";i:252;s:11:"brand_index";i:249;s:11:"brand_index";i:256;s:14:"brand_saveinfo";i:250;s:10:"brand_save";i:257;s:17:"brand_stateupdate";i:251;s:12:"brand_delete";i:253;s:19:"brandcategory_index";i:254;s:18:"brandcategory_save";i:255;s:20:"brandcategory_delete";i:204;s:13:"article_index";i:205;s:13:"article_index";i:206;s:16:"article_saveinfo";i:207;s:12:"article_save";i:208;s:14:"article_delete";i:209;s:20:"article_statusupdate";i:248;s:29:"article_statushomerecommended";i:210;s:21:"articlecategory_index";i:211;s:20:"articlecategory_save";i:212;s:22:"articlecategory_delete";i:162;s:15:"marketing_index";i:163;s:12:"coupon_index";i:164;s:18:"coupon_stateupdate";i:165;s:15:"coupon_saveinfo";i:166;s:11:"coupon_save";i:167;s:11:"coupon_user";i:168;s:13:"coupon_delete";i:169;s:15:"coupon_sendinfo";i:170;s:11:"coupon_send";i:171;s:16:"coupon_userquery";i:182;s:10:"data_index";i:183;s:13:"message_index";i:184;s:14:"message_delete";i:185;s:12:"paylog_index";i:186;s:21:"userintegrallog_index";i:187;s:15:"complaint_index";i:188;s:14:"complaint_save";i:189;s:16:"complaint_delete";i:152;s:15:"resources_index";i:153;s:12:"region_index";i:154;s:11:"region_save";i:155;s:13:"region_delete";i:156;s:13:"express_index";i:157;s:12:"express_save";i:158;s:14:"express_delete";i:172;s:11:"slide_index";i:173;s:14:"slide_saveinfo";i:174;s:10:"slide_save";i:175;s:17:"slide_stateupdate";i:176;s:12:"slide_delete";i:193;s:20:"screeningprice_index";i:194;s:19:"screeningprice_save";i:258;s:21:"screeningprice_delete";i:118;s:10:"tool_index";i:119;s:11:"cache_index";i:120;s:16:"cache_siteupdate";i:121;s:20:"cache_templateupdate";i:122;s:18:"cache_moduleupdate";}
?>

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,51 @@
<?php
namespace Service;
use Service\GoodsService;
/**
* 品牌
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2016-12-01T21:51:08+0800
*/
class BrandService
{
/**
* 分类下品牌列表
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2018-08-29
* @desc description
* @param [array] $params [输入参数]
*/
public static function CategoryBrandList($params = [])
{
$brand_where = ['is_enable'=>1];
if(!empty($params['category_id']))
{
// 根据分类获取品牌id
$category_ids = GoodsService::GoodsCategoryItemsIds(['category_id'=>$params['category_id']]);
$where = ['g.is_delete_time'=>0, 'g.is_shelves'=>1, 'gci.id'=>['in', $category_ids]];
$brand_ids = M('Goods')->alias('g')->join(' INNER JOIN __GOODS_CATEGORY_JOIN__ AS gci ON g.id=gci.goods_id')->field('g.brand_id')->where($where)->group('g.brand_id')->getField('brand_id', true);
$brand_where['id'] = ['in', $brand_ids];
}
// 获取品牌列表
$brand = M('Brand')->where($brand_where)->field('id,name,logo,website_url')->select();
if(!empty($brand))
{
$images_host = C('IMAGE_HOST');
foreach($brand as &$v)
{
$v['logo'] = $images_host.$v['logo'];
$v['website_url'] = empty($v['website_url']) ? null : $v['website_url'];
}
}
return $brand;
}
}
?>

View File

@ -11,6 +11,26 @@ namespace Service;
*/
class GoodsService
{
/**
* 根据id获取一条商品分类
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2018-08-29
* @desc description
* @param [array] $params [输入参数]
*/
public static function GoodsCategoryRow($params = [])
{
if(empty($params['id']))
{
return null;
}
$field = empty($params['field']) ? 'id,pid,icon,name,vice_name,describe,bg_color,big_images,sort,is_home_recommended' : $params['field'];
$data = self::GoodsCategoryDataDealWith([M('GoodsCategory')->field($field)->where(['is_enable'=>1, 'id'=>intval($params['id'])])->find()]);
return empty($data[0]) ? null : $data[0];
}
/**
* 获取大分类
* @author Devil
@ -25,7 +45,6 @@ class GoodsService
$data = self::GoodsCategoryList(['pid'=>0]);
if(!empty($data))
{
$images_host = C('IMAGE_HOST');
foreach($data as &$v)
{
$v['items'] = self::GoodsCategoryList(['pid'=>$v['id']]);
@ -53,15 +72,38 @@ class GoodsService
public static function GoodsCategoryList($params = [])
{
$pid = isset($params['pid']) ? intval($params['pid']) : 0;
$images_host = C('IMAGE_HOST');
$field = 'id,pid,icon,name,vice_name,describe,bg_color,big_images,sort,is_home_recommended';
$data = M('GoodsCategory')->field($field)->where(['is_enable'=>1, 'pid'=>$pid])->order('sort asc')->select();
if(!empty($data))
return self::GoodsCategoryDataDealWith($data);
}
/**
* 商品分类数据处理
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2018-09-06
* @desc description
* @param [array] $data [商品分类数据 二维数组]
*/
private static function GoodsCategoryDataDealWith($data)
{
if(!empty($data) && is_array($data))
{
$images_host = C('IMAGE_HOST');
foreach($data as &$v)
{
$v['icon'] = empty($v['icon']) ? null : $images_host.$v['icon'];
$v['big_images'] = empty($v['big_images']) ? null : $images_host.$v['big_images'];
if(is_array($v))
{
if(isset($v['icon']))
{
$v['icon'] = empty($v['icon']) ? null : $images_host.$v['icon'];
}
if(isset($v['big_images']))
{
$v['big_images'] = empty($v['big_images']) ? null : $images_host.$v['big_images'];
}
}
}
}
return $data;
@ -84,8 +126,8 @@ class GoodsService
{
foreach($goods_category as &$v)
{
$category_all = self::GoodsCategoryItemsIds($v['id']);
$v['goods'] = self::GoodsList(['where'=>['gci.category_id'=>['in', $category_all], 'is_home_recommended'=>1], 'm'=>0, 'n'=>6]);
$category_ids = self::GoodsCategoryItemsIds(['category_id'=>$v['id']]);
$v['goods'] = self::GoodsList(['where'=>['gci.category_id'=>['in', $category_ids], 'is_home_recommended'=>1], 'm'=>0, 'n'=>6]);
}
}
return $goods_category;

View File

@ -453,6 +453,9 @@ background:url(../Images/ibar_sprites.png) no-repeat;background-position:0px -23
/* 价格颜色 */
.price strong {color: #E4393C; font-weight: 600; }
/* 公共错误提示页面 */
.tips-error { margin-top: 10%; }
/**
*
*/

View File

@ -20,6 +20,7 @@ img{ width:100%;}
.theme-popover {z-index: 1009;overflow:visible;background:#fff; width: 100%; }
.sort-nav a:hover, .sort-nav a:focus { color: #d2364c; }
.select .title-tips { font-size: 12px; color: #888; }
.select .title-tips strong { font-weight: 500; color: #fe90a0; }
/* select */
@ -43,7 +44,7 @@ li.select-result dt {left:-26px; top:0;font-weight:bold;width:50px;}
.select-no{color:#999}
.select .select-result a{padding-right:20px;background: url("../images/close.png") right 9px no-repeat}
.select .select-result a:hover{background-position:right -15px}
.eliminateCriteria{display:none;line-height:21px;margin-top:4px;width:35px;float:right;color:#F00;cursor:pointer;}
.screening-remove-submit{display:none;line-height:21px;margin-top:4px;width:35px;float:right;color:#F00;cursor:pointer;}
/*排序*/
@ -95,7 +96,7 @@ dl#select3 .dd-conent{ left:-200%; right:0px;}
.select-result dl dt{width:100px;}
.eliminateCriteria{width:80px;float:right;margin-right:20px;}
.screening-remove-submit{width:80px;float:right;margin-right:20px;}
.am-badge{font-size:14px ;padding:0px 0px;background: none;color: #000000;}
@ -152,6 +153,8 @@ dl#select3 .dd-conent{ left:-200%; right:0px;}
.data-list li:nth-child(2n+1) .i-pic.limit { margin-left: 0px; }
.search-pages { display: none; }
.search-pages-submit { display: block; }
.eliminateCriteria { margin-top: -28px; }
.screening-remove-submit { margin-top: -28px; }
.select .title-tips { padding: 0 5px; }
}
}
.not-tips { color: #666; font-size: 12px; text-align: center; display: block; }

View File

@ -1,83 +1,45 @@
$(function()
{
$("#select1 dd").click(function() {
// 筛选操作
$(document).on('click', '.select-list dl dd', function()
{
$(this).addClass("selected").siblings().removeClass("selected");
var selected_tag_name = $(this).parent('.dd-conent').attr('data-selected-tag');
console.log(selected_tag_name)
if ($(this).hasClass("select-all")) {
$("#selectA").remove();
$('#'+selected_tag_name).remove();
} else {
var copyThisA = $(this).clone();
if ($("#selectA").length > 0) {
$("#selectA a").html($(this).text());
if ($('#'+selected_tag_name).length > 0) {
$('#'+selected_tag_name).find("a").html($(this).text());
} else {
$(".select-result dl").append(copyThisA.attr("id", "selectA"));
var copy_html = $(this).clone();
$(".select-result dl").append(copy_html.attr("id", selected_tag_name));
}
}
});
$("#select2 dd").click(function() {
$(this).addClass("selected").siblings().removeClass("selected");
if ($(this).hasClass("select-all")) {
$("#selectB").remove();
$(document).on('click', '.select-result dl dd', function() {
$(this).remove();
$('#'+$(this).attr('id')+'-dl').find('.select-all').addClass('selected').siblings().removeClass('selected');
});
$(document).on('click', 'ul.select dd', function() {
if ($('.select-result dd').length > 1) {
$('.select-no').hide();
$('.screening-remove-submit').show();
$('.select-result').show();
} else {
var copyThisB = $(this).clone();
if ($("#selectB").length > 0) {
$("#selectB a").html($(this).text());
} else {
$(".select-result dl").append(copyThisB.attr("id", "selectB"));
}
$('.select-no').show();
$('.select-result').hide();
}
});
$("#select3 dd").click(function() {
$(this).addClass("selected").siblings().removeClass("selected");
if ($(this).hasClass("select-all")) {
$("#selectC").remove();
} else {
var copyThisC = $(this).clone();
if ($("#selectC").length > 0) {
$("#selectC a").html($(this).text());
} else {
$(".select-result dl").append(copyThisC.attr("id", "selectC"));
}
}
});
$(document).on("click", "#selectA", function() {
$(this).remove();
$("#select1 .select-all").addClass("selected").siblings().removeClass("selected");
});
$(document).on("click", "#selectB", function() {
$(this).remove();
$("#select2 .select-all").addClass("selected").siblings().removeClass("selected");
});
$(document).on("click", "#selectC", function() {
$(this).remove();
$("#select3 .select-all").addClass("selected").siblings().removeClass("selected");
});
$(document).on("click", ".select dd", function() {
if ($(".select-result dd").length > 1) {
$(".select-no").hide();
$(".eliminateCriteria").show();
$(".select-result").show();
} else {
$(".select-no").show();
$(".select-result").hide();
}
});
$(".eliminateCriteria").on("click", function() {
$("#selectA").remove();
$("#selectB").remove();
$("#selectC").remove();
$(".select-all").addClass("selected").siblings().removeClass("selected");
$(".eliminateCriteria").hide();
$(".select-no").show();
$(".select-result").hide();
$(".screening-remove-submit").on("click", function() {
$('.select-result dd.selected').remove();
$('.select-list .select-all').addClass('selected').siblings().removeClass('selected');
$(this).hide();
$('.select-result .select-no').show();
$('.select-result').hide();
});
@ -102,7 +64,7 @@ $(function()
})
$(document).on("click", ".eliminateCriteria", function() {
$(document).on("click", ".screening-remove-submit", function() {
$(".dd-conent").slideUp(300);
})

View File

Before

Width:  |  Height:  |  Size: 5.5 KiB

After

Width:  |  Height:  |  Size: 5.5 KiB

View File

Before

Width:  |  Height:  |  Size: 6.4 KiB

After

Width:  |  Height:  |  Size: 6.4 KiB

View File

Before

Width:  |  Height:  |  Size: 5.8 KiB

After

Width:  |  Height:  |  Size: 5.8 KiB

View File

Before

Width:  |  Height:  |  Size: 6.5 KiB

After

Width:  |  Height:  |  Size: 6.5 KiB

View File

Before

Width:  |  Height:  |  Size: 7.5 KiB

After

Width:  |  Height:  |  Size: 7.5 KiB

View File

Before

Width:  |  Height:  |  Size: 8.5 KiB

After

Width:  |  Height:  |  Size: 8.5 KiB

View File

Before

Width:  |  Height:  |  Size: 7.5 KiB

After

Width:  |  Height:  |  Size: 7.5 KiB

View File

Before

Width:  |  Height:  |  Size: 9.2 KiB

After

Width:  |  Height:  |  Size: 9.2 KiB

View File

Before

Width:  |  Height:  |  Size: 5.3 KiB

After

Width:  |  Height:  |  Size: 5.3 KiB

View File

Before

Width:  |  Height:  |  Size: 9.4 KiB

After

Width:  |  Height:  |  Size: 9.4 KiB

View File

Before

Width:  |  Height:  |  Size: 9.4 KiB

After

Width:  |  Height:  |  Size: 9.4 KiB

View File

Before

Width:  |  Height:  |  Size: 7.9 KiB

After

Width:  |  Height:  |  Size: 7.9 KiB

View File

Before

Width:  |  Height:  |  Size: 6.5 KiB

After

Width:  |  Height:  |  Size: 6.5 KiB

View File

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 3.6 KiB

View File

Before

Width:  |  Height:  |  Size: 3.7 KiB

After

Width:  |  Height:  |  Size: 3.7 KiB

View File

Before

Width:  |  Height:  |  Size: 6.9 KiB

After

Width:  |  Height:  |  Size: 6.9 KiB

View File

Before

Width:  |  Height:  |  Size: 5.2 KiB

After

Width:  |  Height:  |  Size: 5.2 KiB

View File

Before

Width:  |  Height:  |  Size: 4.4 KiB

After

Width:  |  Height:  |  Size: 4.4 KiB

View File

Before

Width:  |  Height:  |  Size: 6.9 KiB

After

Width:  |  Height:  |  Size: 6.9 KiB

View File

Before

Width:  |  Height:  |  Size: 6.0 KiB

After

Width:  |  Height:  |  Size: 6.0 KiB

View File

Before

Width:  |  Height:  |  Size: 7.5 KiB

After

Width:  |  Height:  |  Size: 7.5 KiB

View File

Before

Width:  |  Height:  |  Size: 5.0 KiB

After

Width:  |  Height:  |  Size: 5.0 KiB

View File

Before

Width:  |  Height:  |  Size: 6.4 KiB

After

Width:  |  Height:  |  Size: 6.4 KiB

View File

Before

Width:  |  Height:  |  Size: 6.0 KiB

After

Width:  |  Height:  |  Size: 6.0 KiB

View File

Before

Width:  |  Height:  |  Size: 8.6 KiB

After

Width:  |  Height:  |  Size: 8.6 KiB

View File

Before

Width:  |  Height:  |  Size: 6.1 KiB

After

Width:  |  Height:  |  Size: 6.1 KiB

View File

Before

Width:  |  Height:  |  Size: 7.6 KiB

After

Width:  |  Height:  |  Size: 7.6 KiB

View File

Before

Width:  |  Height:  |  Size: 7.7 KiB

After

Width:  |  Height:  |  Size: 7.7 KiB

View File

Before

Width:  |  Height:  |  Size: 4.6 KiB

After

Width:  |  Height:  |  Size: 4.6 KiB

View File

Before

Width:  |  Height:  |  Size: 6.0 KiB

After

Width:  |  Height:  |  Size: 6.0 KiB

View File

Before

Width:  |  Height:  |  Size: 6.3 KiB

After

Width:  |  Height:  |  Size: 6.3 KiB

View File

Before

Width:  |  Height:  |  Size: 5.4 KiB

After

Width:  |  Height:  |  Size: 5.4 KiB

View File

Before

Width:  |  Height:  |  Size: 6.6 KiB

After

Width:  |  Height:  |  Size: 6.6 KiB

View File

Before

Width:  |  Height:  |  Size: 8.9 KiB

After

Width:  |  Height:  |  Size: 8.9 KiB

View File

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 3.6 KiB

View File

Before

Width:  |  Height:  |  Size: 6.7 KiB

After

Width:  |  Height:  |  Size: 6.7 KiB

View File

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 26 KiB

View File

Before

Width:  |  Height:  |  Size: 134 KiB

After

Width:  |  Height:  |  Size: 134 KiB

View File

Before

Width:  |  Height:  |  Size: 160 KiB

After

Width:  |  Height:  |  Size: 160 KiB

View File

Before

Width:  |  Height:  |  Size: 152 KiB

After

Width:  |  Height:  |  Size: 152 KiB

View File

Before

Width:  |  Height:  |  Size: 224 KiB

After

Width:  |  Height:  |  Size: 224 KiB

View File

Before

Width:  |  Height:  |  Size: 110 KiB

After

Width:  |  Height:  |  Size: 110 KiB

View File

Before

Width:  |  Height:  |  Size: 229 KiB

After

Width:  |  Height:  |  Size: 229 KiB

View File

Before

Width:  |  Height:  |  Size: 108 KiB

After

Width:  |  Height:  |  Size: 108 KiB

View File

Before

Width:  |  Height:  |  Size: 77 KiB

After

Width:  |  Height:  |  Size: 77 KiB

View File

Before

Width:  |  Height:  |  Size: 223 KiB

After

Width:  |  Height:  |  Size: 223 KiB

View File

Before

Width:  |  Height:  |  Size: 122 KiB

After

Width:  |  Height:  |  Size: 122 KiB

View File

Before

Width:  |  Height:  |  Size: 134 KiB

After

Width:  |  Height:  |  Size: 134 KiB

View File

Before

Width:  |  Height:  |  Size: 185 KiB

After

Width:  |  Height:  |  Size: 185 KiB

View File

Before

Width:  |  Height:  |  Size: 134 KiB

After

Width:  |  Height:  |  Size: 134 KiB

View File

Before

Width:  |  Height:  |  Size: 167 KiB

After

Width:  |  Height:  |  Size: 167 KiB

View File

Before

Width:  |  Height:  |  Size: 267 KiB

After

Width:  |  Height:  |  Size: 267 KiB

View File

Before

Width:  |  Height:  |  Size: 176 KiB

After

Width:  |  Height:  |  Size: 176 KiB

View File

Before

Width:  |  Height:  |  Size: 118 KiB

After

Width:  |  Height:  |  Size: 118 KiB

View File

Before

Width:  |  Height:  |  Size: 1.0 MiB

After

Width:  |  Height:  |  Size: 1.0 MiB

View File

Before

Width:  |  Height:  |  Size: 420 KiB

After

Width:  |  Height:  |  Size: 420 KiB

View File

Before

Width:  |  Height:  |  Size: 115 KiB

After

Width:  |  Height:  |  Size: 115 KiB

View File

Before

Width:  |  Height:  |  Size: 142 KiB

After

Width:  |  Height:  |  Size: 142 KiB

View File

Before

Width:  |  Height:  |  Size: 60 KiB

After

Width:  |  Height:  |  Size: 60 KiB

View File

Before

Width:  |  Height:  |  Size: 108 KiB

After

Width:  |  Height:  |  Size: 108 KiB

View File

Before

Width:  |  Height:  |  Size: 72 KiB

After

Width:  |  Height:  |  Size: 72 KiB

View File

Before

Width:  |  Height:  |  Size: 458 KiB

After

Width:  |  Height:  |  Size: 458 KiB

View File

Before

Width:  |  Height:  |  Size: 97 KiB

After

Width:  |  Height:  |  Size: 97 KiB

View File

Before

Width:  |  Height:  |  Size: 228 KiB

After

Width:  |  Height:  |  Size: 228 KiB

View File

Before

Width:  |  Height:  |  Size: 94 KiB

After

Width:  |  Height:  |  Size: 94 KiB

View File

Before

Width:  |  Height:  |  Size: 151 KiB

After

Width:  |  Height:  |  Size: 151 KiB

View File

Before

Width:  |  Height:  |  Size: 92 KiB

After

Width:  |  Height:  |  Size: 92 KiB

View File

Before

Width:  |  Height:  |  Size: 164 KiB

After

Width:  |  Height:  |  Size: 164 KiB

View File

Before

Width:  |  Height:  |  Size: 75 KiB

After

Width:  |  Height:  |  Size: 75 KiB

View File

Before

Width:  |  Height:  |  Size: 67 KiB

After

Width:  |  Height:  |  Size: 67 KiB

View File

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 18 KiB

View File

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 18 KiB

View File

Before

Width:  |  Height:  |  Size: 66 KiB

After

Width:  |  Height:  |  Size: 66 KiB

View File

Before

Width:  |  Height:  |  Size: 92 KiB

After

Width:  |  Height:  |  Size: 92 KiB

View File

Before

Width:  |  Height:  |  Size: 86 KiB

After

Width:  |  Height:  |  Size: 86 KiB

View File

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 22 KiB

View File

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 20 KiB

View File

Before

Width:  |  Height:  |  Size: 47 KiB

After

Width:  |  Height:  |  Size: 47 KiB

View File

Before

Width:  |  Height:  |  Size: 54 KiB

After

Width:  |  Height:  |  Size: 54 KiB

Some files were not shown because too many files have changed in this diff Show More