提交 39dbb5d2 编写于 作者: D devil_gong

细节优化

上级 7e42f5e8
......@@ -8,6 +8,9 @@
* 演示地址:http://demo.shopxo.net/ (管理账户/密码可进入官网查看)
* 支付宝小程序:http://shopxo.net/alipay.html
### 安装教程
* v1.2.0安装教程:https://ask.shopxo.net/article/5
### 官方QQ群
* 群号:833531593
* 答案:shopxo.net
......@@ -18,7 +21,7 @@
* 腾讯云开发者:https://dev.tencent.com/u/gongfuxiang/p/shopxo/git
### 扩展性
* 支持多语言,独立模块式开发,完善的注释,易扩展。
* 独立模块式开发,完善的注释,易扩展。
### 安全性
* 防止sql注入,代码高安全性。
......
......@@ -17,7 +17,7 @@
* @datetime 2016-12-01T21:51:08+0800
*/
return array(
return [
// 缓存key列表
// 权限缓存存储key
'cache_admin_power_key' => 'cache_admin_power_',
......@@ -32,7 +32,7 @@ return array(
'DEFAULT_THEME' => 'Default',
// 百度编辑器配置信息 ueditor
'ueditor_config' => array(
'ueditor_config' => [
// 上传图片配置项
// 执行上传图片的action名称
'imageActionName' => 'uploadimage',
......@@ -44,7 +44,7 @@ return array(
'imageMaxSize' => MyC('home_max_limit_image', 2048000, true),
// 上传图片格式显示
'imageAllowFiles' => array('.png', '.jpg', '.jpeg', '.gif', '.bmp'),
'imageAllowFiles' => ['.png', '.jpg', '.jpeg', '.gif', '.bmp'],
// 是否压缩图片,默认是true
'imageCompressEnable' => true,
......@@ -98,7 +98,7 @@ return array(
// 抓取远程图片配置
// 执行抓取远程图片的action名称
'catcherLocalDomain' => array('127.0.0.1', 'localhost', 'img.baidu.com'),
'catcherLocalDomain' => ['127.0.0.1', 'localhost', 'img.baidu.com'],
// 执行抓取远程图片的action名称
'catcherActionName' => 'catchimage',
......@@ -116,7 +116,7 @@ return array(
'catcherMaxSize' => MyC('home_max_limit_image', 2048000, true),
// 抓取图片格式显示
'catcherAllowFiles' => array('.png', '.jpg', '.jpeg', '.gif', '.bmp'),
'catcherAllowFiles' => ['.png', '.jpg', '.jpeg', '.gif', '.bmp'],
// 上传视频配置
......@@ -136,7 +136,7 @@ return array(
'videoMaxSize' => MyC('home_max_limit_video', 102400000, true),
// 上传视频格式显示
'videoAllowFiles' => array('.swf', '.ogg', '.ogv', '.mp4', '.webm', '.mp3'),
'videoAllowFiles' => ['.swf', '.ogg', '.ogv', '.mp4', '.webm', '.mp3'],
// 上传文件配置
......@@ -156,7 +156,7 @@ return array(
'fileMaxSize' => MyC('home_max_limit_file', 51200000, true),
// 上传文件格式显示
'fileAllowFiles' => array('.png', '.jpg', '.jpeg', '.gif', '.bmp', '.flv', '.swf', '.mkv', '.avi', '.rm', '.rmvb', '.mpeg', '.mpg', '.ogg', '.ogv', '.mov', '.wmv', '.mp4', '.webm', '.mp3', '.wav', '.mid','.rar', '.zip', '.tar', '.gz', '.7z', '.bz2', '.cab', '.iso', '.doc', '.docx', '.xls', '.xlsx', '.ppt', '.pptx', '.pdf', '.txt', '.md', '.xml'),
'fileAllowFiles' => ['.png', '.jpg', '.jpeg', '.gif', '.bmp', '.flv', '.swf', '.mkv', '.avi', '.rm', '.rmvb', '.mpeg', '.mpg', '.ogg', '.ogv', '.mov', '.wmv', '.mp4', '.webm', '.mp3', '.wav', '.mid','.rar', '.zip', '.tar', '.gz', '.7z', '.bz2', '.cab', '.iso', '.doc', '.docx', '.xls', '.xlsx', '.ppt', '.pptx', '.pdf', '.txt', '.md', '.xml'],
// 列出指定目录下的图片
......@@ -176,7 +176,7 @@ return array(
'imageManagerInsertAlign'=> 'none',
// 列出的文件类型
'imageManagerAllowFiles'=> array('.png', '.jpg', '.jpeg', '.gif', '.bmp'),
'imageManagerAllowFiles'=> ['.png', '.jpg', '.jpeg', '.gif', '.bmp'],
// 列出指定目录下的文件
......@@ -193,7 +193,7 @@ return array(
'fileManagerListSize' => 20,
// 列出的文件类型
'fileManagerAllowFiles' => array('.png', '.jpg', '.jpeg', '.gif', '.bmp', '.flv', '.swf', '.mkv', '.avi', '.rm', '.rmvb', '.mpeg', '.mpg', '.ogg', '.ogv', '.mov', '.wmv', '.mp4', '.webm', '.mp3', '.wav', '.mid','.rar', '.zip', '.tar', '.gz', '.7z', '.bz2', '.cab', '.iso', '.doc', '.docx', '.xls', '.xlsx', '.ppt', '.pptx', '.pdf', '.txt', '.md', '.xml'),
'fileManagerAllowFiles' => ['.png', '.jpg', '.jpeg', '.gif', '.bmp', '.flv', '.swf', '.mkv', '.avi', '.rm', '.rmvb', '.mpeg', '.mpg', '.ogg', '.ogv', '.mov', '.wmv', '.mp4', '.webm', '.mp3', '.wav', '.mid','.rar', '.zip', '.tar', '.gz', '.7z', '.bz2', '.cab', '.iso', '.doc', '.docx', '.xls', '.xlsx', '.ppt', '.pptx', '.pdf', '.txt', '.md', '.xml'],
// 执行视频管理的action名称
'videoManagerActionName' => 'listvideo',
......@@ -208,6 +208,7 @@ return array(
'videoManagerListSize' => 20,
// 列出的文件类型
'videoManagerAllowFiles' => array('.swf', '.ogg', '.ogv', '.mp4', '.webm', '.mp3'),
),
);
\ No newline at end of file
'videoManagerAllowFiles' => ['.swf', '.ogg', '.ogv', '.mp4', '.webm', '.mp3'],
],
];
?>
\ No newline at end of file
......@@ -33,3 +33,4 @@ return [
// 标签库标签结束标记
'taglib_end' => '}}',
];
?>
\ No newline at end of file
......@@ -137,7 +137,7 @@ class Common extends Controller
$this->assign('admin', $this->admin);
// 图片host地址
$this->assign('images_host', config('images_host'));
$this->assign('images_host', config('shopxo.images_host'));
}
/**
......
<?php
// +----------------------------------------------------------------------
// | ShopXO 国内领先企业级B2C免费开源电商系统
// +----------------------------------------------------------------------
// | Copyright (c) 2011~2018 http://shopxo.net All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: Devil
// +----------------------------------------------------------------------
namespace app\admin\controller;
/**
* 优惠券管理
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2016-12-01T21:51:08+0800
*/
class Coupon extends Common
{
/**
* 构造方法
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2016-12-03T12:39:08+0800
*/
public function __construct()
{
// 调用父类前置方法
parent::__construct();
// 登录校验
$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()
{
// 参数
$param = array_merge($_POST, $_GET);
// 模型对象
$m = db('Coupon');
// 条件
$where = $this->GetIndexWhere();
// 分页
$number = MyC('admin_page_number', 10, true);
$page_param = array(
'number' => $number,
'total' => $m->where($where)->count(),
'where' => $param,
'url' => MyUrl('Admin/Coupon/Index'),
);
$page = new \base\Page($page_param);
// 获取列表
$list = $this->SetDataHandle($m->where($where)->limit($page->GetPageStarNumber(), $number)->order('is_enable desc, id desc')->select());
// 参数
$this->assign('param', $param);
// 分页
$this->assign('page_html', $page->GetPageHtml());
// 是否启用
$this->assign('common_is_enable_list', lang('common_is_enable_list'));
// 优惠券类型
$this->assign('common_coupon_type', lang('common_coupon_type'));
// 数据列表
$this->assign('list', $list);
$this->display('Index');
}
/**
* [SetDataHandle 数据处理]
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2016-12-29T21:27:15+0800
* @param [array] $data [优惠券数据]
* @return [array] [处理好的数据]
*/
private function SetDataHandle($data)
{
if(!empty($data))
{
$common_coupon_type = lang('common_coupon_type');
$common_is_enable_tips = lang('common_is_enable_tips');
foreach($data as &$v)
{
// 是否启用
$v['is_enable_text'] = $common_is_enable_tips[$v['is_enable']]['name'];
// 类型
$v['type_text'] = $common_coupon_type[$v['type']]['name'];
// 有效时间
$v['valid_start_time_text'] = empty($v['valid_start_time']) ? '' : date('Y-m-d H:i:s', $v['valid_start_time']);
$v['valid_end_time_text'] = empty($v['valid_end_time']) ? '' : date('Y-m-d H:i:s', $v['valid_end_time']);
// 金额美化
$v['price'] = PriceBeautify($v['price']);
$v['use_where_price'] = PriceBeautify($v['use_where_price']);
// 添加时间
$v['add_time_text'] = date('Y-m-d H:i:s', $v['add_time']);
// 更新时间
$v['upd_time_text'] = date('Y-m-d H:i:s', $v['upd_time']);
}
}
return $data;
}
/**
* [GetIndexWhere 列表条件]
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2016-12-10T22:16:29+0800
*/
private function GetIndexWhere()
{
$where = array();
// 模糊
if(!empty($_REQUEST['keyword']))
{
$where['name'] = array('like', '%'.I('keyword').'%');
}
// 是否更多条件
if(I('is_more', 0) == 1)
{
if(I('is_enable', -1) > -1)
{
$where['is_enable'] = intval(I('is_enable', 0));
}
if(I('type', -1) > -1)
{
$where['type'] = intval(I('type', 0));
}
// 表达式
if(!empty($_REQUEST['time_start']))
{
$where['add_time'][] = array('gt', strtotime(I('time_start')));
}
if(!empty($_REQUEST['time_end']))
{
$where['add_time'][] = array('lt', strtotime(I('time_end')));
}
}
return $where;
}
/**
* [SaveInfo 添加/编辑页面]
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2016-12-14T21:37:02+0800
*/
public function SaveInfo()
{
// 优惠券信息
$data = empty($_REQUEST['id']) ? array() : db('Coupon')->find(I('id'));
if(!empty($data))
{
$data['valid_start_time'] = empty($data['valid_start_time']) ? '' : date('Y-m-d H:i:s', $data['valid_start_time']);
$data['valid_end_time'] = empty($data['valid_end_time']) ? '' : date('Y-m-d H:i:s', $data['valid_end_time']);
$data['price'] = PriceBeautify($data['price']);
$data['use_where_price'] = PriceBeautify($data['use_where_price']);
}
$this->assign('data', $data);
// 是否启用
$this->assign('common_is_enable_list', lang('common_is_enable_list'));
// 优惠券类型
$this->assign('common_coupon_type', lang('common_coupon_type'));
// 参数
$this->assign('param', array_merge($_POST, $_GET));
$this->display('SaveInfo');
}
/**
* [Save 优惠券添加/编辑]
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2016-12-14T21:37:02+0800
*/
public function Save()
{
// 是否ajax请求
if(!IS_AJAX)
{
$this->error('非法访问');
}
// 添加
if(empty($_POST['id']))
{
$this->Add();
// 编辑
} else {
$this->Edit();
}
}
/**
* [Add 优惠券添加]
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2016-12-18T16:20:59+0800
*/
private function Add()
{
// 优惠券模型
$m = D('Coupon');
// 数据自动校验
if($m->create($_POST, 1))
{
// 额外数据处理
if(!empty($m->valid_start_time))
{
$m->valid_start_time = strtotime($m->valid_start_time);
}
if(!empty($m->valid_end_time))
{
$m->valid_end_time = strtotime($m->valid_end_time);
}
if(empty($m->use_where_price))
{
$m->use_where_price = 0.00;
}
$m->name = I('name');
$m->type = intval(I('type'));
$m->is_enable = intval(I('is_enable'));
$m->add_time = time();
// 数据添加
if($m->add())
{
$this->ajaxReturn('新增成功');
} else {
$this->ajaxReturn('新增失败', -100);
}
} else {
$this->ajaxReturn($m->getError(), -1);
}
}
/**
* [Edit 优惠券编辑]
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2016-12-17T22:13:40+0800
*/
private function Edit()
{
// 优惠券模型
$m = D('Coupon');
// 数据自动校验
if($m->create($_POST, 2))
{
// 额外数据处理
if(!empty($m->valid_start_time))
{
$m->valid_start_time = strtotime($m->valid_start_time);
}
if(!empty($m->valid_end_time))
{
$m->valid_end_time = strtotime($m->valid_end_time);
}
if(empty($m->use_where_price))
{
$m->use_where_price = 0.00;
}
$m->name = I('name');
$m->type = intval(I('type'));
$m->is_enable = intval(I('is_enable'));
$m->add_time = time();
$m->upd_time = time();
// 更新数据库
if($m->where(array('id'=>I('id')))->save())
{
$this->ajaxReturn('编辑成功');
} else {
$this->ajaxReturn('编辑失败或数据未改变', -100);
}
} else {
$this->ajaxReturn($m->getError(), -1);
}
}
/**
* [SendInfo 优惠券发放页面]
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2016-12-14T21:37:02+0800
*/
public function SendInfo()
{
// 优惠券信息
$data = empty($_REQUEST['id']) ? array() : db('Coupon')->find(I('id'));
if(!empty($data))
{
$data['valid_start_time'] = empty($data['valid_start_time']) ? '' : date('Y-m-d H:i:s', $data['valid_start_time']);
$data['valid_end_time'] = empty($data['valid_end_time']) ? '' : date('Y-m-d H:i:s', $data['valid_end_time']);
$data['price'] = PriceBeautify($data['price']);
$data['use_where_price'] = PriceBeautify($data['use_where_price']);
$data['type_text'] = lang('common_coupon_type')[$data['type']]['name'];
}
$this->assign('data', $data);
$this->assign('coupon_id', I('id'));
$this->display('SendInfo');
}
/**
* [UserQuery 用户查询]
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @datetime 2018-05-23T16:53:53+0800
*/
public function UserQuery()
{
// 是否ajax请求
if(!IS_AJAX)
{
$this->error('非法访问');
}
// 参数
$keyword = I('keyword');
if(empty($keyword))
{
$this->error('搜索关键字不能为空');
}
// 查询数据
$where = [
[
'username' => $keyword,
'nickname' => $keyword,
'mobile' => $keyword,
'_logic' => 'or',
],
'is_delete_time' => 0,
];
$user = db('User')->where($where)->field('id,username,nickname,mobile,avatar')->find();
if(empty($user))
{
$this->ajaxReturn('没有相关数据', -1);
}
if(empty($user['avatar']))
{
$user['avatar'] = config('images_host').'Public/Common/Images/user-img-md.gif';
}
$this->ajaxReturn('操作成功', 0, $user);
}
/**
* [Send 用户优惠券发放]
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @datetime 2018-05-23T17:45:06+0800
*/
public function Send()
{
// 是否ajax请求
if(!IS_AJAX)
{
$this->error('非法访问');
}
// 请求参数
$params = [
[
'checked_type' => 'empty',
'key_name' => 'coupon_id',
'error_msg' => '优惠券不能为空',
],
[
'checked_type' => 'empty',
'key_name' => 'user_id',
'error_msg' => '用户不能为空',
],
[
'checked_type' => 'empty',
'key_name' => 'valid_start_time',
'error_msg' => '有效起始时间不能为空',
],
[
'checked_type' => 'empty',
'key_name' => 'valid_end_time',
'error_msg' => '有效截止时间不能为空',
]
];
$ret = ParamsChecked($this->data_post, $params);
if($ret !== true)
{
$this->ajaxReturn($ret, -1);
}
// 优惠券
$coupon = db('Coupon')->find($this->data_post['coupon_id']);
if(empty($coupon))
{
$this->ajaxReturn('优惠券不存在', -2);
}
if($coupon['is_enable'] != 1)
{
$this->ajaxReturn('优惠券已关闭', -2);
}
// 发放
$success = 0;
$failure = 0;
$m = db('UserCoupon');
foreach($this->data_post['user_id'] as $user_id)
{
$data = [
'user_id' => $user_id,
'coupon_id' => $coupon['id'],
'status' => 0,
'price' => $coupon['price'],
'valid_start_time' => strtotime($this->data_post['valid_start_time']),
'valid_end_time' => strtotime($this->data_post['valid_end_time']),
'add_time' => time(),
'upd_time' => time(),
];
if($m->add($data) > 0)
{
$success++;
} else {
$failure++;
}
}
$this->ajaxReturn('成功['.$success.'], 失败['.$failure.']', 0);
}
/**
* [User 用户优惠券 - 列表]
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2016-12-06T21:31:53+0800
*/
public function User()
{
// 参数
$param = array_merge($_POST, $_GET);
// 模型对象
$m = db('UserCoupon');
// 条件
$where = $this->GetUserWhere($param);
// 分页
$number = MyC('admin_page_number', 10, true);
$page_param = array(
'number' => $number,
'total' => $m->alias('uc')->join('__USER__ AS u ON u.id=uc.user_id')->where($where)->count(),
'where' => $param,
'url' => MyUrl('Admin/Coupon/User'),
);
$page = new \base\Page($page_param);
// 获取列表
$field = 'u.username, u.nickname, u.mobile, uc.*';
$list = $this->UserSetDataHandle($m->alias('uc')->join('__USER__ AS u ON u.id=uc.user_id')->field($field)->where($where)->limit($page->GetPageStarNumber(), $number)->order('uc.id desc')->select());
// 参数
$this->assign('param', $param);
// 分页
$this->assign('page_html', $page->GetPageHtml());
// 是否启用
$this->assign('common_user_coupon_status', lang('common_user_coupon_status'));
// 数据列表
$this->assign('list', $list);
$this->display('User');
}
/**
* [UserSetDataHandle 用户优惠券 - 数据处理]
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2016-12-29T21:27:15+0800
* @param [array] $data [优惠券数据]
* @return [array] [处理好的数据]
*/
private function UserSetDataHandle($data)
{
if(!empty($data))
{
$common_coupon_type = lang('common_coupon_type');
$common_user_coupon_status = lang('common_user_coupon_status');
$coupon = [];
$coupon_m = db('Coupon');
foreach($data as &$v)
{
// 获取优惠券信息
if(!isset($coupon[$v['coupon_id']]))
{
$temp_coupon = $coupon_m->find($v['coupon_id']);
$temp_coupon['type_text'] = $common_coupon_type[$temp_coupon['type']]['name'];
$coupon[$v['coupon_id']] = $temp_coupon;
} else {
$temp_coupon = $coupon[$v['coupon_id']];
}
// 优惠券信息加入
$v['coupon_type'] = $temp_coupon['type'];
$v['coupon_type_text'] = $temp_coupon['type_text'];
$v['coupon_name'] = $temp_coupon['name'];
$v['coupon_use_where_price'] = PriceBeautify($temp_coupon['use_where_price']);
// 有效时间
$v['valid_start_time_text'] = empty($v['valid_start_time']) ? '' : date('Y-m-d H:i:s', $v['valid_start_time']);
$v['valid_end_time_text'] = empty($v['valid_end_time']) ? '' : date('Y-m-d H:i:s', $v['valid_end_time']);
// 金额美化
$v['price'] = PriceBeautify($v['price']);
// 是否启用
$v['status_text'] = $common_user_coupon_status[$v['status']]['name'];
// 添加时间
$v['add_time_text'] = date('Y-m-d H:i:s', $v['add_time']);
// 更新时间
$v['upd_time_text'] = date('Y-m-d H:i:s', $v['upd_time']);
}
}
return $data;
}
/**
* [GetUserWhere 用户优惠券 - 列表条件]
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2016-12-10T22:16:29+0800
*/
private function GetUserWhere($param)
{
$where = array(
'uc.coupon_id' => isset($this->data_get['coupon_id']) ? intval($this->data_get['coupon_id']) : 0,
'uc.is_delete_time' => 0,
'u.is_delete_time' => 0,
);
// 模糊
if(!empty($_REQUEST['keyword']))
{
$like_keyword = array('like', '%'.$param['keyword'].'%');
$where[] = array(
'u.username' => $like_keyword,
'u.nickname' => $like_keyword,
'u.mobile' => $like_keyword,
'_logic' => 'or',
);
}
// 是否更多条件
if(I('is_more', 0) == 1)
{
if($param['status'] > -1)
{
$where['uc.status'] = intval($param['status']);
}
// 表达式
if(!empty($param['time_start']))
{
$where['uc.valid_start_time'] = array('gt', strtotime($param['time_start']));
}
if(!empty($param['time_end']))
{
$where['uc.valid_end_time'] = array('lt', strtotime($param['time_end']));
}
}
return $where;
}
/**
* [Delete 用户优惠券删除]
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2016-12-15T11:03:30+0800
*/
public function Delete()
{
// 是否ajax请求
if(!IS_AJAX)
{
$this->error('非法访问');
}
// 参数处理
$id = I('id');
// 删除数据
if(!empty($id))
{
// 模型
$m = db('UserCoupon');
// 是否存在
$user_coupon = $m->where(array('id'=>$id))->getField('id');
if(empty($user_coupon))
{
$this->ajaxReturn('优惠券不存在', -2);
}
// 删除
if($m->where(array('id'=>$id))->save(['is_delete_time'=>time()]) !== false)
{
$this->ajaxReturn('删除成功');
} else {
$this->ajaxReturn('删除失败或资源不存在', -100);
}
} else {
$this->ajaxReturn('参数错误', -1);
}
}
/**
* [StateUpdate 状态更新]
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2017-01-12T22:23:06+0800
*/
public function StateUpdate()
{
// 参数
if(empty($_POST['id']) || !isset($_POST['state']))
{
$this->ajaxReturn('参数错误', -1);
}
// 数据更新
if(db('Coupon')->where(array('id'=>I('id')))->save(array('is_enable'=>I('state'))))
{
$this->ajaxReturn('编辑成功');
} else {
$this->ajaxReturn('编辑失败或数据未改变', -100);
}
}
}
?>
\ No newline at end of file
......@@ -96,7 +96,7 @@ class Order extends Common
// 发起支付 - 支付方式
$pay_where = [
'where' => ['is_enable'=>1, 'is_open_user'=>1, 'payment'=>config('under_line_list')],
'where' => ['is_enable'=>1, 'is_open_user'=>1, 'payment'=>config('shopxo.under_line_list')],
];
$this->assign('buy_payment_list', PaymentService::BuyPaymentList($pay_where));
......
{{include file="public/header" /}}
<!-- right content start -->
<div class="content-right">
<div class="content">
<!-- form start -->
<form class="am-form view-list" action="{{:MyUrl('Admin/Coupon/Index')}}" method="POST">
<div class="am-g">
<input type="text" class="am-radius form-keyword" placeholder="优惠券名称" name="keyword" <present name="param['keyword']"> value="{{$param.keyword}}"{{/if}} />
<button type="submit" class="am-btn am-btn-secondary am-btn-sm am-radius form-submit">查询</button>
<label class="fs-12 m-l-5 c-p fw-100 more-submit">
更多筛选
<input type="checkbox" name="is_more" value="1" id="is_more" {{if isset($param['is_more']) and $param['is_more'] eq 1)}}checked{{/if}} />
<i class="am-icon-angle-down"></i>
</label>
<div class="more-where {{if !isset($param['is_more']) or $param['is_more'] neq 1)}}none{{/if}}">
<select name="is_enable" class="am-radius c-p m-t-10 m-l-5 param-where">
<option value="-1)}}是否启用</option>
<foreach name="common_is_enable_list" item="v">
<option value="{{$v.id}}" {{if isset($param['is_enable']) and $param['is_enable'] eq $v['id']">selected{{/if}}>{{$v.name}}</option>
{{/foreach}}
</select>
<select name="type" class="am-radius c-p m-t-10 m-l-5 param-where">
<option value="-1)}}优惠券类型</option>
<foreach name="common_coupon_type" item="v">
<option value="{{$v.id}}" {{if isset($param['type']) and $param['type'] eq $v['id']">selected{{/if}}>{{$v.name}}</option>
{{/foreach}}
</select>
<div class="param-date param-where m-l-5)}}
<input type="text" name="time_start" class="Wdate am-radius m-t-10" placeholder="起始时间" onclick="WdatePicker({firstDayOfWeek:1,dateFmt:'yyyy-MM-dd HH:mm:ss'})" {{if isset($param['time_start'])}}value="{{$param.time_start}}"{{/if}}/>
<span>~</span>
<input type="text" class="Wdate am-radius m-t-10" placeholder="结束时间" name="time_end" onclick="WdatePicker({firstDayOfWeek:1,dateFmt:'yyyy-MM-dd HH:mm:ss'})" {{if isset($param['time_end'])}}value="{{$param.time_end}}"{{/if}}/>
</div>
</div>
</div>
</form>
<!-- form end -->
<!-- operation start -->
<div class="am-g m-t-15)}}
<a href="{{:MyUrl('Admin/Coupon/SaveInfo')}}" class="am-btn am-btn-secondary am-radius am-btn-xs am-icon-plus"> 新增</a>
</div>
<!-- operation end -->
<!-- list start -->
<table class="am-table am-table-striped am-table-hover am-text-middle m-t-1)}}
<thead>
<tr>
<th>优惠券名称</th>
<th>优惠券类型</th>
<th>金额(元)</th>
<th>使用条件金额(元)</th>
<th class="am-hide-sm-only">有效时间</th>
<th class="am-hide-sm-only">是否启用</th>
<th>更多</th>
<th>操作</th>
</tr>
</thead>
<tbody>
{{if !empty($list)}}
<foreach name="list" item="v">
<tr id="data-list-{{$v.id}}" {{if $v['is_enable'] eq 0)}}class="am-active"{{/if}}>
<td>{{$v.name}}</td>
<td>{{$v.type_text}}</td>
<td>{{$v.price}}</td>
<td>
{{if empty($v['use_where_price'])}}
<span class="cr-ddd">不限</span>
{{else /}}
{{$v.use_where_price}}
{{/if}}
</td>
<td class="am-hide-sm-only">
{{if !empty($v['valid_start_time_text'])}}
{{$v.valid_start_time_text}}<br />
{{/if}}
{{if !empty($v['valid_end_time_text'])}}
{{$v.valid_end_time_text}}
{{/if}}
{{if empty($v['valid_start_time_text']) and empty($v['valid_end_time_text'])}}
<span class="cr-ccc">不限</span>
{{/if}}
</td>
<td class="am-hide-sm-only">
<a href="javascript:;" class="am-icon-btn am-icon-check submit-state {{if $v['is_enable'] eq 1)}}am-success{{else /}}am-default{{/if}}" data-url="{{:MyUrl('Admin/Coupon/StateUpdate')}}" data-id="{{$v.id}}" data-state="{{$v['is_enable']}}" data-is-update-status="1)}}</a>
</td>
<td>
<span class="am-icon-caret-down c-p" data-am-modal="{target: '#my-popup{{$v.id}}'}"> 查看更多</span>
<div class="am-popup am-radius" id="my-popup{{$v.id}}">
<div class="am-popup-inner">
<div class="am-popup-hd">
<h4 class="am-popup-title">详情内容</h4>
<span data-am-modal-close
class="am-close">&times;</span>
</div>
<div class="am-popup-bd">
<dl class="dl-content">
<dt>优惠券名称</dt>
<dd>{{if empty($v['name'])}}<span class="cr-ddd">未填写</span>{{else /}}{{$v.name}}{{/if}}</dd>
<dt>优惠券类型</dt>
<dd>{{if empty($v['type_text'])}}<span class="cr-ddd">未填写</span>{{else /}}{{$v.type_text}}{{/if}}</dd>
<dt>金额(元)</dt>
<dd>{{if empty($v['price'])}}<span class="cr-ddd">未填写</span>{{else /}}{{$v.price}}{{/if}}</dd>
<dt>使用条件金额(元)</dt>
<dd>{{if empty($v['use_where_price'])}}<span class="cr-ddd">不限</span>{{else /}}{{$v.use_where_price}}{{/if}}</dd>
<dt>有效时间</dt>
<dd>
{{if !empty($v['valid_start_time_text'])}}
{{$v.valid_start_time_text}}<br />
{{/if}}
{{if !empty($v['valid_end_time_text'])}}
{{$v.valid_end_time_text}}
{{/if}}
{{if empty($v['valid_start_time_text']) and empty($v['valid_end_time_text'])}}
<span class="cr-ccc">未填写</span>
{{/if}}
</dd>
<dt>是否启用</dt>
<dd>{{if empty($v['is_enable_text'])}}<span class="cr-ddd">未填写</span>{{else /}}{{$v.is_enable_text}}{{/if}}</dd>
<dt>创建时间</dt>
<dd>{{$v.add_time_text}}</dd>
<dt>更新时间</dt>
<dd>{{$v.upd_time_text}}</dd>
</dl>
</div>
</div>
</div>
</td>
<td class="view-operation">
<a href="{{:MyUrl('Admin/Coupon/User', array('coupon_id'=>$v['id']))}}">
<button class="am-btn am-btn-default am-btn-xs am-radius am-icon-user"> 用户优惠券</button>
</a>
<a href="{{:MyUrl('Admin/Coupon/SaveInfo', array('id'=>$v['id']))}}">
<button class="am-btn am-btn-default am-btn-xs am-radius am-icon-edit"> 编辑</button>
</a>
{{if $v['is_enable'] eq 1)}}
<a href="{{:MyUrl('Admin/Coupon/SendInfo', array('id'=>$v['id']))}}">
<button class="am-btn am-btn-default am-btn-xs am-radius am-icon-send-o"> 发放</button>
</a>
{{/if}}
</td>
</tr>
{{/foreach}}
{{else /}}
<tr><td colspan="20" class="table-no">没有相关数据</td></tr>
{{/if}}
</tbody>
</table>
<!-- list end -->
<!-- page start -->
{{if !empty($list)}}
{{$page_html}}
{{/if}}
<!-- page end -->
</div>
</div>
<!-- right content end -->
<!-- footer start -->
{{include file="public/footer" /}}
<!-- footer end -->
\ No newline at end of file
{{include file="public/header" /}}
<!-- right content start -->
<div class="content-right">
<div class="content">
<!-- form start -->
<form class="am-form form-validation view-save" action="{{:MyUrl('Admin/Coupon/Save')}}" method="POST" request-type="ajax-url" request-value="{{:MyUrl('Admin/Coupon/Index')}}" enctype="multipart/form-data">
<input type="hidden" name="max_file_size" value="{{:MyC('home_max_limit_image', 2048000)}}" />
<legend>
<span class="fs-16)}}
{{if empty($data['id'])}}
优惠券添加
{{else /}}
优惠券编辑
{{/if}}
</span>
<a href="{{:MyUrl('Admin/Coupon/Index')}}" class="fr fs-14 m-t-5 am-icon-mail-reply"> 返回</a>
</legend>
<div class="am-form-group">
<label>优惠券名称</label>
<input type="text" name="name" placeholder="优惠券名称" minlength="2" maxlength="60" data-validation-message="优惠券名称格式 2~60 个字符" class="am-radius" <notempty name="data"> value="{{$data.name}}"{{/if}} required />
</div>
<div class="am-form-group">
<label>优惠券类型</label>
<select name="type" class="am-radius" placeholder="优惠券类型有误" {{if !empty($data)}}disabled{{/if}}>
<foreach name="common_coupon_type" item="v">
<option value="{{$v.id}}" {{if isset($data['type']) and $data['type'] eq $v['id']">selected{{else /}}{{if !isset($data['type']) and isset($v['checked']) and $v['checked'] eq true">selected{{/if}}{{/if}}>{{$v.name}}</option>
{{/foreach}}
</select>
</div>
<div class="am-form-group">
<label>金额(元)</label>
<input type="text" placeholder="金额(元)" name="price" pattern="{{:lang('common_regex_price')}}" data-validation-message="金额有误" class="am-radius" value="{{if isset($data['price']) and $data['price'] GT 0.0)}}{{$data.price}}{{/if}}" required />
</div>
<div class="am-form-group">
<label>使用条件金额(元)</label>
<input type="text" placeholder="使用条件金额(元)" name="use_where_price" pattern="{{:lang('common_regex_price')}}" data-validation-message="使用条件金额有误" class="am-radius" value="{{if isset($data['use_where_price']) and $data['use_where_price'] GT 0.0)}}{{$data.use_where_price}}{{/if}}" />
</div>
<div class="am-form-group">
<label>有效时间</label>
<div class="twain-date">
<input class="Wdate am-radius" type="text" placeholder="有效时间" name="valid_start_time" data-validation-message="有效开始时间有误" onclick="WdatePicker({firstDayOfWeek:1,dateFmt:'yyyy-MM-dd HH:mm:ss'})" <notempty name="data"> value="{{$data.valid_start_time}}"{{/if}} required />
<span>~</span>
<input class="Wdate am-radius" type="text" placeholder="有效时间" name="valid_end_time" data-validation-message="有效截止时间有误" onclick="WdatePicker({firstDayOfWeek:1,dateFmt:'yyyy-MM-dd HH:mm:ss'})" <notempty name="data"> value="{{$data.valid_end_time}}"{{/if}} required />
</div>
</div>
<include file="Lib/Enable" />
<div class="am-form-group">
<input type="hidden" name="id" <notempty name="data"> value="{{$data.id}}"{{/if}}" />
<button type="submit" class="am-btn am-btn-primary am-radius btn-loading-example am-btn-sm w100" data-am-loading="{loadingText:'处理中...'}">保存</button>
</div>
</form>
<!-- form end -->
</div>
</div>
<!-- right content end -->
<!-- footer start -->
{{include file="public/footer" /}}
<!-- footer end -->
\ No newline at end of file
{{include file="public/header" /}}
<!-- right content start -->
<div class="content-right">
<div class="content">
<!-- form start -->
<form class="am-form form-validation view-save" action="{{:MyUrl('Admin/Coupon/Send')}}" method="POST" request-type="ajax-url" request-value="{{:MyUrl('Admin/Coupon/Index')}}" enctype="multipart/form-data">
<input type="hidden" name="max_file_size" value="{{:MyC('home_max_limit_image', 2048000)}}" />
<legend>
<span class="fs-16)}}
用户优惠券发放
</span>
<a href="{{:MyUrl('Admin/Coupon/Index')}}" class="fr fs-14 m-t-5 am-icon-mail-reply"> 返回</a>
</legend>
<!-- 优惠券信息 -->
<div class="am-form-group am-alert am-alert-secondary am-radius coupon-base">
<div class="items">
<span>优惠券名称</span>
<span>{{$data['name']}}</span>
</div>
<div class="items">
<span>优惠券类型</span>
<span>{{$data['type_text']}}</span>
</div>
<div class="items">
<span>金额(元)</span>
<span>{{$data['price']}}</span>
</div>
<div class="items">
<span>使用条件金额(元)</span>
<span>
{{if empty($data['use_where_price'])}}
<span class="cr-ccc">不限</span>
{{else /}}
{{$data['use_where_price']}}
{{/if}}
</span>
</div>
<div class="items">
<span>有效时间</span>
<span>
{{if !empty($data['valid_start_time'])}}
{{$data.valid_start_time}}
{{/if}}
{{if !empty($data['valid_end_time'])}}
~ {{$data.valid_end_time}}
{{/if}}
{{if empty($data['valid_start_time']) and empty($data['valid_end_time'])}}
<span class="cr-ccc">不限</span>
{{/if}}
</span>
</div>
</div>
<!-- 查询用户 -->
<div class="am-form-group am-input-group am-input-group-sm">
<input type="text" class="am-radius search-keyword" placeholder="用户昵称/姓名/手机号码">
<span class="am-input-group-btn">
<button class="am-btn am-btn-default am-radius search-submit" type="button" data-url="{{:MyUrl('Admin/Coupon/UserQuery')}}"><span class="am-icon-search"></span> 查询</button>
</span>
</div>
<div class="am-form-group data-success none">
<img class="am-img-thumbnail am-circle fl" src="{{$images_host}}/Public/Common/Images/user-img-md.gif" />
<div class="base fl">
<p class="base-username"></p>
<p class="base-nickname"></p>
<p class="base-mobile"></p>
</div>
<button type="button" class="am-btn am-btn-success am-radius am-btn-xs join-submit">
<i class="am-icon-plus"></i>
加入列表
</button>
</div>
<div class="am-form-group data-error-tips none">
没有相关数据
</div>
<!-- 用户列表 -->
<ul class="user-list am-form-group none"></ul>
<div class="am-form-group">
<label>有效时间</label>
<div class="twain-date">
<input class="Wdate am-radius" type="text" placeholder="有效时间" name="valid_start_time" data-validation-message="有效开始时间有误" onclick="WdatePicker({firstDayOfWeek:1,dateFmt:'yyyy-MM-dd HH:mm:ss'})" <notempty name="data"> value="{{$data.valid_start_time}}"{{/if}} required />
<span>~</span>
<input class="Wdate am-radius" type="text" placeholder="有效时间" name="valid_end_time" data-validation-message="有效截止时间有误" onclick="WdatePicker({firstDayOfWeek:1,dateFmt:'yyyy-MM-dd HH:mm:ss'})" <notempty name="data"> value="{{$data.valid_end_time}}"{{/if}} required />
</div>
</div>
<div class="am-form-group">
<input type="hidden" name="coupon_id" <notempty name="data"> value="{{$data.id}}"{{/if}}" />
<button type="submit" class="am-btn am-btn-primary am-radius btn-loading-example am-btn-sm w100 form-send-submit" data-am-loading="{loadingText:'处理中...'}">提交</button>
</div>
</form>
<!-- form end -->
</div>
</div>
<!-- right content end -->
<!-- footer start -->
{{include file="public/footer" /}}
<!-- footer end -->
\ No newline at end of file
{{include file="public/header" /}}
<!-- right content start -->
<div class="content-right">
<div class="content">
<!-- form start -->
<form class="am-form view-list" action="{{:MyUrl('Admin/Coupon/User', ['coupon_id'=>I('request.coupon_id')])}}" method="POST">
<div class="am-g">
<input type="text" class="am-radius form-keyword" placeholder="用户昵称/姓名/手机号码" name="keyword" <present name="param['keyword']"> value="{{$param.keyword}}"{{/if}} />
<button type="submit" class="am-btn am-btn-secondary am-btn-sm am-radius form-submit">查询</button>
<label class="fs-12 m-l-5 c-p fw-100 more-submit">
更多筛选
<input type="checkbox" name="is_more" value="1" id="is_more" {{if isset($param['is_more']) and $param['is_more'] eq 1)}}checked{{/if}} />
<i class="am-icon-angle-down"></i>
</label>
<div class="more-where {{if !isset($param['is_more']) or $param['is_more'] neq 1)}}none{{/if}}">
<select name="status" class="am-radius c-p m-t-10 m-l-5 param-where">
<option value="-1)}}优惠券状态</option>
<foreach name="common_user_coupon_status" item="v">
<option value="{{$v.id}}" {{if isset($param['status']) and $param['status'] eq $v['id']">selected{{/if}}>{{$v.name}}</option>
{{/foreach}}
</select>
<div class="param-date param-where m-l-5)}}
<input type="text" name="time_start" class="Wdate am-radius m-t-10" placeholder="有效时间" onclick="WdatePicker({firstDayOfWeek:1,dateFmt:'yyyy-MM-dd HH:mm:ss'})" {{if isset($param['time_start'])}}value="{{$param.time_start}}"{{/if}}/>
<span>~</span>
<input type="text" class="Wdate am-radius m-t-10" placeholder="有效时间" name="time_end" onclick="WdatePicker({firstDayOfWeek:1,dateFmt:'yyyy-MM-dd HH:mm:ss'})" {{if isset($param['time_end'])}}value="{{$param.time_end}}"{{/if}}/>
</div>
</div>
<a href="{{:MyUrl('Admin/Coupon/Index')}}" class="fr fs-14 am-icon-mail-reply"> 优惠券列表</a>
</div>
</form>
<!-- form end -->
<!-- list start -->
<table class="am-table am-table-striped am-table-hover am-text-middle m-t-1)}}
<thead>
<tr>
<th>用户姓名</th>
<th>用户昵称</th>
<th>金额(元)</th>
<th>使用条件金额(元)</th>
<th class="am-hide-sm-only">有效时间</th>
<th class="am-hide-sm-only">优惠券状态</th>
<th>更多</th>
<th>操作</th>
</tr>
</thead>
<tbody>
{{if !empty($list)}}
<foreach name="list" item="v">
<tr id="data-list-{{$v.id}}">
<td>
{{if empty($v['username'])}}<span class="cr-ddd">未填写</span>{{else /}}{{$v.username}}{{/if}}
</td>
<td>
{{if empty($v['nickname'])}}<span class="cr-ddd">未填写</span>{{else /}}{{$v.nickname}}{{/if}}
</td>
<td>{{$v.price}}</td>
<td>
{{if empty($v['use_where_price'])}}
<span class="cr-ddd">不限</span>
{{else /}}
{{$v.use_where_price}}
{{/if}}
</td>
<td class="am-hide-sm-only">
{{if !empty($v['valid_start_time_text'])}}
{{$v.valid_start_time_text}}<br />
{{/if}}
{{if !empty($v['valid_end_time_text'])}}
{{$v.valid_end_time_text}}
{{/if}}
{{if empty($v['valid_start_time_text']) and empty($v['valid_end_time_text'])}}
<span class="cr-ccc">不限</span>
{{/if}}
</td>
<td>{{$v.status_text}}</td>
<td>
<span class="am-icon-caret-down c-p" data-am-modal="{target: '#my-popup{{$v.id}}'}"> 查看更多</span>
<div class="am-popup am-radius" id="my-popup{{$v.id}}">
<div class="am-popup-inner">
<div class="am-popup-hd">
<h4 class="am-popup-title">详情内容</h4>
<span data-am-modal-close
class="am-close">&times;</span>
</div>
<div class="am-popup-bd">
<dl class="dl-content">
<dt>用户姓名</dt>
<dd>{{if empty($v['username'])}}<span class="cr-ddd">未填写</span>{{else /}}{{$v.username}}{{/if}}</dd>
<dt>用户昵称</dt>
<dd>{{if empty($v['nickname'])}}<span class="cr-ddd">未填写</span>{{else /}}{{$v.nickname}}{{/if}}</dd>
<dt>金额(元)</dt>
<dd>{{if empty($v['price'])}}<span class="cr-ddd">未填写</span>{{else /}}{{$v.price}}{{/if}}</dd>
<dt>使用条件金额(元)</dt>
<dd>{{if empty($v['use_where_price'])}}<span class="cr-ddd">不限</span>{{else /}}{{$v.use_where_price}}{{/if}}</dd>
<dt>有效时间</dt>
<dd>
{{if !empty($v['valid_start_time_text'])}}
{{$v.valid_start_time_text}}<br />
{{/if}}
{{if !empty($v['valid_end_time_text'])}}
{{$v.valid_end_time_text}}
{{/if}}
{{if empty($v['valid_start_time_text']) and empty($v['valid_end_time_text'])}}
<span class="cr-ccc">未填写</span>
{{/if}}
</dd>
<dt>优惠券状态</dt>
<dd>{{if empty($v['status_text'])}}<span class="cr-ddd">未填写</span>{{else /}}{{$v.status_text}}{{/if}}</dd>
<dt>创建时间</dt>
<dd>{{$v.add_time_text}}</dd>
<dt>更新时间</dt>
<dd>{{$v.upd_time_text}}</dd>
</dl>
</div>
</div>
</div>
</td>
<td class="view-operation">
{{if $v['status'] neq 1)}}
<button class="am-btn am-btn-default am-btn-xs am-radius am-icon-trash-o submit-delete" data-url="{{:MyUrl('Admin/Coupon/Delete')}}" data-id="{{$v.id}}"> 删除</button>
{{/if}}
</td>
</tr>
{{/foreach}}
{{else /}}
<tr><td colspan="20" class="table-no">没有相关数据</td></tr>
{{/if}}
</tbody>
</table>
<!-- list end -->
<!-- page start -->
{{if !empty($list)}}
{{$page_html}}
{{/if}}
<!-- page end -->
</div>
</div>
<!-- right content end -->
<!-- footer start -->
{{include file="public/footer" /}}
<!-- footer end -->
\ No newline at end of file
<!DOCTYPE html>
<html>
<head>
<meta charset="{{:config('default_charset', 'utf-8')}}" />
<meta charset="{{:config('shopxo.default_charset', 'utf-8')}}" />
<link rel="shortcut icon" type="image/x-icon" href="favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1, maximum-scale=1" />
<title>ShopXO后台管理系统</title>
......
......@@ -17,7 +17,12 @@
* @datetime 2016-12-01T21:51:08+0800
*/
return array(
);
return [
// 默认输出类型
'default_return_type' => 'json',
// 默认AJAX 数据返回格式,可选json xml ...
'default_ajax_return' => 'json',
// 默认JSONP格式返回的处理方法
'default_jsonp_handler' => 'jsonpReturn',
];
?>
\ No newline at end of file
......@@ -10,3 +10,4 @@
// +----------------------------------------------------------------------
return [];
?>
\ No newline at end of file
......@@ -334,7 +334,7 @@ function UrlParamJoin($param)
*/
function MyC($key, $default = null, $mandatory = false)
{
$data = cache(config('cache_common_my_config_key'));
$data = cache(config('shopxo.cache_common_my_config_key'));
if($mandatory === true)
{
return empty($data[$key]) ? $default : $data[$key];
......@@ -1101,5 +1101,4 @@ function ParamsChecked($data, $params)
}
return true;
}
?>
\ No newline at end of file
......@@ -16,6 +16,7 @@
* @version 0.0.1
* @datetime 2016-12-01T21:51:08+0800
*/
return array(
return [
'url_html_suffix' => MyC('home_seo_url_html_suffix', 'html', true),
);
\ No newline at end of file
];
?>
\ No newline at end of file
......@@ -36,3 +36,4 @@ return [
// 标签库标签结束标记
'taglib_end' => '}}',
];
?>
\ No newline at end of file
......@@ -162,7 +162,7 @@ class Common extends Controller
$this->assign('is_footer', 1);
// 图片host地址
$this->assign('images_host', config('images_host'));
$this->assign('images_host', config('shopxo.images_host'));
// 标题
$this->assign('home_seo_site_title', MyC('home_seo_site_title'));
......
<!DOCTYPE html>
<html>
<head>
<meta charset="{{:config('default_charset', 'utf-8')}}" />
<meta charset="{{:config('shopxo.default_charset', 'utf-8')}}" />
<title>{{$home_seo_site_title}}</title>
<meta name="keywords" content="{{:MyC('home_seo_site_keywords')}}" />
<meta name="description" content="{{:MyC('home_seo_site_description')}}" />
......
......@@ -33,3 +33,4 @@ return [
// 标签库标签结束标记
'taglib_end' => '}}',
];
?>
\ No newline at end of file
......@@ -54,5 +54,5 @@ class Common extends Controller
$this->assign('msg', $name.' 非法访问');
return $this->fetch('public/error');
}
}?>
\ No newline at end of file
}
?>
\ No newline at end of file
......@@ -316,17 +316,12 @@ php;
{
if (!empty($v))
{
if (substr($v, 0, 12) == 'CREATE TABLE')
if($db->execute($v) !== false)
{
if($db->execute($v) !== false)
{
$success++;
} else {
$failure++;
}
$success++;
} else {
$db->execute($v);
}
$failure++;
}
}
}
......
......@@ -10,5 +10,5 @@
// +----------------------------------------------------------------------
// 应用容器绑定定义
return [
];
return [];
?>
\ No newline at end of file
......@@ -46,7 +46,7 @@ class AppNavService
$common_platform_type = lang('common_platform_type');
$common_is_enable_tips = lang('common_is_enable_tips');
$common_app_event_type = lang('common_app_event_type');
$images_host = config('images_host');
$images_host = config('shopxo.images_host');
foreach($data as &$v)
{
// 是否启用
......@@ -328,7 +328,7 @@ class AppNavService
$data = Db::name('AppHomeNav')->field('id,name,images_url,event_value,event_type,bg_color')->where(['platform'=>APPLICATION_CLIENT_TYPE, 'is_enable'=>1])->order('sort asc')->select();
if(!empty($data))
{
$images_host = config('images_host');
$images_host = config('shopxo.images_host');
foreach($data as &$v)
{
$v['images_url_old'] = $v['images_url'];
......
......@@ -35,7 +35,7 @@ class BannerService
$banner = Db::name('Slide')->field('name,images_url,event_value,event_type,bg_color')->where(['platform'=>APPLICATION_CLIENT_TYPE, 'is_enable'=>1])->order('sort asc')->select();
if(!empty($banner))
{
$images_host = config('images_host');
$images_host = config('shopxo.images_host');
foreach($banner as &$v)
{
$v['images_url_old'] = $v['images_url'];
......
......@@ -45,7 +45,7 @@ class BrandService
if(!empty($data))
{
$common_is_enable_tips = lang('common_is_enable_tips');
$images_host = config('images_host');
$images_host = config('shopxo.images_host');
foreach($data as &$v)
{
// 是否启用
......@@ -185,7 +185,7 @@ class BrandService
$brand = Db::name('Brand')->where($brand_where)->field('id,name,logo,website_url')->select();
if(!empty($brand))
{
$images_host = config('images_host');
$images_host = config('shopxo.images_host');
foreach($brand as &$v)
{
$v['logo_old'] = $v['logo'];
......
......@@ -173,7 +173,7 @@ class BuyService
// 数据处理
if(!empty($data))
{
$images_host = config('images_host');
$images_host = config('shopxo.images_host');
foreach($data as &$v)
{
// 规格
......
......@@ -116,7 +116,7 @@ class ConfigService
*/
public static function ConfigInit($status = 0)
{
$key = config('cache_common_my_config_key');
$key = config('shopxo.cache_common_my_config_key');
$data = cache($key);
if($status == 1 || empty($data))
{
......
......@@ -55,7 +55,7 @@ class ExpressService
$data = Db::name('Express')->where($where)->field('id,icon,name,sort,is_enable')->order('sort asc')->select();
if(!empty($data) && is_array($data))
{
$images_host = config('images_host');
$images_host = config('shopxo.images_host');
foreach($data as &$v)
{
$v['icon_old'] = $v['icon'];
......@@ -83,7 +83,7 @@ class ExpressService
$data = Db::name('Express')->field($field)->where(['pid'=>$id])->order('sort asc')->select();
if(!empty($data))
{
$images_host = config('images_host');
$images_host = config('shopxo.images_host');
foreach($data as &$v)
{
$v['is_son'] = (Db::name('Express')->where(['pid'=>$v['id']])->count() > 0) ? 'ok' : 'no';
......
......@@ -115,7 +115,7 @@ class GoodsService
{
if(!empty($data) && is_array($data))
{
$images_host = config('images_host');
$images_host = config('shopxo.images_host');
foreach($data as &$v)
{
if(is_array($v))
......@@ -245,7 +245,7 @@ class GoodsService
$is_category = (isset($params['is_category']) && $params['is_category'] == true) ? true : false;
// 开始处理数据
$images_host = config('images_host');
$images_host = config('shopxo.images_host');
foreach($data as &$v)
{
// 商品url地址
......@@ -350,7 +350,7 @@ class GoodsService
$data = Db::name('GoodsContentApp')->where(['goods_id'=>$params['goods_id']])->field('id,images,content')->order('sort asc')->select();
if(!empty($data))
{
$images_host = config('images_host');
$images_host = config('shopxo.images_host');
foreach($data as &$v)
{
$v['images_old'] = $v['images'];
......@@ -381,7 +381,7 @@ class GoodsService
if(!empty($choose))
{
// 数据处理
$images_host = config('images_host');
$images_host = config('shopxo.images_host');
foreach($choose as &$temp_type)
{
$temp_type_value = json_decode($temp_type['value'], true);
......@@ -582,7 +582,7 @@ class GoodsService
$data = Db::name('GoodsFavor')->alias('f')->join(['__GOODS__'=>'g'], 'g.id=f.goods_id')->field($field)->where($where)->limit($m, $n)->order($order_by)->select();
if(!empty($data))
{
$images_host = config('images_host');
$images_host = config('shopxo.images_host');
foreach($data as &$v)
{
// 图片
......@@ -729,7 +729,7 @@ class GoodsService
$data = Db::name('GoodsBrowse')->alias('b')->join(['__GOODS__'=>'g'], 'g.id=b.goods_id')->field($field)->where($where)->limit($m, $n)->order($order_by)->select();
if(!empty($data))
{
$images_host = config('images_host');
$images_host = config('shopxo.images_host');
foreach($data as &$v)
{
$v['images_old'] = $v['images'];
......@@ -1566,7 +1566,7 @@ class GoodsService
if(!empty($type))
{
// 数据处理
$images_host = config('images_host');
$images_host = config('shopxo.images_host');
foreach($type as &$temp_type)
{
$temp_type_value = json_decode($temp_type['value'], true);
......@@ -1838,7 +1838,7 @@ class GoodsService
$data = Db::name('GoodsCategory')->field($field)->where(['pid'=>$id])->order('sort asc')->select();
if(!empty($data))
{
$images_host = config('images_host');
$images_host = config('shopxo.images_host');
foreach($data as &$v)
{
$v['is_son'] = (Db::name('GoodsCategory')->where(['pid'=>$v['id']])->count() > 0) ? 'ok' : 'no';
......
......@@ -33,8 +33,8 @@ class NavigationService
public static function Home($params = [])
{
// 读取缓存数据
$header = cache(config('cache_common_home_nav_header_key'));
$footer = cache(config('cache_common_home_nav_footer_key'));
$header = cache(config('shopxo.cache_common_home_nav_header_key'));
$footer = cache(config('shopxo.cache_common_home_nav_footer_key'));
// 导航模型
$m = Db::name('Navigation');
......@@ -51,14 +51,14 @@ class NavigationService
$header[$k]['item'] = self::NavDataDealWith($m->field($field)->where(array('nav_type'=>'header', 'is_show'=>1, 'pid'=>$v['id']))->order('sort')->select());
}
}
cache(config('cache_common_home_nav_header_key'), $header);
cache(config('shopxo.cache_common_home_nav_header_key'), $header);
}
// 底部导航
if(empty($footer))
{
$footer = self::NavDataDealWith($m->field($field)->where(array('nav_type'=>'footer', 'is_show'=>1))->order('sort')->select());
cache(config('cache_common_home_nav_footer_key'), $footer);
cache(config('shopxo.cache_common_home_nav_footer_key'), $footer);
}
return [
......@@ -315,7 +315,7 @@ class NavigationService
break;
}
// 只截取16个字符
$params['name'] = mb_substr($temp_name, 0, 16, config('default_charset'));
$params['name'] = mb_substr($temp_name, 0, 16, config('shopxo.default_charset'));
}
// 清除缓存
......@@ -396,8 +396,8 @@ class NavigationService
Db::commit();
// 清除缓存
cache(config('cache_common_home_nav_header_key'), null);
cache(config('cache_common_home_nav_footer_key'), null);
cache(config('shopxo.cache_common_home_nav_header_key'), null);
cache(config('shopxo.cache_common_home_nav_footer_key'), null);
return DataReturn('删除成功');
}
......@@ -442,8 +442,8 @@ class NavigationService
if(Db::name('Navigation')->where(['id'=>intval($params['id'])])->update(['is_show'=>intval($params['state'])]))
{
// 清除缓存
cache(config('cache_common_home_nav_header_key'), null);
cache(config('cache_common_home_nav_footer_key'), null);
cache(config('shopxo.cache_common_home_nav_header_key'), null);
cache(config('shopxo.cache_common_home_nav_footer_key'), null);
return DataReturn('编辑成功');
}
......
......@@ -126,7 +126,7 @@ class OrderService
// 支付信息返回
$ret['data'] = [
// 是否为线下支付类型
'is_under_line' => in_array($payment[0]['payment'], config('under_line_list')) ? 1 : 0,
'is_under_line' => in_array($payment[0]['payment'], config('shopxo.under_line_list')) ? 1 : 0,
// 支付模块处理数据
'data' => $ret['data'],
......@@ -213,7 +213,7 @@ class OrderService
{
if(!empty($params['order']) && !empty($params['payment']) && !empty($params['user']))
{
if(in_array($params['payment']['payment'], config('under_line_list')))
if(in_array($params['payment']['payment'], config('shopxo.under_line_list')))
{
// 支付处理
$pay_params = [
......@@ -555,7 +555,7 @@ class OrderService
if(!empty($data))
{
$detail_field = 'id,goods_id,title,images,original_price,price,spec,buy_number';
$images_host = config('images_host');
$images_host = config('shopxo.images_host');
$order_status_list = lang('common_order_user_status');
$order_pay_status = lang('common_order_pay_status');
foreach($data as &$v)
......
......@@ -49,7 +49,7 @@ class PaymentService
self::$payment_dir = ROOT.'extend'.DS.'payment'.DS;
// 支付业务类型
self::$payment_business_type_all = config('payment_business_type_all');
self::$payment_business_type_all = config('shopxo.payment_business_type_all');
// 不删除的支付方式
self::$cannot_deleted_list = ['DeliveryPayment', 'CashPayment'];
......@@ -190,7 +190,7 @@ class PaymentService
$data = Db::name('Payment')->where($where)->field('id,logo,name,sort,payment,config,apply_terminal,apply_terminal,element,is_enable,is_open_user')->order('sort asc')->select();
if(!empty($data) && is_array($data))
{
$images_host = config('images_host');
$images_host = config('shopxo.images_host');
foreach($data as &$v)
{
$v['logo_old'] = $v['logo'];
......@@ -719,7 +719,7 @@ php;
@file_put_contents(self::$dir_root_path.'payment_'.$name.'_'.strtolower($payment).'_respond.php', $respond);
// 线下支付不生成异步入口文件
if(!in_array($payment, config('under_line_list')))
if(!in_array($payment, config('shopxo.under_line_list')))
{
@file_put_contents(self::$dir_root_path.'payment_'.$name.'_'.strtolower($payment).'_notify.php', $notify);
}
......@@ -781,7 +781,7 @@ php;
}
// 线下支付不生成异步入口文件
if(!in_array($payment, config('under_line_list')))
if(!in_array($payment, config('shopxo.under_line_list')))
{
if(!file_exists(self::$dir_root_path.'payment_'.strtolower($name).'_'.strtolower($payment).'_notify.php'))
{
......
......@@ -40,7 +40,7 @@ class ScreeningPriceService
$data = Db::name('ScreeningPrice')->field($field)->where(['pid'=>$id])->order('sort asc')->select();
if(!empty($data))
{
$images_host = config('images_host');
$images_host = config('shopxo.images_host');
foreach($data as &$v)
{
$v['is_son'] = (Db::name('ScreeningPrice')->where(['pid'=>$v['id']])->count() > 0) ? 'ok' : 'no';
......
......@@ -44,7 +44,7 @@ class SlideService
$common_platform_type = lang('common_platform_type');
$common_is_enable_tips = lang('common_is_enable_tips');
$common_app_event_type = lang('common_app_event_type');
$images_host = config('images_host');
$images_host = config('shopxo.images_host');
foreach($data as &$v)
{
// 是否启用
......
......@@ -197,7 +197,7 @@ class ThemeService
}
// 开始删除主题
if(\base\FileUtil::UnlinkDir(self::$html_path.$id) && \base\FileUtil::UnlinkDir(self::$static_path.$id))
if(\base\FileUtil::UnlinkDir(ROOT.self::$html_path.$id) && \base\FileUtil::UnlinkDir(ROOT.self::$static_path.$id))
{
return DataReturn('删除成功');
}
......
......@@ -54,10 +54,10 @@ class UserService
{
if(substr($v['avatar'], 0, 4) != 'http')
{
$v['avatar'] = config('images_host').$v['avatar'];
$v['avatar'] = config('shopxo.images_host').$v['avatar'];
}
} else {
$v['avatar'] = config('images_host').'/static/index/'.strtolower(MyC('common_default_theme', 'default', true)).'/images/default-user-avatar.jpg';
$v['avatar'] = config('shopxo.images_host').'/static/index/'.strtolower(MyC('common_default_theme', 'default', true)).'/images/default-user-avatar.jpg';
}
// 注册时间
......@@ -658,10 +658,10 @@ class UserService
{
if(substr($user['avatar'], 0, 4) != 'http')
{
$user['avatar'] = config('images_host').$user['avatar'];
$user['avatar'] = config('shopxo.images_host').$user['avatar'];
}
} else {
$user['avatar'] = config('images_host').'/static/index/'.strtolower(config('DEFAULT_THEME', 'default')).'/images/default-user-avatar.jpg';
$user['avatar'] = config('shopxo.images_host').'/static/index/'.strtolower(config('DEFAULT_THEME', 'default')).'/images/default-user-avatar.jpg';
}
if($is_app == true)
......
......@@ -26,3 +26,4 @@ return [
// 应用结束
'app_end' => [],
];
?>
\ No newline at end of file
......@@ -24,3 +24,4 @@ return [
// 其他更多的模块定义
];
?>
\ No newline at end of file
+=========================================================+
ShopXO 1.2.0 Release 20181231 http://shopxo.net
+=========================================================+
后台管理功能列表
1、后端框架采用ThinkPHP 5.1重构
2、所有业务处理全部提到服务层
3、优化轮播图片
4、商品规格支持多规格、库存、重量、图片
5、商品规格支持无限级
6、所有附件统一管理、上传、使用、删除
7、安装程序重构
前端功能列表
1、购物流程优化、商品支持多规格+图片
2、优化部分BUG
3、模板错误修复
其它
v1.2版本不再支持支付宝生活号管理(需要使用此功能的小伙伴请使用v1.1.0版本)
+=========================================================+
ShopXO 1.1.0 Release 20181128 http://shopxo.net
+=========================================================+
后台管理功能列表
1、优化轮播图片与手机端分离
2、新增问答/留言
3、新增手机端管理
4、新增支付宝小程序(轮播、首页导航)
5、调整平台类别
6、新增支付宝小程序支付插件
7、优化部分BUG
前端功能列表
1、购物流程优化(去掉用户选择快递)
2、优化部分BUG
手机端
1、新增支付宝小程序
2、支持后台配置基础信息
3、支持后台生成程序包
+=========================================================+
ShopXO 1.0.0 Release 20181111 http://shopxo.net
+=========================================================+
后台管理功能列表
后台配置
站点配置
> 站点设置
> 短信设置
> 邮箱设置
> SEO设置
权限控制
> 管理员
> 角色管理
> 权限分配
用户管理
> 用户管理
商品管理
> 商品管理
> 商品分类
订单管理
> 订单管理
网站管理
> 导航管理
> 自定义页面
> 友情链接
> 主题管理
品牌管理
> 品牌管理
> 品牌分类
支付宝生活号管理 [ v1.2版本不再支持支付宝生活号管理(需要使用此功能的小伙伴请使用v1.1.0版本) ]
> 生活号管理
> 生活号分类
> 消息管理
> 菜单管理
> 批量上下架
> 用户管理
文章管理
> 文章管理
> 文章分类
资源管理
> 地区管理
> 快递管理
> 首页轮播
> 筛选价格
> 支付方式
工具
> 缓存管理
前端功能列表
首页
所有分类
商品搜索
商品详情
自定义页面
文章
购物车
订单确认页
用户中心
> 聚合内容
交易管理
> 订单管理
> 订单详情
> 评论页
> 我的收藏
资料管理
> 个人资料
> 我的地址
> 安全设置
> 我的消息
> 我的积分
> 我的足迹
> 安全退出
\ No newline at end of file
database.php
\ No newline at end of file
......@@ -142,37 +142,5 @@ return [
'show_error_msg' => false,
// 异常处理handle类 留空使用 \think\exception\Handle
'exception_handle' => '',
// 默认编码
'default_charset' => 'utf-8',
// 缓存key列表
// 公共系统配置信息key
'cache_common_my_config_key' => 'cache_common_my_config_data',
// 前台顶部导航,后端菜单更新则删除缓存
'cache_common_home_nav_header_key' => 'cache_common_home_nav_header_data',
// 前台顶部导航
'cache_common_home_nav_footer_key' => 'cache_common_home_nav_footer_data',
// 频道缓存 array(id => name)
'cache_home_channel_key' => 'cache_home_channel_data',
// 图片host, 数据库图片地址以/Public/...开头
'images_host' => substr(__MY_PUBLIC_URL__, 0, -1),
// 开启U带域名
'url_domain_deploy' => true,
// 支付业务类型,支付插件根据业务类型自动生成支付入口文件
'payment_business_type_all' => [
['name' => 'Order', 'desc' => '订单'],
],
// 线下支付方式
'under_line_list' => ['CashPayment', 'DeliveryPayment'],
];
?>
\ No newline at end of file
......@@ -23,3 +23,4 @@ return [
// 缓存有效期 0表示永久缓存
'expire' => 0,
];
?>
\ No newline at end of file
......@@ -18,3 +18,4 @@ return [
'user' => null,
'auto_path' => env('app_path') . 'command' . DIRECTORY_SEPARATOR,
];
?>
\ No newline at end of file
......@@ -28,3 +28,4 @@ return [
// 是否使用 setcookie
'setcookie' => true,
];
?>
\ No newline at end of file
......@@ -18,7 +18,7 @@ return [
// 服务器地址
'hostname' => '127.0.0.1',
// 数据库名
'database' => 'shopxo_tp5',
'database' => 'shopxo_test',
// 用户名
'username' => 'root',
// 密码
......@@ -58,7 +58,7 @@ return [
// Builder类
'builder' => '',
// Query类
'query' => '\\think\\db\\Query',
'query' => '\think\db\Query',
// 是否需要断线重连
'break_reconnect' => false,
// 断线标识字符串
......
......@@ -28,3 +28,4 @@ return [
// 是否关闭日志写入
'close' => false,
];
?>
\ No newline at end of file
......@@ -16,3 +16,4 @@ return [
// 默认中间件命名空间
'default_namespace' => 'app\\http\\middleware\\',
];
?>
\ No newline at end of file
......@@ -24,3 +24,4 @@ return [
// 是否自动开启 SESSION
'auto_start' => true,
];
?>
\ No newline at end of file
<?php
// +----------------------------------------------------------------------
// | ShopXO 国内领先企业级B2C免费开源电商系统
// +----------------------------------------------------------------------
// | Copyright (c) 2011~2018 http://shopxo.net All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: Devil
// +----------------------------------------------------------------------
// +----------------------------------------------------------------------
// | 应用设置
// +----------------------------------------------------------------------
return [
// 默认编码
'default_charset' => 'utf-8',
// 缓存key列表
// 公共系统配置信息key
'cache_common_my_config_key' => 'cache_common_my_config_data',
// 前台顶部导航,后端菜单更新则删除缓存
'cache_common_home_nav_header_key' => 'cache_common_home_nav_header_data',
// 前台顶部导航
'cache_common_home_nav_footer_key' => 'cache_common_home_nav_footer_data',
// 图片host, 数据库图片地址以/Public/...开头
'images_host' => substr(__MY_PUBLIC_URL__, 0, -1),
// 开启U带域名
'url_domain_deploy' => true,
// 支付业务类型,支付插件根据业务类型自动生成支付入口文件
'payment_business_type_all' => [
['name' => 'Order', 'desc' => '订单'],
],
// 线下支付方式
'under_line_list' => ['CashPayment', 'DeliveryPayment'],
];
?>
\ No newline at end of file
......@@ -16,3 +16,4 @@ return [
// 内置Html Console 支持扩展
'type' => 'Html',
];
?>
\ No newline at end of file
......@@ -99,5 +99,5 @@ class BaiduAuth
curl_close($ch);
return json_decode($reponse, true);
}
}
\ No newline at end of file
}
?>
\ No newline at end of file
......@@ -84,7 +84,7 @@ class Email
$this->obj->IsHTMlang(true);
// 设置编码
$this->obj->CharSet = config('default_charset');
$this->obj->CharSet = 'utf-8';
}
/**
......
......@@ -49,9 +49,9 @@ App({
},
// 请求地址
//request_url: "{{request_url}}",
request_url: "{{request_url}}",
//request_url: "http://test.shopxo.net/",
request_url: 'http://tp5-dev.com/',
//request_url: 'http://tp5-dev.com/',
// 基础信息
application_title: "{{application_title}}",
......
......@@ -78,5 +78,4 @@ if(is_dir(ROOT.'public/install') && !file_exists(ROOT.'public/install/install.lo
exit(header('location:'.$url));
}
}
?>
\ No newline at end of file
<?php
/**
* 订单支付异步入口
*/
// 默认绑定模块
$_GET['s'] = '/api/ordernotify/notify';
// 支付模块标记
define('PAYMENT_TYPE', 'Alipay');
// 引入入口文件
require __DIR__.'/index.php';
?>
\ No newline at end of file
<?php
/**
* 订单支付同步入口
*/
// 默认绑定模块
$_GET['s'] = '/index/order/respond';
// 支付模块标记
define('PAYMENT_TYPE', 'Alipay');
// 引入入口文件
require __DIR__.'/index.php';
?>
\ No newline at end of file
<?php
/**
* 订单支付异步入口
*/
// 默认绑定模块
$_GET['s'] = '/api/ordernotify/notify';
// 支付模块标记
define('PAYMENT_TYPE', 'AlipayMini');
// 引入入口文件
require __DIR__.'/index.php';
?>
\ No newline at end of file
<?php
/**
* 订单支付同步入口
*/
// 默认绑定模块
$_GET['s'] = '/index/order/respond';
// 支付模块标记
define('PAYMENT_TYPE', 'AlipayMini');
// 引入入口文件
require __DIR__.'/index.php';
?>
\ No newline at end of file
<?php
/**
* 订单支付同步入口
*/
// 默认绑定模块
$_GET['s'] = '/index/order/respond';
// 支付模块标记
define('PAYMENT_TYPE', 'CashPayment');
// 引入入口文件
require __DIR__.'/index.php';
?>
\ No newline at end of file
<?php
/**
* 订单支付同步入口
*/
// 默认绑定模块
$_GET['s'] = '/index/order/respond';
// 支付模块标记
define('PAYMENT_TYPE', 'DeliveryPayment');
// 引入入口文件
require __DIR__.'/index.php';
?>
\ No newline at end of file
User-agent: *
Disallow:
Disallow: /index.php?s=/admin*
Disallow: /index.php?s=/install*
Disallow: /index.php?s=/api*
Disallow: /admin*
Disallow: /api*
Disallow: /install*
Disallow: /*respond.php
Disallow: /*notify.php
Disallow: /public*
\ No newline at end of file
......@@ -14,3 +14,4 @@ if (is_file($_SERVER["DOCUMENT_ROOT"] . $_SERVER["SCRIPT_NAME"])) {
} else {
require __DIR__ . "/index.php";
}
?>
\ No newline at end of file
/**
* 列表
*/
.form-keyword { width: 55% !important; display: initial !important; }
.more-submit input { display: none; }
.param-where, .param-date input { display: initial !important; }
@media only screen and (max-width: 641px) {
.param-where { width: 100% !important; margin-left: 0px !important; }
.param-date input { width: 47% !important; }
}
@media only screen and (min-width: 641px) {
.param-where { width: 32% !important; float: left; }
.param-date input { width: 45% !important; }
.param-where:nth-child(1), .param-where:nth-child(4) { margin-left: 0px !important; }
}
@media only screen and (max-width: 321px) {
.view-operation button { margin: 2px 0px; }
}
.data-success { overflow: hidden; }
.data-success img { width: 70px; height: 70px; }
.data-success .base { margin-left: 10px; }
.data-success .base p { margin: 0px; }
.data-success button { margin-left: 50px; }
.user-list { border: 1px solid #eee; padding: 0px 10px 10px 10px; overflow: auto; max-height: 300px; }
.user-list li { list-style-type: none; margin-top: 10px; padding-bottom: 10px; border-bottom: 1px dotted #eee; }
.user-list li button { padding: 2px 3px; margin-left: 10px; }
.user-list li:last-child { padding-bottom: 0px; border-bottom: 0px; }
\ No newline at end of file
$(function()
{
/**
* 优惠券发放搜索用户
*/
$('.search-submit').on('click', function()
{
// ajax请求
$.ajax({
url:$(this).data('url'),
type:'POST',
dataType:"json",
timeout:10000,
data:{"keyword": $('.search-keyword').val()},
success:function(result)
{
if(result.code == 0)
{
$('.data-success').removeClass('none');
$('.data-error-tips').addClass('none');
$('.data-success .base-username').text(result.data.username);
$('.data-success .base-nickname').text(result.data.nickname);
$('.data-success .base-mobile').text(result.data.mobile);
$('.data-success img').attr('src', result.data.avatar);
$('.join-submit').attr('data-id', result.data.id);
} else {
$('.data-success').addClass('none');
$('.data-error-tips').removeClass('none');
$('.data-error-tips').text(result.msg);
Prompt(result.msg);
}
},
error:function()
{
Prompt('网络异常错误');
}
});
});
/**
* 用户加入列表
*/
$('.join-submit').on('click', function()
{
var user_id = $(this).attr('data-id');
var tag = 'user-list-'+user_id;
var username = $('.data-success .base-username').text() || null;
var nickname = $('.data-success .base-nickname').text() || null;
var mobile = $('.data-success .base-mobile').text() || null;
var user = '';
if(username != null)
{
user += username;
}
if(nickname != null)
{
if(username != null || user != '')
{
user += ' - ';
}
user += nickname;
}
if(mobile != null)
{
if(nickname != null || user != '')
{
user += ' - ';
}
user += mobile;
}
var html = '<li class="'+tag+'"><input type="hidden" name="user_id[]" value="'+user_id+'" />';
html += '<span>'+user+'</span>';
html += '<button type="button" class="am-btn am-btn-danger am-radius am-btn-xs fr user-del-submit" data-tag="'+tag+'"><i class="am-icon-trash-o"></i>移除</button>';
html += '</li>';
if($('.user-list .'+tag).length == 0)
{
$('.user-list').removeClass('none');
$('.user-list').append(html);
}
});
/**
* 用户移除
*/
$(document).on('click', '.user-del-submit', function()
{
$('.'+$(this).data('tag')).remove();
if($('.user-list li').length == 0)
{
$('.user-list').addClass('none');
}
});
/**
* 优惠券发送表单验证
*/
$('.form-send-submit').on('click', function()
{
if($('.user-list li').length == 0)
{
Prompt('请先查询用户加入列表');
return false;
}
});
});
\ No newline at end of file
文件模式从 100644 更改为 100755
文件模式从 100644 更改为 100755
User-agent: *
Disallow: /index.php?s=/admin*
Disallow: /index.php?s=/install*
Disallow: /index.php?s=/api*
Disallow: /admin*
Disallow: /api*
Disallow: /install*
Disallow: /*respond.php
Disallow: /*notify.php
Disallow: /public*
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册