提交 584ed8a0 编写于 作者: G gongfuxiang

快递,积分,地区

上级 cf6738ab
...@@ -50,7 +50,7 @@ class Admin extends Common ...@@ -50,7 +50,7 @@ class Admin extends Common
$total = AdminService::AdminTotal($where); $total = AdminService::AdminTotal($where);
// 分页 // 分页
$number = MyC('admin_page_number'); $number = MyC('admin_page_number', 10, true);
$page_params = array( $page_params = array(
'number' => $number, 'number' => $number,
'total' => $total, 'total' => $total,
......
...@@ -51,7 +51,7 @@ class AlipayLifeMenu extends Common ...@@ -51,7 +51,7 @@ class AlipayLifeMenu extends Common
$where = $this->GetIndexWhere(); $where = $this->GetIndexWhere();
// 分页 // 分页
$number = MyC('admin_page_number'); $number = MyC('admin_page_number', 10, true);
$page_param = array( $page_param = array(
'number' => $number, 'number' => $number,
'total' => $m->where($where)->count(), 'total' => $m->where($where)->count(),
......
...@@ -51,7 +51,7 @@ class AlipayLifeMessage extends Common ...@@ -51,7 +51,7 @@ class AlipayLifeMessage extends Common
$where = $this->GetIndexWhere(); $where = $this->GetIndexWhere();
// 分页 // 分页
$number = MyC('admin_page_number'); $number = MyC('admin_page_number', 10, true);
$page_param = array( $page_param = array(
'number' => $number, 'number' => $number,
'total' => $m->where($where)->count(), 'total' => $m->where($where)->count(),
......
...@@ -51,7 +51,7 @@ class AlipayLifeStatus extends Common ...@@ -51,7 +51,7 @@ class AlipayLifeStatus extends Common
$where = $this->GetIndexWhere(); $where = $this->GetIndexWhere();
// 分页 // 分页
$number = MyC('admin_page_number'); $number = MyC('admin_page_number', 10, true);
$page_param = array( $page_param = array(
'number' => $number, 'number' => $number,
'total' => $m->where($where)->count(), 'total' => $m->where($where)->count(),
......
...@@ -49,7 +49,7 @@ class AlipayLifeUser extends Common ...@@ -49,7 +49,7 @@ class AlipayLifeUser extends Common
$m = db('AlipayLifeUser'); $m = db('AlipayLifeUser');
// 分页 // 分页
$number = MyC('admin_page_number'); $number = MyC('admin_page_number', 10, true);
$page_param = array( $page_param = array(
'number' => $number, 'number' => $number,
'total' => $m->alias('au')->where($where)->join('INNER JOIN __USER__ AS u ON u.id=au.user_id')->count(), 'total' => $m->alias('au')->where($where)->join('INNER JOIN __USER__ AS u ON u.id=au.user_id')->count(),
......
...@@ -49,7 +49,7 @@ class Coupon extends Common ...@@ -49,7 +49,7 @@ class Coupon extends Common
$where = $this->GetIndexWhere(); $where = $this->GetIndexWhere();
// 分页 // 分页
$number = MyC('admin_page_number'); $number = MyC('admin_page_number', 10, true);
$page_param = array( $page_param = array(
'number' => $number, 'number' => $number,
'total' => $m->where($where)->count(), 'total' => $m->where($where)->count(),
...@@ -480,7 +480,7 @@ class Coupon extends Common ...@@ -480,7 +480,7 @@ class Coupon extends Common
$where = $this->GetUserWhere($param); $where = $this->GetUserWhere($param);
// 分页 // 分页
$number = MyC('admin_page_number'); $number = MyC('admin_page_number', 10, true);
$page_param = array( $page_param = array(
'number' => $number, 'number' => $number,
'total' => $m->alias('uc')->join('__USER__ AS u ON u.id=uc.user_id')->where($where)->count(), 'total' => $m->alias('uc')->join('__USER__ AS u ON u.id=uc.user_id')->where($where)->count(),
......
<?php <?php
namespace app\admin\controller; namespace app\admin\controller;
use app\service\ExpressService;
/** /**
* 快递管理 * 快递管理
* @author Devil * @author Devil
...@@ -41,7 +42,11 @@ class Express extends Common ...@@ -41,7 +42,11 @@ class Express extends Common
{ {
// 是否启用 // 是否启用
$this->assign('common_is_enable_list', lang('common_is_enable_list')); $this->assign('common_is_enable_list', lang('common_is_enable_list'));
$this->display('Index');
// 编辑器文件存放地址
$this->assign('editor_path_type', 'express');
return $this->fetch();
} }
/** /**
...@@ -59,23 +64,9 @@ class Express extends Common ...@@ -59,23 +64,9 @@ class Express extends Common
$this->error('非法访问'); $this->error('非法访问');
} }
// 获取数据 // 开始操作
$field = array('id', 'icon', 'name', 'sort', 'is_enable'); $ret = ExpressService::ExpressNodeSon(input());
$data = db('Express')->field($field)->select(); return json($ret);
if(!empty($data))
{
$image_host = config('IMAGE_HOST');
foreach($data as &$v)
{
$v['is_son'] = 'no';
$v['ajax_url'] = url('Admin/Express/GetNodeSon', array('id'=>$v['id']));
$v['delete_url'] = url('Admin/Express/Delete');
$v['icon_url'] = empty($v['icon']) ? '' : $image_host.$v['icon'];
$v['json'] = json_encode($v);
}
}
$msg = empty($data) ? '没有相关数据' : '操作成功';
$this->ajaxReturn($msg, 0, $data);
} }
/** /**
...@@ -93,53 +84,9 @@ class Express extends Common ...@@ -93,53 +84,9 @@ class Express extends Common
$this->error('非法访问'); $this->error('非法访问');
} }
// 图片 // 开始操作
$this->FileSave('icon', 'file_icon', 'express'); $ret = ExpressService::ExpressSave(input());
return json($ret);
// id为空则表示是新增
$m = D('Express');
// 公共额外数据处理
$m->sort = intval(I('sort'));
// 添加
if(empty($_POST['id']))
{
if($m->create($_POST, 1))
{
// 额外数据处理
$m->add_time = time();
$m->name = I('name');
// 写入数据库
if($m->add())
{
$this->ajaxReturn('新增成功');
} else {
$this->ajaxReturn('新增失败', -100);
}
}
} else {
// 编辑
if($m->create($_POST, 2))
{
// 额外数据处理
$m->name = I('name');
$m->upd_time = time();
// 移除 id
unset($m->id);
// 更新数据库
if($m->where(array('id'=>I('id')))->save())
{
$this->ajaxReturn('编辑成功');
} else {
$this->ajaxReturn('编辑失败或数据未改变', -100);
}
}
}
$this->ajaxReturn($m->getError(), -1);
} }
/** /**
...@@ -151,26 +98,17 @@ class Express extends Common ...@@ -151,26 +98,17 @@ class Express extends Common
*/ */
public function Delete() public function Delete()
{ {
// 是否ajax
if(!IS_AJAX) if(!IS_AJAX)
{ {
$this->error('非法访问'); return $this->error('非法访问');
} }
$m = D('Express'); // 开始操作
if($m->create($_POST, 5)) $params = input('post.');
{ $params['admin'] = $this->admin;
$id = I('id'); $ret = ExpressService::ExpressDelete($params);
return json($ret);
// 删除
if($m->delete($id))
{
$this->ajaxReturn('删除成功');
} else {
$this->ajaxReturn('删除失败或资源不存在', -100);
}
} else {
$this->ajaxReturn($m->getError(), -1);
}
} }
} }
?> ?>
\ No newline at end of file
...@@ -53,7 +53,7 @@ class Goods extends Common ...@@ -53,7 +53,7 @@ class Goods extends Common
$total = GoodsService::GoodsTotal($where); $total = GoodsService::GoodsTotal($where);
// 分页 // 分页
$number = MyC('admin_page_number'); $number = MyC('admin_page_number', 10, true);
$page_params = array( $page_params = array(
'number' => $number, 'number' => $number,
'total' => $total, 'total' => $total,
......
<?php
namespace app\admin\controller;
use app\service\IntegralService;
/**
* 用户积分日志管理
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2016-12-01T21:51:08+0800
*/
class IntegralLog 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()
{
// 参数
$params = input();
$params['user'] = $this->admin;
$params['user_type'] = 'admin';
// 分页
$number = MyC('admin_page_number', 10, true);
// 条件
$where = IntegralService::AdminIntegralListWhere($params);
// 获取总数
$total = IntegralService::AdminIntegralTotal($where);
// 分页
$page_params = array(
'number' => $number,
'total' => $total,
'where' => $params,
'page' => isset($params['page']) ? intval($params['page']) : 1,
'url' => url('admin/integrallog/index'),
);
$page = new \base\Page($page_params);
$this->assign('page_html', $page->GetPageHtml());
// 获取列表
$data_params = array(
'm' => $page->GetPageStarNumber(),
'n' => $number,
'where' => $where,
);
$data = IntegralService::AdminIntegralList($data_params);
$this->assign('data_list', $data['data']);
// 性别
$this->assign('common_gender_list', lang('common_gender_list'));
// 操作类型
$this->assign('common_integral_log_type_list', lang('common_integral_log_type_list'));
// 参数
$this->assign('params', $params);
return $this->fetch();
}
}
?>
\ No newline at end of file
...@@ -45,9 +45,6 @@ class Message extends Common ...@@ -45,9 +45,6 @@ class Message extends Common
$params['user'] = $this->admin; $params['user'] = $this->admin;
$params['user_type'] = 'admin'; $params['user_type'] = 'admin';
// 消息更新未已读
MessageService::MessageRead($params);
// 分页 // 分页
$number = MyC('admin_page_number', 10, true); $number = MyC('admin_page_number', 10, true);
......
<?php <?php
namespace app\admin\controller; namespace app\admin\controller;
use app\service\RegionService;
/** /**
* 地区管理 * 地区管理
* @author Devil * @author Devil
...@@ -41,7 +42,8 @@ class Region extends Common ...@@ -41,7 +42,8 @@ class Region extends Common
{ {
// 是否启用 // 是否启用
$this->assign('common_is_enable_list', lang('common_is_enable_list')); $this->assign('common_is_enable_list', lang('common_is_enable_list'));
$this->display('Index');
return $this->fetch();
} }
/** /**
...@@ -59,39 +61,9 @@ class Region extends Common ...@@ -59,39 +61,9 @@ class Region extends Common
$this->error('非法访问'); $this->error('非法访问');
} }
// 获取数据 // 开始操作
$field = array('id', 'pid', 'name', 'sort', 'is_enable'); $ret = RegionService::RegionNodeSon(input());
$data = db('Region')->field($field)->where(array('pid'=>intval(I('id', 0))))->select(); return json($ret);
if(!empty($data))
{
foreach($data as $k=>$v)
{
$data[$k]['is_son'] = $this->IsExistSon($v['id']);
$data[$k]['ajax_url'] = url('Admin/Region/GetNodeSon', array('id'=>$v['id']));
$data[$k]['delete_url'] = url('Admin/Region/Delete');
$data[$k]['json'] = json_encode($v);
}
}
$msg = empty($data) ? '没有相关数据' : '操作成功';
$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 (db('Region')->where(array('pid'=>$id))->count() > 0) ? 'ok' : 'no';
}
return 'no';
} }
/** /**
...@@ -109,50 +81,9 @@ class Region extends Common ...@@ -109,50 +81,9 @@ class Region extends Common
$this->error('非法访问'); $this->error('非法访问');
} }
// id为空则表示是新增 // 开始操作
$m = D('Region'); $ret = RegionService::RegionSave(input());
return json($ret);
// 公共额外数据处理
$m->sort = intval(I('sort'));
// 添加
if(empty($_POST['id']))
{
if($m->create($_POST, 1))
{
// 额外数据处理
$m->add_time = time();
$m->name = I('name');
// 写入数据库
if($m->add())
{
$this->ajaxReturn('新增成功');
} else {
$this->ajaxReturn('新增失败', -100);
}
}
} else {
// 编辑
if($m->create($_POST, 2))
{
// 额外数据处理
$m->name = I('name');
$m->upd_time = time();
// 移除 id
unset($m->id, $m->pid);
// 更新数据库
if($m->where(array('id'=>I('id')))->save())
{
$this->ajaxReturn('编辑成功');
} else {
$this->ajaxReturn('编辑失败或数据未改变', -100);
}
}
}
$this->ajaxReturn($m->getError(), -1);
} }
/** /**
...@@ -164,23 +95,17 @@ class Region extends Common ...@@ -164,23 +95,17 @@ class Region extends Common
*/ */
public function Delete() public function Delete()
{ {
// 是否ajax
if(!IS_AJAX) if(!IS_AJAX)
{ {
$this->error('非法访问'); return $this->error('非法访问');
} }
$m = D('Region'); // 开始操作
if($m->create($_POST, 5)) $params = input('post.');
{ $params['admin'] = $this->admin;
if($m->delete(I('id'))) $ret = RegionService::RegionDelete($params);
{ return json($ret);
$this->ajaxReturn('删除成功');
} else {
$this->ajaxReturn('删除失败或资源不存在', -100);
}
} else {
$this->ajaxReturn($m->getError(), -1);
}
} }
} }
?> ?>
\ No newline at end of file
...@@ -51,7 +51,7 @@ class User extends Common ...@@ -51,7 +51,7 @@ class User extends Common
$total = UserService::UserTotal($where); $total = UserService::UserTotal($where);
// 分页 // 分页
$number = MyC('admin_page_number'); $number = MyC('admin_page_number', 10, true);
$page_params = array( $page_params = array(
'number' => $number, 'number' => $number,
'total' => $total, 'total' => $total,
......
<?php
namespace app\admin\controller;
/**
* 用户积分日志管理
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2016-12-01T21:51:08+0800
*/
class UserIntegralLog 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);
// 条件
$where = $this->GetIndexWhere();
// 模型
$m = db('UserIntegralLog');
// 分页
$number = MyC('admin_page_number');
$page_param = array(
'number' => $number,
'total' => $m->alias('ui')->join('__USER__ AS u ON u.id=ui.user_id')->where($where)->count(),
'where' => $param,
'url' => url('Admin/UserIntegralLog/Index'),
);
$page = new \base\Page($page_param);
// 获取列表
$field = 'ui.*,u.username,u.nickname,u.mobile,u.gender';
$list = $this->SetDataHandle($m->alias('ui')->join('__USER__ AS u ON u.id=ui.user_id')->field($field)->where($where)->limit($page->GetPageStarNumber(), $number)->order('ui.id desc')->select());
// 性别
$this->assign('common_gender_list', lang('common_gender_list'));
// 操作类型
$this->assign('common_integral_log_type_list', lang('common_integral_log_type_list'));
// 参数
$this->assign('param', $param);
// 分页
$this->assign('page_html', $page->GetPageHtml());
// 数据列表
$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_gender_list = lang('common_gender_list');
$common_integral_log_type_list = lang('common_integral_log_type_list');
foreach($data as &$v)
{
// 操作类型
$v['type_text'] = $common_integral_log_type_list[$v['type']]['name'];
// 性别
$v['gender_text'] = $common_gender_list[$v['gender']]['name'];
// 添加时间
$v['add_time'] = date('Y-m-d H:i:s', $v['add_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']))
{
$like_keyword = array('like', '%'.I('keyword').'%');
$where[] = array(
'u.username' => $like_keyword,
'u.nickname' => $like_keyword,
'u.mobile' => $like_keyword,
'ui.msg' => $like_keyword,
'_logic' => 'or',
);
}
// 是否更多条件
if(I('is_more', 0) == 1)
{
// 等值
if(I('type', -1) > -1)
{
$where['ui.type'] = intval(I('type', 0));
}
if(I('gender', -1) > -1)
{
$where['u.gender'] = intval(I('gender', 0));
}
// 表达式
if(!empty($_REQUEST['time_start']))
{
$where['ui.add_time'][] = array('gt', strtotime(I('time_start')));
}
if(!empty($_REQUEST['time_end']))
{
$where['ui.add_time'][] = array('lt', strtotime(I('time_end')));
}
}
return $where;
}
}
?>
\ No newline at end of file
...@@ -18,16 +18,17 @@ ...@@ -18,16 +18,17 @@
</div> </div>
<div class="am-popup-bd"> <div class="am-popup-bd">
<!-- form start --> <!-- form start -->
<form class="am-form form-validation admin-save" action="{{:url('Admin/Express/Save')}}" method="POST" request-type="ajax-reload" request-value=""> <form class="am-form form-validation admin-save" action="{{:url('admin/express/save')}}" method="POST" request-type="ajax-reload" request-value="">
<div class="am-form-group am-form-file"> <div class="am-form-group am-form-file">
<label class="block">icon图标</label> <label class="block">icon图标</label>
<button type="button" class="am-btn am-btn-default am-btn-sm am-radius"> <ul class="plug-file-upload-view express-icon-images-view" data-form-name="icon" data-max-number="1" data-dialog-type="images">
<i class="am-icon-cloud-upload"></i> 选择图片</button> <li>
<input type="text" name="icon" class="am-radius js-choice-one original-images-url original-icon-images-url" data-choice-one-to='input[name="file_icon"]' <notempty name="data"> value="{{$data.images_url}}"{{/if}}" data-validation-message="请选择需要上传的图片" readonly="readonly" /> <input type="hidden" name="icon" value="" />
<i class="am-icon-trash-o am-icon-sm original-images-url-delete" data-input-tag="input.original-icon-images-url" data-image-tag="#form-img-icon" data-tips-tag="#form-icon-tips" data-file-tag="input.file_icon-tag"></i> <img src="{{$image_host}}/static/admin/default/images/default-images.png" />
<input type="file" name="file_icon" multiple data-validation-message="请选择需要上传的图片" accept="image/gif,image/jpeg,image/jpg,image/png" class="js-choice-one images-file-event file_icon-tag" data-choice-one-to=".original-icon-images-url" data-tips-tag="#form-icon-tips" data-image-tag="#form-img-icon" /> <i>×</i>
<div id="form-icon-tips" class="m-t-5)}}</div> </li>
<img src="{{$image_host}}/Public/Admin/Default/Images/default-images.png" id="form-img-icon" class="block m-t-5 am-img-thumbnail am-radius" width="50" height="50" data-default="{{$image_host}}/Public/Admin/Default/Images/default-images.png" /> </ul>
<div class="plug-file-upload-submit" data-view-tag="ul.express-icon-images-view">+上传图片</div>
</div> </div>
<div class="am-form-group"> <div class="am-form-group">
<label>名称</label> <label>名称</label>
...@@ -37,7 +38,7 @@ ...@@ -37,7 +38,7 @@
<label>顺序</label> <label>顺序</label>
<input type="number" placeholder="顺序" name="sort" min="0" max="255" data-validation-message="顺序 0~255 之间的数值" class="am-radius" value="0" required /> <input type="number" placeholder="顺序" name="sort" min="0" max="255" data-validation-message="顺序 0~255 之间的数值" class="am-radius" value="0" required />
</div> </div>
<include file="Lib/Enable" /> {{include file="lib/enable" /}}
<div class="am-form-group"> <div class="am-form-group">
<input type="hidden" name="id" /> <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:'处理中...'}">保存</button> <button type="submit" class="am-btn am-btn-primary am-radius btn-loading-example am-btn-sm w100" data-am-loading="{loadingText:'处理中...'}">保存</button>
...@@ -50,9 +51,9 @@ ...@@ -50,9 +51,9 @@
<!-- save win end --> <!-- save win end -->
<!-- list start --> <!-- list start -->
<div id="tree" class="m-t-15" data-additional='[{"field":"file_icon", "value":"", "type":"file", "tag":"input.file_icon-tag"}, {"field":"icon", "value":"", "type":"input"}, {"field":"icon_url", "value":"{{$image_host}}/Public/Admin/Default/Images/default-images.png", "type":"attr", "tag":"#form-img-icon", "style":"src"}, {"value":"", "type":"html", "tag":"#form-icon-tips"}]'> <div id="tree" class="m-t-15" data-additional='[{"field":"icon", "value":"", "type":"input"}, {"field":"icon_url", "value":"{{$image_host}}/static/admin/default/images/default-images.png", "type":"attr", "tag":"ul.express-icon-images-view li img", "style":"src"}]'>
<div class="m-t-30 t-c"> <div class="m-t-30 t-c">
<img src="__PUBLIC__/Common/Images/loading.gif" /> <img src="{{$image_host}}/static/common/images/loading.gif" />
<p>处理中...</p> <p>处理中...</p>
</div> </div>
</div> </div>
...@@ -65,5 +66,5 @@ ...@@ -65,5 +66,5 @@
{{include file="public/footer" /}} {{include file="public/footer" /}}
<!-- footer end --> <!-- footer end -->
<script> <script>
Tree(0, "{{:url('Admin/Express/GetNodeSon')}}", 0); Tree(0, "{{:url('admin/express/getnodeson')}}", 0);
</script> </script>
\ No newline at end of file
...@@ -4,33 +4,33 @@ ...@@ -4,33 +4,33 @@
<div class="content-right"> <div class="content-right">
<div class="content"> <div class="content">
<!-- form start --> <!-- form start -->
<form class="am-form view-list" action="{{:url('Admin/UserIntegralLog/Index')}}" method="POST"> <form class="am-form view-list" action="{{:url('admin/integrallog/index')}}" method="POST">
<div class="am-g"> <div class="am-g">
<input type="text" class="am-radius form-keyword" placeholder="姓名/手机/昵称/原因" name="keyword" <present name="param['keyword']"> value="{{$param.keyword}}"{{/if}} /> <input type="text" autocomplete="off" class="am-radius form-keyword" placeholder="姓名/手机/昵称/原因" name="keywords" {{if !empty($params['keywords'])}} value="{{$params.keywords}}"{{/if}} />
<button type="submit" class="am-btn am-btn-secondary am-btn-sm am-radius form-submit">查询</button> <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"> <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}} /> <input type="checkbox" name="is_more" value="1" id="is_more" {{if isset($params['is_more']) and $params['is_more'] eq 1}}checked{{/if}} />
<i class="am-icon-angle-down"></i> <i class="am-icon-angle-down"></i>
</label> </label>
<div class="more-where {{if !isset($param['is_more']) or $param['is_more'] neq 1)}}none{{/if}}"> <div class="more-where {{if !isset($params['is_more']) or $params['is_more'] neq 1}}none{{/if}}">
<select name="gender" class="am-radius c-p m-t-10 m-l-5 param-where"> <select name="gender" class="am-radius c-p m-t-10 m-l-5 param-where">
<option value="-1)}}性别</option> <option value="-1">性别</option>
<foreach name="common_gender_list" item="v"> {{foreach $common_gender_list as $v}}
<option value="{{$v.id}}" {{if isset($param['gender']) and $param['gender'] eq $v['id']">selected{{/if}}>{{$v.name}}</option> <option value="{{$v.id}}" {{if isset($params['gender']) and $params['gender'] eq $v['id']}}selected{{/if}}>{{$v.name}}</option>
{{/foreach}} {{/foreach}}
</select> </select>
<select name="type" class="am-radius c-p m-t-10 m-l-5 param-where"> <select name="type" class="am-radius c-p m-t-10 m-l-5 param-where">
<option value="-1)}}操作类型</option> <option value="-1">操作类型</option>
<foreach name="common_integral_log_type_list" item="v"> {{foreach $common_integral_log_type_list as $v}}
<option value="{{$v.id}}" {{if isset($param['type']) and $param['type'] eq $v['id']">selected{{/if}}>{{$v.name}}</option> <option value="{{$v.id}}" {{if isset($params['type']) and $params['type'] eq $v['id']}}selected{{/if}}>{{$v.name}}</option>
{{/foreach}} {{/foreach}}
</select> </select>
<div class="param-date param-where m-l-5)}} <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}}/> <input type="text" autocomplete="off" name="time_start" class="Wdate am-radius m-t-10" placeholder="起始时间" onclick="WdatePicker({firstDayOfWeek:1,dateFmt:'yyyy-MM-dd HH:mm:ss'})" {{if isset($params['time_start'])}}value="{{$params.time_start}}"{{/if}}/>
<span>~</span> <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}}/> <input type="text" autocomplete="off" class="Wdate am-radius m-t-10" placeholder="结束时间" name="time_end" onclick="WdatePicker({firstDayOfWeek:1,dateFmt:'yyyy-MM-dd HH:mm:ss'})" {{if isset($params['time_end'])}}value="{{$params.time_end}}"{{/if}}/>
</div> </div>
</div> </div>
</div> </div>
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
<!-- form end --> <!-- form end -->
<!-- list start --> <!-- list start -->
<table class="am-table am-table-striped am-table-hover am-text-middle m-t-10 m-l-5)}} <table class="am-table am-table-striped am-table-hover am-text-middle m-t-10 m-l-5">
<thead> <thead>
<tr> <tr>
<th>用户信息</th> <th>用户信息</th>
...@@ -50,8 +50,8 @@ ...@@ -50,8 +50,8 @@
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
{{if !empty($list)}} {{if !empty($data_list)}}
<foreach name="list" item="v"> {{foreach $data_list as $v}}
<tr id="data-list-{{$v.id}}"> <tr id="data-list-{{$v.id}}">
<td> <td>
{{if !empty($v['username'])}} {{if !empty($v['username'])}}
...@@ -75,7 +75,7 @@ ...@@ -75,7 +75,7 @@
{{if empty($v['msg'])}}<span class="cr-ddd">未填写</span>{{else /}}{{$v.msg}}{{/if}} {{if empty($v['msg'])}}<span class="cr-ddd">未填写</span>{{else /}}{{$v.msg}}{{/if}}
</td> </td>
<td class="am-hide-sm-only"> <td class="am-hide-sm-only">
{{if empty($v['add_time'])}}<span class="cr-ddd">未设置</span>{{else /}}{{$v.add_time}}{{/if}} {{if empty($v['add_time_time'])}}<span class="cr-ddd">未设置</span>{{else /}}{{$v.add_time_time}}{{/if}}
</td> </td>
</tr> </tr>
{{/foreach}} {{/foreach}}
...@@ -87,8 +87,8 @@ ...@@ -87,8 +87,8 @@
<!-- list end --> <!-- list end -->
<!-- page start --> <!-- page start -->
{{if !empty($list)}} {{if !empty($data_list)}}
{{$page_html}} {{$page_html|raw}}
{{/if}} {{/if}}
<!-- page end --> <!-- page end -->
</div> </div>
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
</div> </div>
<div class="am-popup-bd"> <div class="am-popup-bd">
<!-- form start --> <!-- form start -->
<form class="am-form form-validation admin-save" action="{{:url('Admin/Region/Save')}}" method="POST" request-type="ajax-reload" request-value=""> <form class="am-form form-validation admin-save" action="{{:url('admin/region/save')}}" method="POST" request-type="ajax-reload" request-value="">
<div class="am-form-group"> <div class="am-form-group">
<label>名称</label> <label>名称</label>
<input type="text" placeholder="名称" name="name" minlength="2" maxlength="16" data-validation-message="名称格式 2~16 个字符" class="am-radius" required /> <input type="text" placeholder="名称" name="name" minlength="2" maxlength="16" data-validation-message="名称格式 2~16 个字符" class="am-radius" required />
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
<label>顺序</label> <label>顺序</label>
<input type="number" placeholder="顺序" name="sort" min="0" max="255" data-validation-message="顺序 0~255 之间的数值" class="am-radius" value="0" required /> <input type="number" placeholder="顺序" name="sort" min="0" max="255" data-validation-message="顺序 0~255 之间的数值" class="am-radius" value="0" required />
</div> </div>
<include file="Lib/Enable" /> {{include file="lib/enable" /}}
<div class="am-form-group"> <div class="am-form-group">
<input type="hidden" name="id" /> <input type="hidden" name="id" />
<input type="hidden" name="pid" value="0" /> <input type="hidden" name="pid" value="0" />
...@@ -41,9 +41,9 @@ ...@@ -41,9 +41,9 @@
<!-- save win end --> <!-- save win end -->
<!-- list start --> <!-- list start -->
<div id="tree" class="m-t-15)}} <div id="tree" class="m-t-15">
<div class="m-t-30 t-c"> <div class="m-t-30 t-c">
<img src="__PUBLIC__/Common/Images/loading.gif" /> <img src="{{$image_host}}/static/common/images/loading.gif" />
<p>处理中...</p> <p>处理中...</p>
</div> </div>
</div> </div>
...@@ -56,5 +56,5 @@ ...@@ -56,5 +56,5 @@
{{include file="public/footer" /}} {{include file="public/footer" /}}
<!-- footer end --> <!-- footer end -->
<script> <script>
Tree(0, "{{:url('Admin/Region/GetNodeSon')}}", 0, 1); Tree(0, "{{:url('admin/region/getnodeson')}}", 0, 1);
</script> </script>
\ No newline at end of file
...@@ -489,7 +489,7 @@ class ArticleService ...@@ -489,7 +489,7 @@ class ArticleService
{ {
return DataReturn('删除成功', 0); return DataReturn('删除成功', 0);
} }
return DataReturn('删除失败', 0); return DataReturn('删除失败', -100);
} }
} }
?> ?>
\ No newline at end of file
...@@ -484,7 +484,7 @@ class BrandService ...@@ -484,7 +484,7 @@ class BrandService
{ {
return DataReturn('删除成功', 0); return DataReturn('删除成功', 0);
} }
return DataReturn('删除失败', 0); return DataReturn('删除失败', -100);
} }
} }
?> ?>
\ No newline at end of file
...@@ -54,5 +54,135 @@ class ExpressService ...@@ -54,5 +54,135 @@ class ExpressService
} }
return $data; return $data;
} }
/**
* 获取快递节点数据
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @datetime 2018-12-16T23:54:46+0800
* @param [array] $params [输入参数]
*/
public static function ExpressNodeSon($params = [])
{
// id
$id = isset($params['id']) ? intval($params['id']) : 0;
// 获取数据
$field = 'id,pid,icon,name,sort,is_enable';
$data = Db::name('Express')->field($field)->where(['pid'=>$id])->order('sort asc')->select();
if(!empty($data))
{
$image_host = config('IMAGE_HOST');
foreach($data as &$v)
{
$v['is_son'] = (Db::name('Express')->where(['pid'=>$v['id']])->count() > 0) ? 'ok' : 'no';
$v['ajax_url'] = url('admin/express/getnodeson', array('id'=>$v['id']));
$v['delete_url'] = url('admin/express/delete');
$v['icon_url'] = empty($v['icon']) ? '' : $image_host.$v['icon'];
$v['json'] = json_encode($v);
}
return DataReturn('操作成功', 0, $data);
}
return DataReturn('没有相关数据', -100);
}
/**
* 快递保存
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @datetime 2018-12-17T01:04:03+0800
* @param [array] $params [输入参数]
*/
public static function ExpressSave($params = [])
{
// 请求参数
$p = [
[
'checked_type' => 'length',
'key_name' => 'name',
'checked_data' => '2,16',
'error_msg' => '名称格式 2~16 个字符',
],
];
$ret = params_checked($params, $p);
if($ret !== true)
{
return DataReturn($ret, -1);
}
// 其它附件
$data_fields = ['icon'];
$attachment = ResourcesService::AttachmentParams($params, $data_fields);
if($attachment['code'] != 0)
{
return $attachment;
}
// 数据
$data = [
'name' => $params['name'],
'pid' => isset($params['pid']) ? intval($params['pid']) : 0,
'sort' => isset($params['sort']) ? intval($params['sort']) : 0,
'is_enable' => isset($params['is_enable']) ? intval($params['is_enable']) : 0,
'icon' => $attachment['data']['icon'],
];
// 添加
if(empty($params['id']))
{
$data['add_time'] = time();
if(Db::name('Express')->insertGetId($data) > 0)
{
return DataReturn('添加成功', 0);
}
return DataReturn('添加失败', -100);
} else {
$data['upd_time'] = time();
if(Db::name('Express')->where(['id'=>intval($params['id'])])->update($data))
{
return DataReturn('编辑成功', 0);
}
return DataReturn('编辑失败', -100);
}
}
/**
* 快递删除
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @datetime 2018-12-17T02:40:29+0800
* @param [array] $params [输入参数]
*/
public static function ExpressDelete($params = [])
{
// 请求参数
$p = [
[
'checked_type' => 'empty',
'key_name' => 'id',
'error_msg' => '删除数据id有误',
],
[
'checked_type' => 'empty',
'key_name' => 'admin',
'error_msg' => '用户信息有误',
],
];
$ret = params_checked($params, $p);
if($ret !== true)
{
return DataReturn($ret, -1);
}
// 开始删除
if(Db::name('Express')->where(['id'=>intval($params['id'])])->delete())
{
return DataReturn('删除成功', 0);
}
return DataReturn('删除失败', -100);
}
} }
?> ?>
\ No newline at end of file
...@@ -1916,7 +1916,7 @@ class GoodsService ...@@ -1916,7 +1916,7 @@ class GoodsService
{ {
return DataReturn('删除成功', 0); return DataReturn('删除成功', 0);
} }
return DataReturn('删除失败', 0); return DataReturn('删除失败', -100);
} }
} }
?> ?>
\ No newline at end of file
...@@ -210,5 +210,103 @@ class IntegralService ...@@ -210,5 +210,103 @@ class IntegralService
} }
return DataReturn('没有需要操作的数据', 0); return DataReturn('没有需要操作的数据', 0);
} }
/**
* 后台管理员列表
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2018-09-29
* @desc description
* @param [array] $params [输入参数]
*/
public static function AdminIntegralList($params = [])
{
$where = empty($params['where']) ? [] : $params['where'];
$m = isset($params['m']) ? intval($params['m']) : 0;
$n = isset($params['n']) ? intval($params['n']) : 10;
$field = 'ui.*,u.username,u.nickname,u.mobile,u.gender';
$order_by = empty($params['order_by']) ? 'ui.id desc' : $params['order_by'];
// 获取数据列表
$data = Db::name('UserIntegralLog')->alias('ui')->join(['__USER__'=>'u'], 'u.id=ui.user_id')->where($where)->field($field)->limit($m, $n)->order($order_by)->select();
if(!empty($data))
{
$common_integral_log_type_list = lang('common_integral_log_type_list');
$common_gender_list = lang('common_gender_list');
foreach($data as &$v)
{
// 操作类型
$v['type_text'] = $common_integral_log_type_list[$v['type']]['name'];
// 性别
$v['gender_text'] = $common_gender_list[$v['gender']]['name'];
// 时间
$v['add_time_time'] = date('Y-m-d H:i:s', $v['add_time']);
$v['add_time_date'] = date('Y-m-d', $v['add_time']);
}
}
return DataReturn('处理成功', 0, $data);
}
/**
* 后台积分总数
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2018-09-29
* @desc description
* @param [array] $where [条件]
*/
public static function AdminIntegralTotal($where = [])
{
return (int) Db::name('UserIntegralLog')->alias('ui')->join(['__USER__'=>'u'], 'u.id=ui.user_id')->where($where)->count();
}
/**
* 后台积分列表条件
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2018-09-29
* @desc description
* @param [array] $params [输入参数]
*/
public static function AdminIntegralListWhere($params = [])
{
$where = [];
// 关键字
if(!empty($params['keywords']))
{
$where[] = ['ui.msg|u.username|u.nickname|u.mobile', 'like', '%'.$params['keywords'].'%'];
}
// 是否更多条件
if(isset($params['is_more']) && $params['is_more'] == 1)
{
// 等值
if(isset($params['type']) && $params['type'] > -1)
{
$where[] = ['ui.type', '=', intval($params['type'])];
}
if(isset($params['gender']) && $params['gender'] > -1)
{
$where[] = ['u.gender', '=', intval($params['gender'])];
}
if(!empty($params['time_start']))
{
$where[] = ['ui.add_time', '>', strtotime($params['time_start'])];
}
if(!empty($params['time_end']))
{
$where[] = ['ui.add_time', '<', strtotime($params['time_end'])];
}
}
return $where;
}
} }
?> ?>
\ No newline at end of file
...@@ -57,5 +57,131 @@ class RegionService ...@@ -57,5 +57,131 @@ class RegionService
return Db::name('Region')->where($where)->field($field)->order('id asc, sort asc')->select(); return Db::name('Region')->where($where)->field($field)->order('id asc, sort asc')->select();
} }
/**
* 获取地区节点数据
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @datetime 2018-12-16T23:54:46+0800
* @param [array] $params [输入参数]
*/
public static function RegionNodeSon($params = [])
{
// id
$id = isset($params['id']) ? intval($params['id']) : 0;
// 获取数据
$field = 'id,pid,name,sort,is_enable';
$data = Db::name('Region')->field($field)->where(['pid'=>$id])->order('sort asc')->select();
if(!empty($data))
{
foreach($data as &$v)
{
$v['is_son'] = (Db::name('Region')->where(['pid'=>$v['id']])->count() > 0) ? 'ok' : 'no';
$v['ajax_url'] = url('admin/region/getnodeson', array('id'=>$v['id']));
$v['delete_url'] = url('admin/region/delete');
$v['json'] = json_encode($v);
}
return DataReturn('操作成功', 0, $data);
}
return DataReturn('没有相关数据', -100);
}
/**
* 地区保存
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @datetime 2018-12-17T01:04:03+0800
* @param [array] $params [输入参数]
*/
public static function RegionSave($params = [])
{
// 请求参数
$p = [
[
'checked_type' => 'length',
'key_name' => 'name',
'checked_data' => '2,16',
'error_msg' => '名称格式 2~16 个字符',
],
];
$ret = params_checked($params, $p);
if($ret !== true)
{
return DataReturn($ret, -1);
}
// 数据
$data = [
'name' => $params['name'],
'pid' => isset($params['pid']) ? intval($params['pid']) : 0,
'sort' => isset($params['sort']) ? intval($params['sort']) : 0,
'is_enable' => isset($params['is_enable']) ? intval($params['is_enable']) : 0,
];
// 添加
if(empty($params['id']))
{
$data['add_time'] = time();
if(Db::name('Region')->insertGetId($data) > 0)
{
return DataReturn('添加成功', 0);
}
return DataReturn('添加失败', -100);
} else {
$data['upd_time'] = time();
if(Db::name('Region')->where(['id'=>intval($params['id'])])->update($data))
{
return DataReturn('编辑成功', 0);
}
return DataReturn('编辑失败', -100);
}
}
/**
* 地区删除
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @datetime 2018-12-17T02:40:29+0800
* @param [array] $params [输入参数]
*/
public static function RegionDelete($params = [])
{
// 请求参数
$p = [
[
'checked_type' => 'empty',
'key_name' => 'id',
'error_msg' => '删除数据id有误',
],
[
'checked_type' => 'empty',
'key_name' => 'admin',
'error_msg' => '用户信息有误',
],
];
$ret = params_checked($params, $p);
if($ret !== true)
{
return DataReturn($ret, -1);
}
// 是否还有子数据
$temp_count = Db::name('Region')->where(['pid'=>$params['id']])->count();
if($temp_count > 0)
{
return DataReturn('请先删除子数据', -10);
}
// 开始删除
if(Db::name('Region')->where(['id'=>$params['id']])->delete())
{
return DataReturn('删除成功', 0);
}
return DataReturn('删除失败', -100);
}
} }
?> ?>
\ No newline at end of file
...@@ -139,7 +139,7 @@ class ScreeningPriceService ...@@ -139,7 +139,7 @@ class ScreeningPriceService
{ {
return DataReturn('删除成功', 0); return DataReturn('删除成功', 0);
} }
return DataReturn('删除失败', 0); return DataReturn('删除失败', -100);
} }
} }
?> ?>
\ No newline at end of file
此差异已折叠。
ul.plug-file-upload-view li { width: 56px; height: 56px; }
\ No newline at end of file
$(function()
{
});
\ No newline at end of file
$(function()
{
});
\ No newline at end of file
$(function()
{
});
\ No newline at end of file
$(function()
{
});
\ No newline at end of file
$(function()
{
});
\ No newline at end of file
$(function()
{
});
\ No newline at end of file
$(function()
{
});
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册