提交 737b9393 编写于 作者: D devil

后台列表优化

上级 b7909eec
......@@ -82,7 +82,7 @@ class Answer extends Common
return $this->fetch();
}
/**
/**
* 详情
* @author Devil
* @blog http://gong.gg/
......
......@@ -49,48 +49,33 @@ class IntegralLog extends Common
*/
public function Index()
{
// 参数
$params = input();
$params['user'] = $this->admin;
$params['user_type'] = 'admin';
// 总数
$total = IntegralService::IntegralLogTotal($this->form_where);
// 分页
$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' => MyUrl('admin/integrallog/index'),
);
$page_params = [
'number' => $this->page_size,
'total' => $total,
'where' => $this->data_request,
'page' => $this->page,
'url' => MyUrl('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'));
$data_params = [
'where' => $this->form_where,
'm' => $page->GetPageStarNumber(),
'n' => $this->page_size,
'is_public' => 0,
'user_type' => 'admin',
];
$ret = IntegralService::IntegralLogList($data_params);
// 操作类型
$this->assign('common_integral_log_type_list', lang('common_integral_log_type_list'));
// 参数
$this->assign('params', $params);
// 基础参数赋值
$this->assign('params', $this->data_request);
$this->assign('page_html', $page->GetPageHtml());
$this->assign('data_list', $ret['data']);
return $this->fetch();
}
}
......
......@@ -62,6 +62,35 @@ class Link extends Common
return $this->fetch();
}
/**
* 详情
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @datetime 2019-08-05T08:21:54+0800
*/
public function Detail()
{
if(!empty($this->data_request['id']))
{
// 条件
$where = [
['id', '=', intval($this->data_request['id'])],
];
// 获取列表
$data_params = [
'm' => 0,
'n' => 1,
'where' => $where,
];
$ret = LinkService::LinkList($data_params);
$data = (empty($ret['data']) || empty($ret['data'][0])) ? [] : $ret['data'][0];
$this->assign('data', $data);
}
return $this->fetch();
}
/**
* [Save 数据保存]
* @author Devil
......
......@@ -49,57 +49,67 @@ class Message extends Common
*/
public function Index()
{
// 参数
$params = input();
$params['user'] = $this->admin;
$params['user_type'] = 'admin';
// 总数
$total = MessageService::MessageTotal($this->form_where);
// 分页
$number = MyC('admin_page_number', 10, true);
// 条件
$where = MessageService::AdminMessageListWhere($params);
// 获取总数
$total = MessageService::AdminMessageTotal($where);
// 分页
$page_params = array(
'number' => $number,
'total' => $total,
'where' => $params,
'page' => isset($params['page']) ? intval($params['page']) : 1,
'url' => MyUrl('admin/message/index'),
);
$page_params = [
'number' => $this->page_size,
'total' => $total,
'where' => $this->data_request,
'page' => $this->page,
'url' => MyUrl('admin/message/index'),
];
$page = new \base\Page($page_params);
$this->assign('page_html', $page->GetPageHtml());
// 获取列表
$data_params = array(
'm' => $page->GetPageStarNumber(),
'n' => $number,
'where' => $where,
);
$data = MessageService::AdminMessageList($data_params);
$this->assign('data_list', $data['data']);
// 性别
$this->assign('common_gender_list', lang('common_gender_list'));
// 消息类型
$this->assign('common_message_type_list', lang('common_message_type_list'));
// 是否已读
$this->assign('common_is_read_list', lang('common_is_read_list'));
// 是否
$this->assign('common_is_text_list', lang('common_is_text_list'));
// 参数
$this->assign('params', $params);
$data_params = [
'where' => $this->form_where,
'm' => $page->GetPageStarNumber(),
'n' => $this->page_size,
'is_public' => 0,
'user_type' => 'admin',
];
$ret = MessageService::MessageList($data_params);
// 基础参数赋值
$this->assign('params', $this->data_request);
$this->assign('page_html', $page->GetPageHtml());
$this->assign('data_list', $ret['data']);
return $this->fetch();
}
/**
* 详情
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @datetime 2019-08-05T08:21:54+0800
*/
public function Detail()
{
if(!empty($this->data_request['id']))
{
// 条件
$where = [
['id', '=', intval($this->data_request['id'])],
];
// 获取列表
$data_params = [
'm' => 0,
'n' => 1,
'where' => $where,
'is_public' => 0,
'user_type' => 'admin',
];
$ret = MessageService::MessageList($data_params);
$data = (empty($ret['data']) || empty($ret['data'][0])) ? [] : $ret['data'][0];
$this->assign('data', $data);
}
return $this->fetch();
}
/**
* [Delete 消息删除]
* @author Devil
......@@ -116,7 +126,7 @@ class Message extends Common
}
// 开始处理
$params = input();
$params = $this->data_request;
$params['admin'] = $this->admin;
return MessageService::MessageDelete($params);
}
......
......@@ -49,52 +49,33 @@ class PayLog extends Common
*/
public function Index()
{
// 参数
$params = input();
$params['user'] = $this->admin;
$params['user_type'] = 'admin';
// 总数
$total = PayLogService::PayLogTotal($this->form_where);
// 分页
$number = MyC('admin_page_number', 10, true);
// 条件
$where = PayLogService::AdminPayLogListWhere($params);
// 获取总数
$total = PayLogService::AdminPayLogTotal($where);
// 分页
$page_params = array(
'number' => $number,
'total' => $total,
'where' => $params,
'page' => isset($params['page']) ? intval($params['page']) : 1,
'url' => MyUrl('admin/paylog/index'),
);
$page_params = [
'number' => $this->page_size,
'total' => $total,
'where' => $this->data_request,
'page' => $this->page,
'url' => MyUrl('admin/paylog/index'),
];
$page = new \base\Page($page_params);
$this->assign('page_html', $page->GetPageHtml());
// 获取列表
$data_params = array(
'm' => $page->GetPageStarNumber(),
'n' => $number,
'where' => $where,
);
$data = PayLogService::AdminPayLogList($data_params);
$this->assign('data_list', $data['data']);
$data_params = [
'where' => $this->form_where,
'm' => $page->GetPageStarNumber(),
'n' => $this->page_size,
'is_public' => 0,
'user_type' => 'admin',
];
$ret = PayLogService::PayLogList($data_params);
// 性别
$this->assign('common_gender_list', lang('common_gender_list'));
// 业务类型
$this->assign('common_business_type_list', lang('common_business_type_list'));
// 支付日志类型
$pay_type_list = PayLogService::PayLogTypeList($params);
$this->assign('common_pay_type_list', $pay_type_list['data']);
// 参数
$this->assign('params', $params);
// 基础参数赋值
$this->assign('params', $this->data_request);
$this->assign('page_html', $page->GetPageHtml());
$this->assign('data_list', $ret['data']);
return $this->fetch();
}
}
......
......@@ -49,52 +49,33 @@ class RefundLog extends Common
*/
public function Index()
{
// 参数
$params = input();
$params['user'] = $this->admin;
$params['user_type'] = 'admin';
// 总数
$total = RefundLogService::RefundLogTotal($this->form_where);
// 分页
$number = MyC('admin_page_number', 10, true);
// 条件
$where = RefundLogService::AdminRefundLogListWhere($params);
// 获取总数
$total = RefundLogService::AdminRefundLogTotal($where);
// 分页
$page_params = array(
'number' => $number,
'total' => $total,
'where' => $params,
'page' => isset($params['page']) ? intval($params['page']) : 1,
'url' => MyUrl('admin/refundlog/index'),
);
$page_params = [
'number' => $this->page_size,
'total' => $total,
'where' => $this->data_request,
'page' => $this->page,
'url' => MyUrl('admin/refundlog/index'),
];
$page = new \base\Page($page_params);
$this->assign('page_html', $page->GetPageHtml());
// 获取列表
$data_params = array(
'm' => $page->GetPageStarNumber(),
'n' => $number,
'where' => $where,
);
$data = RefundLogService::AdminRefundLogList($data_params);
$this->assign('data_list', $data['data']);
$data_params = [
'where' => $this->form_where,
'm' => $page->GetPageStarNumber(),
'n' => $this->page_size,
'is_public' => 0,
'user_type' => 'admin',
];
$ret = RefundLogService::RefundLogList($data_params);
// 性别
$this->assign('common_gender_list', lang('common_gender_list'));
// 业务类型
$this->assign('common_business_type_list', lang('common_business_type_list'));
// 支付日志类型
$pay_type_list = RefundLogService::RefundLogTypeList($params);
$this->assign('common_pay_type_list', $pay_type_list['data']);
// 参数
$this->assign('params', $params);
// 基础参数赋值
$this->assign('params', $this->data_request);
$this->assign('page_html', $page->GetPageHtml());
$this->assign('data_list', $ret['data']);
return $this->fetch();
}
}
......
......@@ -60,7 +60,7 @@ class Answer
[
'label' => '用户信息',
'view_type' => 'module',
'view_key' => 'answer/module/user',
'view_key' => 'lib/module/user',
'grid_size' => 'sm',
'search_config' => [
'form_type' => 'input',
......@@ -121,7 +121,7 @@ class Answer
'search_config' => [
'form_type' => 'select',
'where_type' => 'in',
'data' => lang('common_is_shelves_list'),
'data' => lang('common_is_show_list'),
'data_key' => 'id',
'data_name' => 'name',
'is_multiple' => 1,
......
......@@ -74,7 +74,7 @@ class Goodscomments
[
'label' => '用户信息',
'view_type' => 'module',
'view_key' => 'goodscomments/module/user',
'view_key' => 'lib/module/user',
'grid_size' => 'sm',
'search_config' => [
'form_type' => 'input',
......
<?php
// +----------------------------------------------------------------------
// | ShopXO 国内领先企业级B2C免费开源电商系统
// +----------------------------------------------------------------------
// | Copyright (c) 2011~2019 http://shopxo.net All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: Devil
// +----------------------------------------------------------------------
namespace app\admin\form;
use think\Db;
/**
* 积分日志动态表格
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2020-06-27
* @desc description
*/
class Integrallog
{
// 基础条件
public $condition_base = [];
/**
* 入口
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2020-06-27
* @desc description
* @param [array] $params [输入参数]
*/
public function Run($params = [])
{
return [
// 基础配置
'base' => [
'key_field' => 'id',
'is_search' => 1,
'search_url' => MyUrl('admin/integrallog/index'),
],
// 表单配置
'form' => [
[
'label' => '用户信息',
'view_type' => 'module',
'view_key' => 'lib/module/user',
'grid_size' => 'sm',
'search_config' => [
'form_type' => 'input',
'form_name' => 'user_id',
'where_type' => 'like',
'where_type_custom' => 'in',
'where_handle_custom' => 'WhereValueUserInfo',
'placeholder' => '请输入用户名/昵称/手机/邮箱',
],
],
[
'label' => '操作类型',
'view_type' => 'field',
'view_key' => 'type_text',
'search_config' => [
'form_type' => 'select',
'form_name' => 'type',
'where_type' => 'in',
'data' => lang('common_integral_log_type_list'),
'data_key' => 'id',
'data_name' => 'name',
'is_multiple' => 1,
],
],
[
'label' => '原始积分',
'view_type' => 'field',
'view_key' => 'original_integral',
'search_config' => [
'form_type' => 'section',
],
],
[
'label' => '最新积分',
'view_type' => 'field',
'view_key' => 'new_integral',
'search_config' => [
'form_type' => 'section',
],
],
[
'label' => '操作原因',
'view_type' => 'field',
'view_key' => 'msg',
'grid_size' => 'sm',
'search_config' => [
'form_type' => 'input',
'where_type' => 'like',
],
],
[
'label' => '操作人员id',
'view_type' => 'field',
'view_key' => 'operation_id',
'search_config' => [
'form_type' => 'input',
'where_type' => '=',
],
],
[
'label' => '操作时间',
'view_type' => 'field',
'view_key' => 'add_time_time',
'search_config' => [
'form_type' => 'datetime',
'form_name' => 'add_time',
],
],
],
];
}
/**
* 用户信息条件处理
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2020-06-27
* @desc description
* @param [string] $value [条件值]
* @param [array] $params [输入参数]
*/
public function WhereValueUserInfo($value, $params = [])
{
if(!empty($value))
{
// 获取用户 id
$ids = Db::name('User')->where('username|nickname|mobile|email', 'like', '%'.$value.'%')->column('id');
// 避免空条件造成无效的错觉
return empty($ids) ? [0] : $ids;
}
return $value;
}
}
?>
\ No newline at end of file
<?php
// +----------------------------------------------------------------------
// | ShopXO 国内领先企业级B2C免费开源电商系统
// +----------------------------------------------------------------------
// | Copyright (c) 2011~2019 http://shopxo.net All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: Devil
// +----------------------------------------------------------------------
namespace app\admin\form;
use think\Db;
/**
* 消息管理动态表格
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2020-06-26
* @desc description
*/
class Message
{
// 基础条件
public $condition_base = [];
/**
* 入口
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2020-06-26
* @desc description
* @param [array] $params [输入参数]
*/
public function Run($params = [])
{
return [
// 基础配置
'base' => [
'key_field' => 'id',
'is_search' => 1,
'search_url' => MyUrl('admin/message/index'),
'is_delete' => 1,
'delete_url' => MyUrl('admin/message/delete'),
'delete_key' => 'ids',
],
// 表单配置
'form' => [
[
'view_type' => 'checkbox',
'is_checked' => 0,
'checked_text' => '反选',
'not_checked_text' => '全选',
'align' => 'center',
'width' => 80,
],
[
'label' => '用户信息',
'view_type' => 'module',
'view_key' => 'lib/module/user',
'grid_size' => 'sm',
'search_config' => [
'form_type' => 'input',
'form_name' => 'user_id',
'where_type' => 'like',
'where_type_custom' => 'in',
'where_handle_custom' => 'WhereValueUserInfo',
'placeholder' => '请输入用户名/昵称/手机/邮箱',
],
],
[
'label' => '消息类型',
'view_type' => 'field',
'view_key' => 'type_text',
'search_config' => [
'form_type' => 'select',
'form_name' => 'type',
'where_type' => 'in',
'data' => lang('common_message_type_list'),
'data_key' => 'id',
'data_name' => 'name',
'is_multiple' => 1,
],
],
[
'label' => '业务类型',
'view_type' => 'field',
'view_key' => 'business_type_text',
'search_config' => [
'form_type' => 'select',
'form_name' => 'business_type',
'where_type' => 'in',
'data' => lang('common_business_type_list'),
'data_key' => 'id',
'data_name' => 'name',
'is_multiple' => 1,
],
],
[
'label' => '标题',
'view_type' => 'field',
'view_key' => 'title',
'search_config' => [
'form_type' => 'input',
'where_type' => 'like',
],
],
[
'label' => '详情',
'view_type' => 'field',
'view_key' => 'detail',
'grid_size' => 'lg',
'search_config' => [
'form_type' => 'input',
'where_type' => 'like',
],
],
[
'label' => '是否已读',
'view_type' => 'field',
'view_key' => 'is_read_text',
'search_config' => [
'form_type' => 'select',
'form_name' => 'is_read',
'where_type' => 'in',
'data' => lang('common_is_read_list'),
'data_key' => 'id',
'data_name' => 'name',
'is_multiple' => 1,
],
],
[
'label' => '用户是否删除',
'view_type' => 'field',
'view_key' => 'user_is_delete_time_text',
],
[
'label' => '发送时间',
'view_type' => 'field',
'view_key' => 'add_time_time',
'search_config' => [
'form_type' => 'datetime',
'form_name' => 'add_time',
],
],
[
'label' => '操作',
'view_type' => 'operate',
'view_key' => 'message/module/operate',
'align' => 'center',
'fixed' => 'right',
],
],
];
}
/**
* 用户信息条件处理
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2020-06-26
* @desc description
* @param [string] $value [条件值]
* @param [array] $params [输入参数]
*/
public function WhereValueUserInfo($value, $params = [])
{
if(!empty($value))
{
// 获取用户 id
$ids = Db::name('User')->where('username|nickname|mobile|email', 'like', '%'.$value.'%')->column('id');
// 避免空条件造成无效的错觉
return empty($ids) ? [0] : $ids;
}
return $value;
}
}
?>
\ No newline at end of file
......@@ -88,7 +88,7 @@ class Order
[
'label' => '用户信息',
'view_type' => 'module',
'view_key' => 'order/module/user',
'view_key' => 'lib/module/user',
'grid_size' => 'sm',
'search_config' => [
'form_type' => 'input',
......
......@@ -72,7 +72,7 @@ class Orderaftersale
[
'label' => '用户信息',
'view_type' => 'module',
'view_key' => 'orderaftersale/module/user',
'view_key' => 'lib/module/user',
'grid_size' => 'sm',
'search_config' => [
'form_type' => 'input',
......
<?php
// +----------------------------------------------------------------------
// | ShopXO 国内领先企业级B2C免费开源电商系统
// +----------------------------------------------------------------------
// | Copyright (c) 2011~2019 http://shopxo.net All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: Devil
// +----------------------------------------------------------------------
namespace app\admin\form;
use think\Db;
use app\service\PayLogService;
/**
* 支付日志动态表格
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2020-06-26
* @desc description
*/
class Paylog
{
// 基础条件
public $condition_base = [];
/**
* 入口
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2020-06-26
* @desc description
* @param [array] $params [输入参数]
*/
public function Run($params = [])
{
return [
// 基础配置
'base' => [
'key_field' => 'id',
'is_search' => 1,
'search_url' => MyUrl('admin/paylog/index'),
],
// 表单配置
'form' => [
[
'label' => '用户信息',
'view_type' => 'module',
'view_key' => 'lib/module/user',
'grid_size' => 'sm',
'search_config' => [
'form_type' => 'input',
'form_name' => 'user_id',
'where_type' => 'like',
'where_type_custom' => 'in',
'where_handle_custom' => 'WhereValueUserInfo',
'placeholder' => '请输入用户名/昵称/手机/邮箱',
],
],
[
'label' => '支付方式',
'view_type' => 'module',
'view_key' => 'paylog/module/payment',
'search_config' => [
'form_type' => 'select',
'form_name' => 'payment',
'where_type' => 'in',
'data' => $this->PayLogTypeList(),
'data_key' => 'id',
'data_name' => 'name',
'is_multiple' => 1,
],
],
[
'label' => '业务类型',
'view_type' => 'field',
'view_key' => 'business_type_text',
'search_config' => [
'form_type' => 'select',
'form_name' => 'business_type',
'where_type' => 'in',
'data' => lang('common_business_type_list'),
'data_key' => 'id',
'data_name' => 'name',
'is_multiple' => 1,
],
],
[
'label' => '业务订单id',
'view_type' => 'field',
'view_key' => 'order_id',
'search_config' => [
'form_type' => 'input',
'where_type' => '=',
],
],
[
'label' => '支付平台交易号',
'view_type' => 'field',
'view_key' => 'trade_no',
'search_config' => [
'form_type' => 'input',
'where_type' => 'like',
],
],
[
'label' => '支付平台用户帐号',
'view_type' => 'field',
'view_key' => 'buyer_user',
'search_config' => [
'form_type' => 'input',
'where_type' => 'like',
],
],
[
'label' => '支付金额',
'view_type' => 'field',
'view_key' => 'pay_price',
'search_config' => [
'form_type' => 'section',
'is_point' => 1,
],
],
[
'label' => '订单实际金额',
'view_type' => 'field',
'view_key' => 'total_price',
'search_config' => [
'form_type' => 'section',
'is_point' => 1,
],
],
[
'label' => '订单名称',
'view_type' => 'field',
'view_key' => 'subject',
'search_config' => [
'form_type' => 'input',
'where_type' => 'like',
],
],
[
'label' => '支付时间',
'view_type' => 'field',
'view_key' => 'add_time_time',
'search_config' => [
'form_type' => 'datetime',
'form_name' => 'add_time',
],
],
],
];
}
/**
* 用户信息条件处理
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2020-06-26
* @desc description
* @param [string] $value [条件值]
* @param [array] $params [输入参数]
*/
public function WhereValueUserInfo($value, $params = [])
{
if(!empty($value))
{
// 获取用户 id
$ids = Db::name('User')->where('username|nickname|mobile|email', 'like', '%'.$value.'%')->column('id');
// 避免空条件造成无效的错觉
return empty($ids) ? [0] : $ids;
}
return $value;
}
/**
* 支付方式类型
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2020-06-26
* @desc description
*/
public function PayLogTypeList()
{
$ret = PayLogService::PayLogTypeList();
return empty($ret['data']) ? [] : $ret['data'];
}
}
?>
\ No newline at end of file
<?php
// +----------------------------------------------------------------------
// | ShopXO 国内领先企业级B2C免费开源电商系统
// +----------------------------------------------------------------------
// | Copyright (c) 2011~2019 http://shopxo.net All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: Devil
// +----------------------------------------------------------------------
namespace app\admin\form;
use think\Db;
use app\service\RefundLogService;
/**
* 退款日志动态表格
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2020-06-27
* @desc description
*/
class Refundlog
{
// 基础条件
public $condition_base = [];
/**
* 入口
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2020-06-27
* @desc description
* @param [array] $params [输入参数]
*/
public function Run($params = [])
{
return [
// 基础配置
'base' => [
'key_field' => 'id',
'is_search' => 1,
'search_url' => MyUrl('admin/refundlog/index'),
],
// 表单配置
'form' => [
[
'label' => '用户信息',
'view_type' => 'module',
'view_key' => 'lib/module/user',
'grid_size' => 'sm',
'search_config' => [
'form_type' => 'input',
'form_name' => 'user_id',
'where_type' => 'like',
'where_type_custom' => 'in',
'where_handle_custom' => 'WhereValueUserInfo',
'placeholder' => '请输入用户名/昵称/手机/邮箱',
],
],
[
'label' => '支付方式',
'view_type' => 'module',
'view_key' => 'refundlog/module/payment',
'search_config' => [
'form_type' => 'select',
'form_name' => 'payment',
'where_type' => 'in',
'data' => $this->RefundLogTypeList(),
'data_key' => 'id',
'data_name' => 'name',
'is_multiple' => 1,
],
],
[
'label' => '业务类型',
'view_type' => 'field',
'view_key' => 'business_type_text',
'search_config' => [
'form_type' => 'select',
'form_name' => 'business_type',
'where_type' => 'in',
'data' => lang('common_business_type_list'),
'data_key' => 'id',
'data_name' => 'name',
'is_multiple' => 1,
],
],
[
'label' => '业务订单id',
'view_type' => 'field',
'view_key' => 'order_id',
'search_config' => [
'form_type' => 'input',
'where_type' => '=',
],
],
[
'label' => '支付平台交易号',
'view_type' => 'field',
'view_key' => 'trade_no',
'search_config' => [
'form_type' => 'input',
'where_type' => 'like',
],
],
[
'label' => '支付平台用户帐号',
'view_type' => 'field',
'view_key' => 'buyer_user',
'search_config' => [
'form_type' => 'input',
'where_type' => 'like',
],
],
[
'label' => '退款方式',
'view_type' => 'field',
'view_key' => 'refundment_text',
'search_config' => [
'form_type' => 'select',
'form_name' => 'refundment',
'where_type' => 'in',
'data' => lang('common_order_aftersale_refundment_list'),
'data_key' => 'id',
'data_name' => 'name',
'is_multiple' => 1,
],
],
[
'label' => '退款金额',
'view_type' => 'field',
'view_key' => 'refund_price',
'search_config' => [
'form_type' => 'section',
'is_point' => 1,
],
],
[
'label' => '订单支付金额',
'view_type' => 'field',
'view_key' => 'pay_price',
'search_config' => [
'form_type' => 'section',
'is_point' => 1,
],
],
[
'label' => '描述',
'view_type' => 'field',
'view_key' => 'msg',
'grid_size' => 'sm',
'search_config' => [
'form_type' => 'input',
'where_type' => 'like',
],
],
[
'label' => '退款时间',
'view_type' => 'field',
'view_key' => 'add_time_time',
'search_config' => [
'form_type' => 'datetime',
'form_name' => 'add_time',
],
],
],
];
}
/**
* 用户信息条件处理
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2020-06-27
* @desc description
* @param [string] $value [条件值]
* @param [array] $params [输入参数]
*/
public function WhereValueUserInfo($value, $params = [])
{
if(!empty($value))
{
// 获取用户 id
$ids = Db::name('User')->where('username|nickname|mobile|email', 'like', '%'.$value.'%')->column('id');
// 避免空条件造成无效的错觉
return empty($ids) ? [0] : $ids;
}
return $value;
}
/**
* 支付方式类型
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2020-06-27
* @desc description
*/
public function RefundLogTypeList()
{
$ret = RefundLogService::RefundLogTypeList();
return empty($ret['data']) ? [] : $ret['data'];
}
}
?>
\ No newline at end of file
<!-- 继承公共的 form -->
{{extend name="public/module/detail" /}}
\ No newline at end of file
<!-- 操作栏 -->
<button type="button" class="am-btn am-btn-default am-btn-xs am-radius am-btn-block submit-popup" data-url="{{:MyUrl('admin/answer/detail', ['id'=>$module_data['id']])}}">
<i class="am-icon-eye"></i>
<span>详情</span>
</button>
<a href="{{:MyUrl('admin/answer/saveinfo', array_merge($params, ['id'=>$module_data['id']]))}}" class="am-btn am-btn-secondary am-btn-xs am-radius am-btn-block">
<i class="am-icon-edit"></i>
<span>编辑</span>
......
<!-- 用户信息 -->
{{if !empty($module_data)}}
{{if !empty($module_data['user'])}}
<img src="{{$module_data.user.avatar}}" alt="{{$module_data.user.user_name_view}}" class="am-img-thumbnail am-radius am-align-left am-margin-right-xs am-margin-bottom-0" width="35" height="35" />
<ul class="user-base">
<li>名称:{{if empty($module_data['user']['username'])}}<span class="cr-ccc">未填写</span>{{else /}}{{$module_data.user.username}}{{/if}}</li>
<li>昵称:{{if empty($module_data['user']['nickname'])}}<span class="cr-ccc">未填写</span>{{else /}}{{$module_data.user.nickname}}{{/if}}</li>
<li>手机:{{if empty($module_data['user']['mobile'])}}<span class="cr-ccc">未填写</span>{{else /}}{{$module_data.user.mobile}}{{/if}}</li>
<li>邮箱:{{if empty($module_data['user']['email'])}}<span class="cr-ccc">未填写</span>{{else /}}{{$module_data.user.email}}{{/if}}</li>
</ul>
{{else /}}
用户信息异常
{{/if}}
{{/if}}
\ 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 form-search" method="post" action="{{:MyUrl('admin/integrallog/index')}}" request-type="form">
<div class="thin">
<div class="am-input-group am-input-group-sm am-fl so">
<input type="text" autocomplete="off" name="keywords" class="am-radius" placeholder="姓名/手机/昵称/原因" value="{{if !empty($params.keywords)}}{{$params.keywords}}{{/if}}" />
<span class="am-input-group-btn">
<button class="am-btn am-btn-default am-radius" type="submit" data-am-loading="{spinner:'circle-o-notch', loadingText:'搜索中...'}">搜索</button>
</span>
</div>
<label class="am-fl thin_sub more-submit">
更多筛选条件
{{if isset($params['is_more']) and $params['is_more'] eq 1}}
<input type="checkbox" name="is_more" value="1" id="is_more" checked />
<i class="am-icon-angle-up"></i>
{{else /}}
<input type="checkbox" name="is_more" value="1" id="is_more" />
<i class="am-icon-angle-down"></i>
{{/if}}
</label>
</div>
<table class="so-list more-where {{if !isset($params['is_more'])}}none{{/if}}">
<tbody>
<tr>
<td>
<span>性别:</span>
<select name="gender" class="chosen-select" data-placeholder="性别...">
<option value="-1">性别...</option>
{{foreach $common_gender_list as $v}}
<option value="{{$v.id}}" {{if isset($params['gender']) and $params['gender'] eq $v['id']}}selected{{/if}}>{{$v.name}}</option>
{{/foreach}}
</select>
</td>
<td>
<span>类型:</span>
<select name="type" class="chosen-select" data-placeholder="操作类型...">
<option value="-1">操作类型...</option>
{{foreach $common_integral_log_type_list as $v}}
<option value="{{$v.id}}" {{if isset($params['type']) and $params['type'] eq $v['id']}}selected{{/if}}>{{$v.name}}</option>
{{/foreach}}
</select>
</td>
</tr>
<tr>
<td class="time">
<span>时间:</span>
<span>
<input type="text" autocomplete="off" name="time_start" class="am-form-field am-input-sm am-radius Wdate" placeholder="起始时间" value="{{if !empty($params.time_start)}}{{$params.time_start}}{{/if}}" data-validation-message="日期格式有误" onclick="WdatePicker({firstDayOfWeek:1,dateFmt:'yyyy-MM-dd'})" autocomplete="off" /><i class="am-icon-calendar"></i>
</span>
<em class="text-grey">~</em>
<span>
<input type="text" autocomplete="off" name="time_end" class="am-form-field am-input-sm am-radius Wdate" placeholder="结束时间" value="{{if !empty($params.time_end)}}{{$params.time_end}}{{/if}}" pattern="^[0-9]{4}-[0-9]{2}-[0-9]{2}$" data-validation-message="日期格式有误" onclick="WdatePicker({firstDayOfWeek:1,dateFmt:'yyyy-MM-dd'})" autocomplete="off" /><i class="am-icon-calendar"></i>
</span>
</td>
<td>
<button type="submit" class="am-btn am-btn-primary am-radius am-btn-xs btn-loading-example" data-am-loading="{spinner:'circle-o-notch', loadingText:'搜索中...'}">搜索</button>
<a href="{{:MyUrl('admin/integrallog/index')}}" class="am-btn am-btn-warning am-radius am-btn-sm reset-submit">清除条件</a>
</td>
</tr>
</tbody>
</table>
</form>
<!-- form end -->
<!-- list start -->
<div class="am-scrollable-horizontal am-table-scrollable-horizontal am-margin-top-sm">
<table class="am-table am-table-striped am-table-hover am-table-bordered am-text-nowrap">
<thead>
<tr>
<th class="am-grid-sm">用户信息</th>
<th>操作类型</th>
<th>原始积分</th>
<th>最新积分</th>
<th class="am-grid-sm">操作原因</th>
<th>操作时间</th>
</tr>
</thead>
<tbody>
{{if !empty($data_list)}}
{{foreach $data_list as $v}}
<tr>
<td class="am-text-middle">
<ul class="user-base">
<li>名称:{{if empty($v['username'])}}<span class="cr-ccc">未填写</span>{{else /}}{{$v.username}}{{/if}}</li>
<li>昵称:{{if empty($v['nickname'])}}<span class="cr-ccc">未填写</span>{{else /}}{{$v.nickname}}{{/if}}</li>
<li>手机:{{if empty($v['mobile'])}}<span class="cr-ccc">未填写</span>{{else /}}{{$v.mobile}}{{/if}}</li>
<li>邮箱:{{if empty($v['email'])}}<span class="cr-ccc">未填写</span>{{else /}}{{$v.email}}{{/if}}</li>
<li>性别:{{if empty($v['gender_text'])}}<span class="cr-ccc">未填写</span>{{else /}}{{$v.gender_text}}{{/if}}</li>
</ul>
</td>
<td class="am-text-middle">
{{if empty($v['type_text'])}}<span class="cr-ddd">未填写</span>{{else /}}{{$v.type_text}}{{/if}}
</td>
<td class="am-text-middle">{{$v.original_integral}}</td>
<td class="am-text-middle">{{$v.new_integral}}</td>
<td class="am-text-middle am-nowrap-initial">
{{if empty($v['msg'])}}<span class="cr-ddd">未填写</span>{{else /}}{{$v.msg}}{{/if}}
</td>
<td class="am-text-middle">
{{if empty($v['add_time_time'])}}<span class="cr-ddd">未设置</span>{{else /}}{{$v.add_time_time}}{{/if}}
</td>
</tr>
{{/foreach}}
{{/if}}
</tbody>
</table>
{{if empty($data_list)}}
<div class="table-no"><i class="am-icon-warning"></i> 没有相关数据</div>
{{/if}}
</div>
<!-- list end -->
<!-- page start -->
{{if !empty($data_list)}}
{{$page_html|raw}}
{{/if}}
<!-- page end -->
</div>
</div>
<!-- right content end -->
<!-- footer start -->
{{include file="public/footer" /}}
<!-- footer end -->
\ No newline at end of file
<!-- 继承公共的 form -->
{{extend name="public/module/form" /}}
\ No newline at end of file
......@@ -3,10 +3,10 @@
{{if !empty($module_data['user'])}}
<img src="{{$module_data.user.avatar}}" alt="{{$module_data.user.user_name_view}}" class="am-img-thumbnail am-radius am-align-left am-margin-right-xs am-margin-bottom-0" width="35" height="35" />
<ul class="user-base">
<li>名称:{{if empty($module_data['user']['username'])}}<span class="cr-ccc">未填写</span>{{else /}}{{$module_data.user.username}}{{/if}}</li>
<li>昵称:{{if empty($module_data['user']['nickname'])}}<span class="cr-ccc">未填写</span>{{else /}}{{$module_data.user.nickname}}{{/if}}</li>
<li>手机:{{if empty($module_data['user']['mobile'])}}<span class="cr-ccc">未填写</span>{{else /}}{{$module_data.user.mobile}}{{/if}}</li>
<li>邮箱:{{if empty($module_data['user']['email'])}}<span class="cr-ccc">未填写</span>{{else /}}{{$module_data.user.email}}{{/if}}</li>
<li>名称:{{if empty($module_data['user']['username'])}}<span class="cr-ccc"></span>{{else /}}{{$module_data.user.username}}{{/if}}</li>
<li>昵称:{{if empty($module_data['user']['nickname'])}}<span class="cr-ccc"></span>{{else /}}{{$module_data.user.nickname}}{{/if}}</li>
<li>手机:{{if empty($module_data['user']['mobile'])}}<span class="cr-ccc"></span>{{else /}}{{$module_data.user.mobile}}{{/if}}</li>
<li>邮箱:{{if empty($module_data['user']['email'])}}<span class="cr-ccc"></span>{{else /}}{{$module_data.user.email}}{{/if}}</li>
</ul>
{{else /}}
用户信息异常
......
<!-- 操作栏 -->
<button type="button" class="am-btn am-btn-default am-btn-xs am-radius am-btn-block submit-popup" data-url="{{:MyUrl('admin/link/detail', ['id'=>$module_data['id']])}}">
<i class="am-icon-eye"></i>
<span>详情</span>
</button>
<button type="button" class="am-btn am-btn-secondary am-btn-xs am-radius am-btn-block submit-edit" data-am-modal="{target: '#data-save-win'}" data-json='{{:json_encode($module_data)}}'>
<i class="am-icon-edit"></i>
<span>编辑</span>
......
<!-- 继承公共的 form -->
{{extend name="public/module/detail" /}}
\ 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 form-search" method="post" action="{{:MyUrl('admin/message/index')}}" request-type="form">
<div class="thin">
<div class="am-input-group am-input-group-sm am-fl so">
<input type="text" autocomplete="off" name="keywords" class="am-radius" placeholder="名称" value="{{if !empty($params.keywords)}}{{$params.keywords}}{{/if}}" />
<span class="am-input-group-btn">
<button class="am-btn am-btn-default am-radius" type="submit" data-am-loading="{spinner:'circle-o-notch', loadingText:'搜索中...'}">搜索</button>
</span>
</div>
<label class="am-fl thin_sub more-submit">
更多筛选条件
{{if isset($params['is_more']) and $params['is_more'] eq 1}}
<input type="checkbox" name="is_more" value="1" id="is_more" checked />
<i class="am-icon-angle-up"></i>
{{else /}}
<input type="checkbox" name="is_more" value="1" id="is_more" />
<i class="am-icon-angle-down"></i>
{{/if}}
</label>
</div>
<table class="so-list more-where {{if !isset($params['is_more'])}}none{{/if}}">
<tbody>
<tr>
<td>
<span>性别:</span>
<select name="gender" class="chosen-select" data-placeholder="性别...">
<option value="-1">性别...</option>
{{foreach $common_gender_list as $v}}
<option value="{{$v.id}}" {{if isset($params['gender']) and $params['gender'] eq $v['id']}}selected{{/if}}>{{$v.name}}</option>
{{/foreach}}
</select>
</td>
<td>
<span>类型:</span>
<select name="type" class="chosen-select" data-placeholder="消息类型...">
<option value="-1">消息类型...</option>
{{foreach $common_message_type_list as $v}}
<option value="{{$v.id}}" {{if isset($params['type']) and $params['type'] eq $v['id']}}selected{{/if}}>{{$v.name}}</option>
{{/foreach}}
</select>
</td>
</tr>
<tr>
<td>
<span>已读:</span>
<select name="is_read" class="chosen-select" data-placeholder="是否已读...">
<option value="-1">是否已读...</option>
{{foreach $common_is_read_list as $v}}
<option value="{{$v.id}}" {{if isset($params['is_read']) and $params['is_read'] eq $v['id']}}selected{{/if}}>{{$v.name}}</option>
{{/foreach}}
</select>
</td>
<td>
<span>删除:</span>
<select name="user_is_delete_time" class="chosen-select" data-placeholder="用户是否删除...">
<option value="-1">用户是否删除...</option>
{{foreach $common_is_text_list as $v}}
<option value="{{$v.id}}" {{if isset($params['user_is_delete_time']) and $params['user_is_delete_time'] eq $v['id']}}selected{{/if}}>{{$v.name}}</option>
{{/foreach}}
</select>
</td>
</tr>
<tr>
<td class="time">
<span>时间:</span>
<span>
<input type="text" autocomplete="off" name="time_start" class="am-form-field am-input-sm am-radius Wdate" placeholder="起始时间" value="{{if !empty($params.time_start)}}{{$params.time_start}}{{/if}}" data-validation-message="日期格式有误" onclick="WdatePicker({firstDayOfWeek:1,dateFmt:'yyyy-MM-dd'})" autocomplete="off" /><i class="am-icon-calendar"></i>
</span>
<em class="text-grey">~</em>
<span>
<input type="text" autocomplete="off" name="time_end" class="am-form-field am-input-sm am-radius Wdate" placeholder="结束时间" value="{{if !empty($params.time_end)}}{{$params.time_end}}{{/if}}" pattern="^[0-9]{4}-[0-9]{2}-[0-9]{2}$" data-validation-message="日期格式有误" onclick="WdatePicker({firstDayOfWeek:1,dateFmt:'yyyy-MM-dd'})" autocomplete="off" /><i class="am-icon-calendar"></i>
</span>
</td>
<td>
<button type="submit" class="am-btn am-btn-primary am-radius am-btn-xs btn-loading-example" data-am-loading="{spinner:'circle-o-notch', loadingText:'搜索中...'}">搜索</button>
<a href="{{:MyUrl('admin/message/index')}}" class="am-btn am-btn-warning am-radius am-btn-sm reset-submit">清除条件</a>
</td>
</tr>
</tbody>
</table>
</form>
<!-- form end -->
<!-- list start -->
<div class="am-scrollable-horizontal am-table-scrollable-horizontal am-margin-top-sm">
<table class="am-table am-table-striped am-table-hover am-table-bordered am-text-nowrap am-table-td-fixed-last">
<thead>
<tr>
<th class="am-grid-sm">用户信息</th>
<th>消息类型</th>
<th class="am-grid-sm">标题</th>
<th class="am-grid-lg">内容</th>
<th>是否已读</th>
<th>用户删除</th>
<th>发送时间</th>
<th class="am-text-center">操作</th>
</tr>
</thead>
<tbody>
{{if !empty($data_list)}}
{{foreach $data_list as $v}}
<tr id="data-list-{{$v.id}}">
<td class="am-text-middle">
<ul class="user-base">
<li>名称:{{if empty($v['username'])}}<span class="cr-ccc">未填写</span>{{else /}}{{$v.username}}{{/if}}</li>
<li>昵称:{{if empty($v['nickname'])}}<span class="cr-ccc">未填写</span>{{else /}}{{$v.nickname}}{{/if}}</li>
<li>手机:{{if empty($v['mobile'])}}<span class="cr-ccc">未填写</span>{{else /}}{{$v.mobile}}{{/if}}</li>
<li>邮箱:{{if empty($v['email'])}}<span class="cr-ccc">未填写</span>{{else /}}{{$v.email}}{{/if}}</li>
<li>性别:{{if empty($v['gender_text'])}}<span class="cr-ccc">未填写</span>{{else /}}{{$v.gender_text}}{{/if}}</li>
</ul>
</td>
<td class="am-text-middle">
{{if empty($v['type_name'])}}<span class="cr-ddd">未填写</span>{{else /}}{{$v.type_name}}{{/if}}
</td>
<td class="am-text-middle">
{{if empty($v['title'])}}<span class="cr-ddd">未填写</span>{{else /}}{{$v.title}}{{/if}}
</td>
<td class="am-text-middle am-nowrap-initial">
{{if empty($v['detail'])}}<span class="cr-ddd">未填写</span>{{else /}}{{$v.detail}}{{/if}}
</td>
<td class="am-text-middle">
{{if empty($v['is_read_name'])}}<span class="cr-ddd">未设置</span>{{else /}}{{$v.is_read_name}}{{/if}}
</td>
<td class="am-text-middle">
{{if empty($v['user_is_delete_time_name'])}}<span class="cr-ddd">未设置</span>{{else /}}{{$v.user_is_delete_time_name}}{{/if}}
</td>
<td class="am-text-middle">
{{if empty($v['add_time_time'])}}<span class="cr-ddd">未设置</span>{{else /}}{{$v.add_time_time}}{{/if}}
</td>
<td class="am-operate-grid">
<div class="am-scrollable-vertical">
<button class="am-btn am-btn-danger am-btn-xs am-radius am-btn-block submit-delete" data-url="{{:MyUrl('admin/message/delete')}}" data-id="{{$v.id}}">
<i class="am-icon-trash-o"></i>
<span>删除</span>
</button>
</div>
</td>
</tr>
{{/foreach}}
{{/if}}
</tbody>
</table>
{{if empty($data_list)}}
<div class="table-no"><i class="am-icon-warning"></i> 没有相关数据</div>
{{/if}}
</div>
<!-- list end -->
<!-- page start -->
{{if !empty($data_list)}}
{{$page_html|raw}}
{{/if}}
<!-- page end -->
</div>
</div>
<!-- right content end -->
<!-- footer start -->
{{include file="public/footer" /}}
<!-- footer end -->
\ No newline at end of file
<!-- 继承公共的 form -->
{{extend name="public/module/form" /}}
\ No newline at end of file
<!-- 操作栏 -->
<button type="button" class="am-btn am-btn-default am-btn-xs am-radius am-btn-block submit-popup" data-url="{{:MyUrl('admin/message/detail', ['id'=>$module_data['id']])}}">
<i class="am-icon-eye"></i>
<span>详情</span>
</button>
<button type="button" class="am-btn am-btn-danger am-btn-xs am-radius am-btn-block submit-delete" data-url="{{:MyUrl('admin/message/delete')}}" data-id="{{$module_data.id}}" data-key="ids">
<i class="am-icon-trash-o"></i>
<span>删除</span>
</button>
\ No newline at end of file
<!-- 扩展信息 -->
{{if !empty($module_data) and !empty($module_data['extension_data'])}}
{{foreach $v.extension_data as $extk=>$ext}}
{{foreach $module_data.extension_data as $extk=>$ext}}
<p>{{$ext.name}} [{{$ext.tips}}]</p>
{{/foreach}}
{{/if}}
\ No newline at end of file
<!-- 用户信息 -->
{{if !empty($module_data)}}
{{if !empty($module_data['user'])}}
<img src="{{$module_data.user.avatar}}" alt="{{$module_data.user.user_name_view}}" class="am-img-thumbnail am-radius am-align-left am-margin-right-xs am-margin-bottom-0" width="35" height="35" />
<ul class="user-base">
<li>名称:{{if empty($module_data['user']['username'])}}<span class="cr-ccc">未填写</span>{{else /}}{{$module_data.user.username}}{{/if}}</li>
<li>昵称:{{if empty($module_data['user']['nickname'])}}<span class="cr-ccc">未填写</span>{{else /}}{{$module_data.user.nickname}}{{/if}}</li>
<li>手机:{{if empty($module_data['user']['mobile'])}}<span class="cr-ccc">未填写</span>{{else /}}{{$module_data.user.mobile}}{{/if}}</li>
<li>邮箱:{{if empty($module_data['user']['email'])}}<span class="cr-ccc">未填写</span>{{else /}}{{$module_data.user.email}}{{/if}}</li>
</ul>
{{else /}}
用户信息异常
{{/if}}
{{/if}}
\ 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 form-search" method="post" action="{{:MyUrl('admin/paylog/index')}}" request-type="form">
<div class="thin">
<div class="am-input-group am-input-group-sm am-fl so">
<input type="text" autocomplete="off" name="keywords" class="am-radius" placeholder="姓名/手机/昵称/支付平台单号" value="{{if !empty($params.keywords)}}{{$params.keywords}}{{/if}}" />
<span class="am-input-group-btn">
<button class="am-btn am-btn-default am-radius" type="submit" data-am-loading="{spinner:'circle-o-notch', loadingText:'搜索中...'}">搜索</button>
</span>
</div>
<label class="am-fl thin_sub more-submit">
更多筛选条件
{{if isset($params['is_more']) and $params['is_more'] eq 1}}
<input type="checkbox" name="is_more" value="1" id="is_more" checked />
<i class="am-icon-angle-up"></i>
{{else /}}
<input type="checkbox" name="is_more" value="1" id="is_more" />
<i class="am-icon-angle-down"></i>
{{/if}}
</label>
</div>
<table class="so-list more-where {{if !isset($params['is_more'])}}none{{/if}}">
<tbody>
<tr>
<td>
<span>性别:</span>
<select name="gender" class="chosen-select" data-placeholder="性别...">
<option value="-1">性别...</option>
{{foreach $common_gender_list as $v}}
<option value="{{$v.id}}" {{if isset($params['gender']) and $params['gender'] eq $v['id']}}selected{{/if}}>{{$v.name}}</option>
{{/foreach}}
</select>
</td>
<td>
<span>支付:</span>
<select name="pay_type" class="chosen-select" data-placeholder="支付类型...">
<option value="">支付类型...</option>
{{foreach $common_pay_type_list as $v}}
{{if !empty($v['id']) and !empty($v['name'])}}
<option value="{{$v.id}}" {{if isset($params['pay_type']) and $params['pay_type'] eq $v['id']}}selected{{/if}}>{{$v.name}}</option>
{{/if}}
{{/foreach}}
</select>
</td>
</tr>
<tr>
<td>
<span>业务:</span>
<select name="business_type" class="chosen-select" data-placeholder="业务类型...">
<option value="-1">业务类型...</option>
{{foreach $common_business_type_list as $v}}
<option value="{{$v.id}}" {{if isset($params['business_type']) and $params['business_type'] eq $v['id']}}selected{{/if}}>{{$v.name}}</option>
{{/foreach}}
</select>
</td>
<td class="price">
<span>金额:</span>
<span>
<input type="text" autocomplete="off" name="price_start" class="am-form-field am-input-sm am-radius" placeholder="最低支付金额" value="{{if !empty($params.price_start)}}{{$params.price_start}}{{/if}}" data-validation-message="支付金额格式有误" autocomplete="off" />
</span>
<em class="text-grey">~</em>
<span>
<input type="text" autocomplete="off" name="price_end" class="am-form-field am-input-sm am-radius" placeholder="最高支付金额" value="{{if !empty($params.price_end)}}{{$params.price_end}}{{/if}}" pattern="^[0-9]{4}-[0-9]{2}-[0-9]{2}$" data-validation-message="支付金额格式有误" autocomplete="off" />
</span>
</td>
</tr>
<tr>
<td class="time">
<span>时间:</span>
<span>
<input type="text" autocomplete="off" name="time_start" class="am-form-field am-input-sm am-radius Wdate" placeholder="起始时间" value="{{if !empty($params.time_start)}}{{$params.time_start}}{{/if}}" data-validation-message="日期格式有误" onclick="WdatePicker({firstDayOfWeek:1,dateFmt:'yyyy-MM-dd'})" autocomplete="off" /><i class="am-icon-calendar"></i>
</span>
<em class="text-grey">~</em>
<span>
<input type="text" autocomplete="off" name="time_end" class="am-form-field am-input-sm am-radius Wdate" placeholder="结束时间" value="{{if !empty($params.time_end)}}{{$params.time_end}}{{/if}}" pattern="^[0-9]{4}-[0-9]{2}-[0-9]{2}$" data-validation-message="日期格式有误" onclick="WdatePicker({firstDayOfWeek:1,dateFmt:'yyyy-MM-dd'})" autocomplete="off" /><i class="am-icon-calendar"></i>
</span>
</td>
<td>
<button type="submit" class="am-btn am-btn-primary am-radius am-btn-xs btn-loading-example" data-am-loading="{spinner:'circle-o-notch', loadingText:'搜索中...'}">搜索</button>
<a href="{{:MyUrl('admin/paylog/index')}}" class="am-btn am-btn-warning am-radius am-btn-sm reset-submit">清除条件</a>
</td>
</tr>
</tbody>
</table>
</form>
<!-- form end -->
<!-- list start -->
<div class="am-scrollable-horizontal am-table-scrollable-horizontal am-margin-top-sm">
<table class="am-table am-table-striped am-table-hover am-table-bordered am-text-nowrap">
<thead>
<tr>
<th class="am-grid-sm">用户信息</th>
<th>支付类型</th>
<th>业务类型</th>
<th>业务订单id</th>
<th>支付平台交易号</th>
<th>支付平台用户帐号</th>
<th>支付金额</th>
<th>订单实际金额</th>
<th>订单名称</th>
<th>支付时间</th>
</tr>
</thead>
<tbody>
{{if !empty($data_list)}}
{{foreach $data_list as $v}}
<tr>
<td class="am-text-middle">
<ul class="user-base">
<li>名称:{{if empty($v['username'])}}<span class="cr-ccc">未填写</span>{{else /}}{{$v.username}}{{/if}}</li>
<li>昵称:{{if empty($v['nickname'])}}<span class="cr-ccc">未填写</span>{{else /}}{{$v.nickname}}{{/if}}</li>
<li>手机:{{if empty($v['mobile'])}}<span class="cr-ccc">未填写</span>{{else /}}{{$v.mobile}}{{/if}}</li>
<li>邮箱:{{if empty($v['email'])}}<span class="cr-ccc">未填写</span>{{else /}}{{$v.email}}{{/if}}</li>
<li>性别:{{if empty($v['gender_text'])}}<span class="cr-ccc">未填写</span>{{else /}}{{$v.gender_text}}{{/if}}</li>
</ul>
</td>
<td class="am-text-middle">
{{if empty($v['payment_name'])}}<span class="cr-ddd">未填写</span>{{else /}}{{$v.payment_name}}{{/if}}
</td>
<td class="am-text-middle">
{{if empty($v['business_type_name'])}}<span class="cr-ddd">未填写</span>{{else /}}{{$v.business_type_name}}{{/if}}
</td>
<td class="am-text-middle">
{{if empty($v['order_id'])}}<span class="cr-ddd">未填写</span>{{else /}}{{$v.order_id}}{{/if}}
</td>
<td class="am-text-middle">
{{if empty($v['trade_no'])}}<span class="cr-ddd">未填写</span>{{else /}}{{$v.trade_no}}{{/if}}
</td>
<td class="am-text-middle">
{{if empty($v['buyer_user'])}}<span class="cr-ddd">未填写</span>{{else /}}{{$v.buyer_user}}{{/if}}
</td>
<td class="am-text-middle">
{{if empty($v['pay_price'])}}<span class="cr-ddd">未填写</span>{{else /}}<span class="am-text-danger">{{$price_symbol}}{{$v.pay_price}}</span>{{/if}}
</td>
<td class="am-text-middle">
{{if empty($v['total_price'])}}<span class="cr-ddd">未填写</span>{{else /}}{{$price_symbol}}{{$v.total_price}}{{/if}}
</td>
<td class="am-text-middle">
{{if empty($v['subject'])}}<span class="cr-ddd">未填写</span>{{else /}}{{$v.subject}}{{/if}}
</td>
<td class="am-text-middle">
{{if empty($v['add_time_time'])}}<span class="cr-ddd">未填写</span>{{else /}}{{$v.add_time_time}}{{/if}}
</td>
</tr>
{{/foreach}}
{{/if}}
</tbody>
</table>
{{if empty($data_list)}}
<div class="table-no"><i class="am-icon-warning"></i> 没有相关数据</div>
{{/if}}
</div>
<!-- list end -->
<!-- page start -->
{{if !empty($data_list)}}
{{$page_html|raw}}
{{/if}}
<!-- page end -->
</div>
</div>
<!-- right content end -->
<!-- footer start -->
{{include file="public/footer" /}}
<!-- footer end -->
\ No newline at end of file
<!-- 继承公共的 form -->
{{extend name="public/module/form" /}}
\ No newline at end of file
<!-- 支付方式 -->
{{if !empty($module_data)}}
{{if isset($module_data['payment_name'])}}
<p>{{$module_data.payment_name}}</p>
{{/if}}
{{if isset($module_data['payment'])}}
<p>
<span class="am-badge am-radius">{{$module_data.payment}}</span>
</p>
{{/if}}
{{/if}}
\ No newline at end of file
......@@ -17,7 +17,9 @@
<label>适用终端</label>
<select name="apply_terminal" class="am-radius chosen-select" multiple="multiple" minchecked="1" data-placeholder="可选择..." data-validation-message="至少选择一个适用终端" required>
{{foreach $common_platform_type as $v}}
<option value="{{$v.value}}" {{if isset($data['apply_terminal']) and in_array($v['value'], $data['apply_terminal'])}}selected{{/if}}>{{$v.name}}</option>
{{if isset($data) and isset($data['apply_terminal_old']) and is_array($data['apply_terminal_old']) and in_array($v['value'], $data['apply_terminal_old'])}}
<option value="{{$v.value}}" {{if isset($data['apply_terminal']) and in_array($v['value'], $data['apply_terminal'])}}selected{{/if}}>{{$v.name}}</option>
{{/if}}
{{/foreach}}
</select>
</div>
......
{{include file="public/header" /}}
<!-- right content start -->
<div class="content-right">
<div class="content">
<!-- form start -->
<form class="am-form form-validation form-search" method="post" action="{{:MyUrl('admin/refundlog/index')}}" request-type="form">
<div class="thin">
<div class="am-input-group am-input-group-sm am-fl so">
<input type="text" autocomplete="off" name="keywords" class="am-radius" placeholder="姓名/手机/昵称/支付平台单号" value="{{if !empty($params.keywords)}}{{$params.keywords}}{{/if}}" />
<span class="am-input-group-btn">
<button class="am-btn am-btn-default am-radius" type="submit" data-am-loading="{spinner:'circle-o-notch', loadingText:'搜索中...'}">搜索</button>
</span>
</div>
<label class="am-fl thin_sub more-submit">
更多筛选条件
{{if isset($params['is_more']) and $params['is_more'] eq 1}}
<input type="checkbox" name="is_more" value="1" id="is_more" checked />
<i class="am-icon-angle-up"></i>
{{else /}}
<input type="checkbox" name="is_more" value="1" id="is_more" />
<i class="am-icon-angle-down"></i>
{{/if}}
</label>
</div>
<table class="so-list more-where {{if !isset($params['is_more'])}}none{{/if}}">
<tbody>
<tr>
<td>
<span>性别:</span>
<select name="gender" class="chosen-select" data-placeholder="性别...">
<option value="-1">性别...</option>
{{foreach $common_gender_list as $v}}
<option value="{{$v.id}}" {{if isset($params['gender']) and $params['gender'] eq $v['id']}}selected{{/if}}>{{$v.name}}</option>
{{/foreach}}
</select>
</td>
<td>
<span>支付:</span>
<select name="pay_type" class="chosen-select" data-placeholder="支付类型...">
<option value="">支付类型...</option>
{{foreach $common_pay_type_list as $v}}
{{if !empty($v['id']) and !empty($v['name'])}}
<option value="{{$v.id}}" {{if isset($params['pay_type']) and $params['pay_type'] eq $v['id']}}selected{{/if}}>{{$v.name}}</option>
{{/if}}
{{/foreach}}
</select>
</td>
</tr>
<tr>
<td>
<span>业务:</span>
<select name="business_type" class="chosen-select" data-placeholder="业务类型...">
<option value="-1">业务类型...</option>
{{foreach $common_business_type_list as $v}}
<option value="{{$v.id}}" {{if isset($params['business_type']) and $params['business_type'] eq $v['id']}}selected{{/if}}>{{$v.name}}</option>
{{/foreach}}
</select>
</td>
<td class="price">
<span>金额:</span>
<span>
<input type="text" autocomplete="off" name="price_start" class="am-form-field am-input-sm am-radius" placeholder="最低支付金额" value="{{if !empty($params.price_start)}}{{$params.price_start}}{{/if}}" data-validation-message="支付金额格式有误" autocomplete="off" />
</span>
<em class="text-grey">~</em>
<span>
<input type="text" autocomplete="off" name="price_end" class="am-form-field am-input-sm am-radius" placeholder="最高支付金额" value="{{if !empty($params.price_end)}}{{$params.price_end}}{{/if}}" pattern="^[0-9]{4}-[0-9]{2}-[0-9]{2}$" data-validation-message="支付金额格式有误" autocomplete="off" />
</span>
</td>
</tr>
<tr>
<td class="time">
<span>时间:</span>
<span>
<input type="text" autocomplete="off" name="time_start" class="am-form-field am-input-sm am-radius Wdate" placeholder="起始时间" value="{{if !empty($params.time_start)}}{{$params.time_start}}{{/if}}" data-validation-message="日期格式有误" onclick="WdatePicker({firstDayOfWeek:1,dateFmt:'yyyy-MM-dd'})" autocomplete="off" /><i class="am-icon-calendar"></i>
</span>
<em class="text-grey">~</em>
<span>
<input type="text" autocomplete="off" name="time_end" class="am-form-field am-input-sm am-radius Wdate" placeholder="结束时间" value="{{if !empty($params.time_end)}}{{$params.time_end}}{{/if}}" pattern="^[0-9]{4}-[0-9]{2}-[0-9]{2}$" data-validation-message="日期格式有误" onclick="WdatePicker({firstDayOfWeek:1,dateFmt:'yyyy-MM-dd'})" autocomplete="off" /><i class="am-icon-calendar"></i>
</span>
</td>
<td>
<button type="submit" class="am-btn am-btn-primary am-radius am-btn-xs btn-loading-example" data-am-loading="{spinner:'circle-o-notch', loadingText:'搜索中...'}">搜索</button>
<a href="{{:MyUrl('admin/refundlog/index')}}" class="am-btn am-btn-warning am-radius am-btn-sm reset-submit">清除条件</a>
</td>
</tr>
</tbody>
</table>
</form>
<!-- form end -->
<!-- list start -->
<div class="am-scrollable-horizontal am-table-scrollable-horizontal am-margin-top-sm">
<table class="am-table am-table-striped am-table-hover am-table-bordered am-text-nowrap">
<thead>
<tr>
<th class="am-grid-sm">用户信息</th>
<th>支付类型</th>
<th>业务类型</th>
<th>业务订单id</th>
<th>支付平台交易号</th>
<th>支付平台用户帐号</th>
<th>退款方式</th>
<th>退款金额</th>
<th>订单支付金额</th>
<th class="am-grid-sm">描述</th>
<th>退款时间</th>
</tr>
</thead>
<tbody>
{{if !empty($data_list)}}
{{foreach $data_list as $v}}
<tr>
<td class="am-text-middle">
<ul class="user-base">
<li>名称:{{if empty($v['username'])}}<span class="cr-ccc">未填写</span>{{else /}}{{$v.username}}{{/if}}</li>
<li>昵称:{{if empty($v['nickname'])}}<span class="cr-ccc">未填写</span>{{else /}}{{$v.nickname}}{{/if}}</li>
<li>手机:{{if empty($v['mobile'])}}<span class="cr-ccc">未填写</span>{{else /}}{{$v.mobile}}{{/if}}</li>
<li>邮箱:{{if empty($v['email'])}}<span class="cr-ccc">未填写</span>{{else /}}{{$v.email}}{{/if}}</li>
<li>性别:{{if empty($v['gender_text'])}}<span class="cr-ccc">未填写</span>{{else /}}{{$v.gender_text}}{{/if}}</li>
</ul>
</td>
<td class="am-text-middle">
{{if empty($v['payment_name'])}}<span class="cr-ddd">未填写</span>{{else /}}{{$v.payment_name}}{{/if}}
</td>
<td class="am-text-middle">
{{if empty($v['business_type_name'])}}<span class="cr-ddd">未填写</span>{{else /}}{{$v.business_type_name}}{{/if}}
</td>
<td class="am-text-middle">
{{if empty($v['order_id'])}}<span class="cr-ddd">未填写</span>{{else /}}{{$v.order_id}}{{/if}}
</td>
<td class="am-text-middle">
{{if empty($v['trade_no'])}}<span class="cr-ddd">未填写</span>{{else /}}{{$v.trade_no}}{{/if}}
</td>
<td class="am-text-middle">
{{if empty($v['buyer_user'])}}<span class="cr-ddd">未填写</span>{{else /}}{{$v.buyer_user}}{{/if}}
</td>
<td class="am-text-middle">
{{if empty($v['refundment_text'])}}<span class="cr-ddd">未填写</span>{{else /}}<span class="am-text-success">{{$v.refundment_text}}</span>{{/if}}
</td>
<td class="am-text-middle">
{{if empty($v['refund_price'])}}<span class="cr-ddd">未填写</span>{{else /}}<span class="am-text-danger">{{$price_symbol}}{{$v.refund_price}}</span>{{/if}}
</td>
<td class="am-text-middle">
{{if empty($v['pay_price'])}}<span class="cr-ddd">未填写</span>{{else /}}{{$price_symbol}}{{$v.pay_price}}{{/if}}
</td>
<td class="am-text-middle am-nowrap-initial">
{{if empty($v['msg'])}}<span class="cr-ddd">未填写</span>{{else /}}{{$v.msg}}{{/if}}
</td>
<td class="am-text-middle">
{{if empty($v['add_time_time'])}}<span class="cr-ddd">未填写</span>{{else /}}{{$v.add_time_time}}{{/if}}
</td>
</tr>
{{/foreach}}
{{/if}}
</tbody>
</table>
{{if empty($data_list)}}
<div class="table-no"><i class="am-icon-warning"></i> 没有相关数据</div>
{{/if}}
</div>
<!-- list end -->
<!-- page start -->
{{if !empty($data_list)}}
{{$page_html|raw}}
{{/if}}
<!-- page end -->
</div>
</div>
<!-- right content end -->
<!-- footer start -->
{{include file="public/footer" /}}
<!-- footer end -->
\ No newline at end of file
<!-- 继承公共的 form -->
{{extend name="public/module/form" /}}
\ No newline at end of file
<!-- 支付方式 -->
{{if !empty($module_data)}}
{{if isset($module_data['payment_name'])}}
<p>{{$module_data.payment_name}}</p>
{{/if}}
{{if isset($module_data['payment'])}}
<p>
<span class="am-badge am-radius">{{$module_data.payment}}</span>
</p>
{{/if}}
{{/if}}
\ No newline at end of file
......@@ -59,7 +59,7 @@ class UserIntegral extends Common
$where = IntegralService::UserIntegralLogListWhere($params);
// 获取总数
$total = IntegralService::UserIntegralLogTotal($where);
$total = IntegralService::IntegralLogTotal($where);
$page_total = ceil($total/$number);
$start = intval(($page-1)*$number);
......@@ -69,7 +69,7 @@ class UserIntegral extends Common
'n' => $number,
'where' => $where,
);
$data = IntegralService::UserIntegralLogList($data_params);
$data = IntegralService::IntegralLogList($data_params);
// 返回数据
$result = [
......
......@@ -59,7 +59,7 @@ class UserIntegral extends Common
$where = IntegralService::UserIntegralLogListWhere($params);
// 获取总数
$total = IntegralService::UserIntegralLogTotal($where);
$total = IntegralService::IntegralLogTotal($where);
// 分页
$page_params = array(
......@@ -78,7 +78,7 @@ class UserIntegral extends Common
'n' => $number,
'where' => $where,
);
$data = IntegralService::UserIntegralLogList($data_params);
$data = IntegralService::IntegralLogList($data_params);
$this->assign('data_list', $data['data']);
// 操作类型
......
......@@ -70,6 +70,64 @@ class IntegralService
return false;
}
/**
* 列表
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2018-09-29
* @desc description
* @param [array] $params [输入参数]
*/
public static function IntegralLogList($params = [])
{
$where = empty($params['where']) ? [] : $params['where'];
$m = isset($params['m']) ? intval($params['m']) : 0;
$n = isset($params['n']) ? intval($params['n']) : 10;
$field = '*';
$order_by = empty($params['order_by']) ? 'id desc' : $params['order_by'];
// 获取数据列表
$data = Db::name('UserIntegralLog')->where($where)->field($field)->limit($m, $n)->order($order_by)->select();
if(!empty($data))
{
$integral_log_type_list = lang('common_integral_log_type_list');
foreach($data as &$v)
{
// 用户信息
if(isset($v['user_id']))
{
if(isset($params['is_public']) && $params['is_public'] == 0)
{
$v['user'] = UserService::GetUserViewInfo($v['user_id']);
}
}
// 操作类型
$v['type_text'] = $integral_log_type_list[$v['type']]['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 IntegralLogTotal($where = [])
{
return (int) Db::name('UserIntegralLog')->where($where)->count();
}
/**
* 前端积分列表条件
* @author Devil
......@@ -117,54 +175,6 @@ class IntegralService
return $where;
}
/**
* 用户积分日志总数
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2018-09-29
* @desc description
* @param [array] $where [条件]
*/
public static function UserIntegralLogTotal($where = [])
{
return (int) Db::name('UserIntegralLog')->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 UserIntegralLogList($params = [])
{
$where = empty($params['where']) ? [] : $params['where'];
$m = isset($params['m']) ? intval($params['m']) : 0;
$n = isset($params['n']) ? intval($params['n']) : 10;
$order_by = empty($params['order_by']) ? 'id desc' : $params['order_by'];
// 获取数据列表
$data = Db::name('UserIntegralLog')->where($where)->limit($m, $n)->order($order_by)->select();
if(!empty($data))
{
$common_integral_log_type_list = lang('common_integral_log_type_list');
foreach($data as &$v)
{
// 操作类型
$v['type_name'] = $common_integral_log_type_list[$v['type']]['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
......@@ -232,103 +242,5 @@ class IntegralService
}
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.email,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
......@@ -11,6 +11,7 @@
namespace app\service;
use think\Db;
use app\service\UserService;
/**
* 消息服务层
......@@ -173,9 +174,10 @@ class MessageService
$m = isset($params['m']) ? intval($params['m']) : 0;
$n = isset($params['n']) ? intval($params['n']) : 10;
$order_by = empty($params['order_by']) ? 'id desc' : $params['order_by'];
$field = '*';
// 获取数据列表
$data = Db::name('Message')->where($where)->limit($m, $n)->order($order_by)->select();
$data = Db::name('Message')->where($where)->field($field)->limit($m, $n)->order($order_by)->select();
if(!empty($data))
{
$common_business_type_list = lang('common_business_type_list');
......@@ -183,14 +185,26 @@ class MessageService
$common_message_type_list = lang('common_message_type_list');
foreach($data as &$v)
{
// 用户信息
if(isset($v['user_id']))
{
if(isset($params['is_public']) && $params['is_public'] == 0)
{
$v['user'] = UserService::GetUserViewInfo($v['user_id']);
}
}
// 消息类型
$v['type_name'] = $common_message_type_list[$v['type']]['name'];
$v['type_text'] = $common_message_type_list[$v['type']]['name'];
// 是否已读
$v['is_read_name'] = $common_is_read_list[$v['is_read']]['name'];
$v['is_read_text'] = $common_is_read_list[$v['is_read']]['name'];
// 业务类型
$v['business_type_name'] = $common_business_type_list[$v['business_type']]['name'];
$v['business_type_text'] = $common_business_type_list[$v['business_type']]['name'];
// 用户是否已删除
$v['user_is_delete_time_text'] = ($v['user_is_delete_time'] == 0) ? '否' : '是';
// 时间
$v['add_time_time'] = date('Y-m-d H:i:s', $v['add_time']);
......@@ -231,134 +245,6 @@ class MessageService
return DataReturn('处理成功', 0, $ret);
}
/**
* 后台管理员列表
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2018-09-29
* @desc description
* @param [array] $params [输入参数]
*/
public static function AdminMessageList($params = [])
{
$where = empty($params['where']) ? [] : $params['where'];
$m = isset($params['m']) ? intval($params['m']) : 0;
$n = isset($params['n']) ? intval($params['n']) : 10;
$field = 'm.*,u.username,u.nickname,u.mobile,u.email,u.gender';
$order_by = empty($params['order_by']) ? 'm.id desc' : $params['order_by'];
// 获取数据列表
$data = Db::name('Message')->alias('m')->join(['__USER__'=>'u'], 'u.id=m.user_id')->where($where)->field($field)->limit($m, $n)->order($order_by)->select();
if(!empty($data))
{
$common_business_type_list = lang('common_business_type_list');
$common_is_read_list = lang('common_is_read_list');
$common_message_type_list = lang('common_message_type_list');
$common_gender_list = lang('common_gender_list');
foreach($data as &$v)
{
// 消息类型
$v['type_name'] = $common_message_type_list[$v['type']]['name'];
// 是否已读
$v['is_read_name'] = $common_is_read_list[$v['is_read']]['name'];
// 业务类型
$v['business_type_name'] = $common_business_type_list[$v['business_type']]['name'];
// 用户是否已删除
$v['user_is_delete_time_name'] = ($v['user_is_delete_time'] == 0) ? '否' : '是';
// 性别
$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 AdminMessageTotal($where = [])
{
return (int) Db::name('Message')->alias('m')->join(['__USER__'=>'u'], 'u.id=m.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 AdminMessageListWhere($params = [])
{
$where = [
['m.is_delete_time', '=', 0],
];
// 关键字
if(!empty($params['keywords']))
{
$where[] = ['m.title|m.detail|u.username|u.nickname|u.mobile', 'like', '%'.$params['keywords'].'%'];
}
// 是否更多条件
if(isset($params['is_more']) && $params['is_more'] == 1)
{
// 等值
if(isset($params['business_type']) && $params['business_type'] > -1)
{
$where[] = ['m.business_type', '=', intval($params['business_type'])];
}
if(isset($params['type']) && $params['type'] > -1)
{
$where[] = ['m.type', '=', intval($params['type'])];
}
if(isset($params['is_read']) && $params['is_read'] > -1)
{
$where[] = ['m.is_read', '=', intval($params['is_read'])];
}
if(isset($params['gender']) && $params['gender'] > -1)
{
$where[] = ['u.gender', '=', intval($params['gender'])];
}
if(isset($params['user_is_delete_time']) && $params['user_is_delete_time'] > -1)
{
if(intval($params['user_is_delete_time']) == 0)
{
$where[] = ['m.user_is_delete_time', '=', 0];
} else {
$where[] = ['m.user_is_delete_time', '>', 0];
}
}
if(!empty($params['time_start']))
{
$where[] = ['m.add_time', '>', strtotime($params['time_start'])];
}
if(!empty($params['time_end']))
{
$where[] = ['m.add_time', '<', strtotime($params['time_end'])];
}
}
return $where;
}
/**
* 删除
* @author Devil
......@@ -370,27 +256,24 @@ class MessageService
*/
public static function MessageDelete($params = [])
{
// 请求参数
$p = [
[
'checked_type' => 'empty',
'key_name' => 'id',
'error_msg' => '操作id有误',
],
];
$ret = ParamsChecked($params, $p);
if($ret !== true)
// 参数是否有误
if(empty($params['ids']))
{
return DataReturn($ret, -1);
return DataReturn('操作id有误', -1);
}
// 是否数组
if(!is_array($params['ids']))
{
$params['ids'] = explode(',', $params['ids']);
}
// 删除操作
if(Db::name('Message')->where(['id'=>$params['id']])->delete())
if(Db::name('Message')->where(['id'=>$params['ids']])->delete())
{
return DataReturn('删除成功');
}
return DataReturn('删除失败或资源不存在', -100);
return DataReturn('删除失败', -100);
}
}
?>
\ No newline at end of file
......@@ -19,6 +19,7 @@ use app\service\RegionService;
use app\service\ExpressService;
use app\service\ResourcesService;
use app\service\PayLogService;
use app\service\UserService;
/**
* 订单服务层
......
......@@ -68,12 +68,12 @@ class PayLogService
*/
public static function PayLogTypeList($params = [])
{
$data = Db::name('PayLog')->field('payment AS id, payment_name AS name')->group('id')->select();
$data = Db::name('PayLog')->field('payment as id, payment_name as name')->group('payment,payment_name')->select();
return DataReturn('处理成功', 0, $data);
}
/**
* 后台管理员列表
* 列表
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
......@@ -81,27 +81,32 @@ class PayLogService
* @desc description
* @param [array] $params [输入参数]
*/
public static function AdminPayLogList($params = [])
public static function PayLogList($params = [])
{
$where = empty($params['where']) ? [] : $params['where'];
$m = isset($params['m']) ? intval($params['m']) : 0;
$n = isset($params['n']) ? intval($params['n']) : 10;
$field = 'p.*,u.username,u.nickname,u.mobile,u.email,u.gender';
$order_by = empty($params['order_by']) ? 'p.id desc' : $params['order_by'];
$field = '*';
$order_by = empty($params['order_by']) ? 'id desc' : $params['order_by'];
// 获取数据列表
$data = Db::name('PayLog')->alias('p')->join(['__USER__'=>'u'], 'u.id=p.user_id')->where($where)->field($field)->limit($m, $n)->order($order_by)->select();
$data = Db::name('PayLog')->where($where)->field($field)->limit($m, $n)->order($order_by)->select();
if(!empty($data))
{
$common_business_type_list = lang('common_business_type_list');
$common_gender_list = lang('common_gender_list');
$refundment_list = lang('common_business_type_list');
foreach($data as &$v)
{
// 业务类型
$v['business_type_name'] = $common_business_type_list[$v['business_type']]['name'];
// 用户信息
if(isset($v['user_id']))
{
if(isset($params['is_public']) && $params['is_public'] == 0)
{
$v['user'] = UserService::GetUserViewInfo($v['user_id']);
}
}
// 性别
$v['gender_text'] = $common_gender_list[$v['gender']]['name'];
// 业务类型
$v['business_type_text'] = $refundment_list[$v['business_type']]['name'];
// 时间
$v['add_time_time'] = date('Y-m-d H:i:s', $v['add_time']);
......@@ -120,101 +125,9 @@ class PayLogService
* @desc description
* @param [array] $where [条件]
*/
public static function AdminPayLogTotal($where = [])
{
return (int) Db::name('PayLog')->alias('p')->join(['__USER__'=>'u'], 'u.id=p.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 AdminPayLogListWhere($params = [])
{
$where = [];
// 关键字
if(!empty($params['keywords']))
{
$where[] = ['p.trade_no|u.username|u.nickname|u.mobile', 'like', '%'.$params['keywords'].'%'];
}
// 是否更多条件
if(isset($params['is_more']) && $params['is_more'] == 1)
{
// 等值
if(isset($params['business_type']) && $params['business_type'] > -1)
{
$where[] = ['p.business_type', '=', intval($params['business_type'])];
}
if(!empty($params['pay_type']))
{
$where[] = ['p.payment', '=', $params['pay_type']];
}
if(isset($params['gender']) && $params['gender'] > -1)
{
$where[] = ['u.gender', '=', intval($params['gender'])];
}
if(!empty($params['price_start']))
{
$where[] = ['p.pay_price', '>', PriceNumberFormat($params['price_start'])];
}
if(!empty($params['price_end']))
{
$where[] = ['p.pay_price', '<', PriceNumberFormat($params['price_end'])];
}
if(!empty($params['time_start']))
{
$where[] = ['p.add_time', '>', strtotime($params['time_start'])];
}
if(!empty($params['time_end']))
{
$where[] = ['p.add_time', '<', strtotime($params['time_end'])];
}
}
return $where;
}
/**
* 删除
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2018-12-18
* @desc description
* @param [array] $params [输入参数]
*/
public static function PayLogDelete($params = [])
public static function PayLogTotal($where = [])
{
// 请求参数
$p = [
[
'checked_type' => 'empty',
'key_name' => 'id',
'error_msg' => '操作id有误',
],
];
$ret = ParamsChecked($params, $p);
if($ret !== true)
{
return DataReturn($ret, -1);
}
// 删除操作
if(Db::name('PayLog')->where(['id'=>$params['id']])->delete())
{
return DataReturn('删除成功');
}
return DataReturn('删除失败或资源不存在', -100);
return (int) Db::name('PayLog')->where($where)->count();
}
}
?>
\ No newline at end of file
......@@ -164,20 +164,19 @@ class PaymentService
private static function DataAnalysis($data)
{
return [
'name' => isset($data['base']['name']) ? htmlentities($data['base']['name']) : '',
'version' => isset($data['base']['version']) ? htmlentities($data['base']['version']) : '',
'apply_version' => isset($data['base']['apply_version']) ? htmlentities($data['base']['apply_version']) : '',
'desc' => isset($data['base']['desc']) ? $data['base']['desc'] : '',
'author' => isset($data['base']['author']) ? htmlentities($data['base']['author']) : '',
'author_url' => isset($data['base']['author_url']) ? htmlentities($data['base']['author_url']) : '',
'element' => isset($data['element']) ? $data['element'] : [],
'logo' => '',
'is_enable' => 0,
'is_open_user' => 0,
'is_install' => 0,
'apply_terminal'=> empty($data['base']['apply_terminal']) ? array_column(lang('common_platform_type'), 'value') : $data['base']['apply_terminal'],
'config' => '',
'name' => isset($data['base']['name']) ? htmlentities($data['base']['name']) : '',
'version' => isset($data['base']['version']) ? htmlentities($data['base']['version']) : '',
'apply_version' => isset($data['base']['apply_version']) ? htmlentities($data['base']['apply_version']) : '',
'desc' => isset($data['base']['desc']) ? $data['base']['desc'] : '',
'author' => isset($data['base']['author']) ? htmlentities($data['base']['author']) : '',
'author_url' => isset($data['base']['author_url']) ? htmlentities($data['base']['author_url']) : '',
'element' => isset($data['element']) ? $data['element'] : [],
'logo' => '',
'is_enable' => 0,
'is_open_user' => 0,
'is_install' => 0,
'apply_terminal' => empty($data['base']['apply_terminal']) ? array_column(lang('common_platform_type'), 'value') : $data['base']['apply_terminal'],
'config' => '',
];
}
......@@ -202,7 +201,7 @@ class PaymentService
$where['is_open_user'] = intval($params['is_open_user']);
}
$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();
$data = Db::name('Payment')->where($where)->field('id,logo,name,sort,payment,config,apply_terminal,apply_terminal_old,element,is_enable,is_open_user')->order('sort asc')->select();
if(!empty($data) && is_array($data))
{
foreach($data as &$v)
......@@ -212,6 +211,7 @@ class PaymentService
$v['element'] = empty($v['element']) ? '' : json_decode($v['element'], true);
$v['config'] = empty($v['config']) ? '' : json_decode($v['config'], true);
$v['apply_terminal'] = empty($v['apply_terminal']) ? '' : json_decode($v['apply_terminal'], true);
$v['apply_terminal_old'] = empty($v['apply_terminal_old']) ? '' : json_decode($v['apply_terminal_old'], true);
}
}
return $data;
......@@ -551,9 +551,11 @@ class PaymentService
if($config !== false)
{
$data = self::DataAnalysis($config);
$apply_terminal = empty($data['apply_terminal']) ? '' : json_encode($data['apply_terminal']);
$data['payment'] = $payment;
$data['element'] = empty($data['element']) ? '' : json_encode($data['element']);
$data['apply_terminal'] = empty($data['apply_terminal']) ? '' : json_encode($data['apply_terminal']);
$data['apply_terminal_old'] = $apply_terminal;
$data['apply_terminal'] = $apply_terminal;
$data['sort'] = 0;
$data['add_time'] = time();
......
......@@ -11,6 +11,7 @@
namespace app\service;
use think\Db;
use app\service\UserService;
/**
* 退款日志服务层
......@@ -72,12 +73,12 @@ class RefundLogService
*/
public static function RefundLogTypeList($params = [])
{
$data = Db::name('RefundLog')->field('payment AS id, payment_name AS name')->group('id')->select();
$data = Db::name('RefundLog')->field('payment as id, payment_name as name')->group('payment,payment_name')->select();
return DataReturn('处理成功', 0, $data);
}
/**
* 后台管理员列表
* 列表
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
......@@ -85,31 +86,36 @@ class RefundLogService
* @desc description
* @param [array] $params [输入参数]
*/
public static function AdminRefundLogList($params = [])
public static function RefundLogList($params = [])
{
$where = empty($params['where']) ? [] : $params['where'];
$m = isset($params['m']) ? intval($params['m']) : 0;
$n = isset($params['n']) ? intval($params['n']) : 10;
$field = 'r.*,u.username,u.nickname,u.mobile,u.email,u.gender';
$order_by = empty($params['order_by']) ? 'r.id desc' : $params['order_by'];
$field = '*';
$order_by = empty($params['order_by']) ? 'id desc' : $params['order_by'];
// 获取数据列表
$data = Db::name('RefundLog')->alias('r')->join(['__USER__'=>'u'], 'u.id=r.user_id')->where($where)->field($field)->limit($m, $n)->order($order_by)->select();
$data = Db::name('RefundLog')->where($where)->field($field)->limit($m, $n)->order($order_by)->select();
if(!empty($data))
{
$common_business_type_list = lang('common_business_type_list');
$common_gender_list = lang('common_gender_list');
$common_order_aftersale_refundment_list = lang('common_order_aftersale_refundment_list');
$business_type_list = lang('common_business_type_list');
$refundment_list = lang('common_order_aftersale_refundment_list');
foreach($data as &$v)
{
// 业务类型
$v['business_type_name'] = $common_business_type_list[$v['business_type']]['name'];
// 用户信息
if(isset($v['user_id']))
{
if(isset($params['is_public']) && $params['is_public'] == 0)
{
$v['user'] = UserService::GetUserViewInfo($v['user_id']);
}
}
// 性别
$v['gender_text'] = $common_gender_list[$v['gender']]['name'];
// 业务类型
$v['business_type_text'] = $business_type_list[$v['business_type']]['name'];
// 退款方式
$v['refundment_text'] = $common_order_aftersale_refundment_list[$v['refundment']]['name'];
$v['refundment_text'] = $refundment_list[$v['refundment']]['name'];
// 时间
$v['add_time_time'] = date('Y-m-d H:i:s', $v['add_time']);
......@@ -120,7 +126,7 @@ class RefundLogService
}
/**
* 后台总数
* 总数
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
......@@ -128,101 +134,9 @@ class RefundLogService
* @desc description
* @param [array] $where [条件]
*/
public static function AdminRefundLogTotal($where = [])
{
return (int) Db::name('RefundLog')->alias('r')->join(['__USER__'=>'u'], 'u.id=r.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 AdminRefundLogListWhere($params = [])
{
$where = [];
// 关键字
if(!empty($params['keywords']))
{
$where[] = ['r.trade_no|u.username|u.nickname|u.mobile', 'like', '%'.$params['keywords'].'%'];
}
// 是否更多条件
if(isset($params['is_more']) && $params['is_more'] == 1)
{
// 等值
if(isset($params['business_type']) && $params['business_type'] > -1)
{
$where[] = ['r.business_type', '=', intval($params['business_type'])];
}
if(!empty($params['pay_type']))
{
$where[] = ['r.payment', '=', $params['pay_type']];
}
if(isset($params['gender']) && $params['gender'] > -1)
{
$where[] = ['u.gender', '=', intval($params['gender'])];
}
if(!empty($params['price_start']))
{
$where[] = ['r.pay_price', '>', PriceNumberFormat($params['price_start'])];
}
if(!empty($params['price_end']))
{
$where[] = ['r.pay_price', '<', PriceNumberFormat($params['price_end'])];
}
if(!empty($params['time_start']))
{
$where[] = ['r.add_time', '>', strtotime($params['time_start'])];
}
if(!empty($params['time_end']))
{
$where[] = ['r.add_time', '<', strtotime($params['time_end'])];
}
}
return $where;
}
/**
* 删除
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2018-12-18
* @desc description
* @param [array] $params [输入参数]
*/
public static function RefundLogDelete($params = [])
public static function RefundLogTotal($where = [])
{
// 请求参数
$p = [
[
'checked_type' => 'empty',
'key_name' => 'id',
'error_msg' => '操作id有误',
],
];
$ret = ParamsChecked($params, $p);
if($ret !== true)
{
return DataReturn($ret, -1);
}
// 删除操作
if(Db::name('RefundLog')->where(['id'=>$params['id']])->delete())
{
return DataReturn('删除成功');
}
return DataReturn('删除失败或资源不存在', -100);
return (int) Db::name('RefundLog')->where($where)->count();
}
}
?>
\ No newline at end of file
此差异已折叠。
......@@ -455,7 +455,7 @@ class Alipay
}
//submit按钮控件请不要含有name属性
$html .= "<input type='submit' value='ok' style='display:none;''></form>";
$html .= "<input type='submit' value='ok' style='display:none;'></form>";
$html .= "<script>document.forms['alipaysubmit'].submit();</script>";
......
<?php
// +----------------------------------------------------------------------
// | ShopXO 国内领先企业级B2C免费开源电商系统
// +----------------------------------------------------------------------
// | Copyright (c) 2011~2019 http://shopxo.net All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: Devil
// +----------------------------------------------------------------------
namespace payment;
/**
* iPay88
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2020-06-26
* @desc description
*/
class Ipay88
{
// 插件配置参数
private $config;
/**
* 构造方法
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2018-09-17
* @desc description
* @param [array] $params [输入参数(支付配置参数)]
*/
public function __construct($params = [])
{
$this->config = $params;
}
/**
* 配置信息
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2020-06-26
* @desc description
*/
public function Config()
{
// 基础信息
$base = [
'name' => 'iPay88', // 插件名称
'version' => '1.0.0', // 插件版本
'apply_version' => '不限', // 适用系统版本描述
'apply_terminal'=> ['pc','h5'], // 适用终端 默认全部
'desc' => '适用PC+H5, <a href="http://www.ipay88.com" target="_blank">立即申请</a>', // 插件描述(支持html)
'author' => 'Devil', // 开发者
'author_url' => 'http://shopxo.net/', // 开发者主页
];
// 配置信息
$element = [
[
'element' => 'input',
'type' => 'text',
'default' => '',
'name' => 'account',
'placeholder' => '账户',
'title' => '账户',
'is_required' => 0,
'message' => '请填写账户account',
],
[
'element' => 'input',
'type' => 'text',
'default' => '',
'name' => 'key',
'placeholder' => '密钥key',
'title' => '密钥key',
'is_required' => 0,
'message' => '请填写密钥key',
],
];
return [
'base' => $base,
'element' => $element,
];
}
/**
* 支付入口
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2020-06-26
* @desc description
* @param [array] $params [输入参数]
*/
public function Pay($params = [])
{
// 参数
if(empty($params))
{
return DataReturn('参数不能为空', -1);
}
// 配置信息
if(empty($this->config))
{
return DataReturn('支付缺少配置', -1);
}
// 支付参数
$data_username = $params['user']['user_name_view'];
$data_useremail = $params['user']['email'];
$data_usercontact = $params['user']['mobile'];
$data_vid = trim($this->config['account']);
$data_orderid = $params['order_no'];
$data_vamount = $params['total_price'];
$data_vmoneytype = 'MYR';
$data_vpaykey = trim($this->config['key']);
$data_response_url = $params['call_back_url'];
$data_backend_url = $params['notify_url'];
$data_remark = $params['order_id'];
$ipay_signature = '';
$hash_amount = str_replace([',','.'], '', $data_vamount);
$str = sha1($data_vpaykey . $data_vid . $data_orderid . $hash_amount . $data_vmoneytype);
for ($i=0;$i<strlen($str);$i=$i+2)
{
$ipay_signature .= chr(hexdec(substr($str,$i,2)));
}
$ipay_signature = base64_encode($ipay_signature);
$html = "<form id='ipay88submit' name='ipay88submit' style='text-align:center;' method=post action='https://www.mobile88.com/epayment/entry.asp'>";
$html .= "<input type='hidden' name='MerchantCode' value='".$data_vid."'>";
$html .= "<input type='hidden' name='PaymentId' value=''>";
$html .= "<input type='hidden' name='RefNo' value='".$data_orderid."'>";
$html .= "<input type='hidden' name='Amount' value='".$data_vamount."'>";
$html .= "<input type='hidden' name='Currency' value='".$data_vmoneytype."'>";
$html .= "<input type='hidden' name='ProdDesc' value='".$data_orderid."'>";
$html .= "<input type='hidden' name='UserName' value='".$data_username."'>";
$html .= "<input type='hidden' name='UserEmail' value='".$data_useremail."'>";
$html .= "<input type='hidden' name='UserContact' value='".$data_usercontact."'>";
$html .= "<input type='hidden' name='Remark' value='".$data_remark."'>";
$html .= "<input type='hidden' name='Lang' value='UTF-8'>";
$html .= "<input type='hidden' name='ResponseURL' value='".$data_response_url."'>";
$html .= "<input type='hidden' name='BackendURL' value='".$data_backend_url."'>";
$html .= "<input type='hidden' name='Signature' value='".$ipay_signature."'>";
$html .= "<input type='submit' value='Pay Now via IPAY88'></form>";
//submit按钮控件请不要含有name属性
$html .= "<script>document.forms['ipay88submit'].submit();</script>";
die($html);
}
/**
* 支付回调处理
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2020-06-26
* @desc description
* @param [array] $params [输入参数]
*/
public function Respond($params = [])
{
if(empty($this->config))
{
return DataReturn('配置有误', -1);
}
if(empty($params['RefNo']))
{
return DataReturn('支付失败', -1);
}
if(empty($params['Signature']))
{
return DataReturn('签名为空', -1);
}
// 支付参数
$mer_code = $params['MerchantCode'];
$payment_id = $params['PaymentId'];
$ref_no = $params['RefNo'];
$amount = $params['Amount'];
$currency = $params['Currency'];
$remark = $params['Remark'];
$trans_id = $params['TransId'];
$auth_code = $params['AuthCode'];
$istatus = $params['Status'];
$err_desc = $params['ErrDesc'];
$sign = $params['Signature'];
// 签名
$ipay_signature = '';
$hash_amount = str_replace([',','.'], '', $amount);
$str = sha1($this->config['key'] . $mer_code . $payment_id . $ref_no . $hash_amount . $currency . $istatus);
for($i=0; $i<strlen($str); $i=$i+2)
{
$ipay_signature .= chr(hexdec(substr($str, $i, 2)));
}
$ipay_signature = base64_encode($ipay_signature);
if($sign == $ipay_signature && $istatus == '1')
{
return DataReturn('支付成功', 0, $this->ReturnData($params));
}
return DataReturn('签名错误', -1);
}
/**
* 返回数据统一格式
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2020-06-26
* @desc description
* @param [array] $data [返回数据]
*/
private function ReturnData($data)
{
// 返回数据固定基础参数
$data['trade_no'] = isset($data['MerchantCode']) ? $data['RefNo'] : ''; // 支付平台 - 订单号
$data['buyer_user'] = isset($data['TransId']) ? $data['TransId'] : ''; // 支付平台 - 用户
$data['out_trade_no'] = isset($data['RefNo']) ? $data['RefNo'] : ''; // 本系统发起支付的 - 订单号
$data['subject'] = isset($data['Remark']) ? $data['Remark'] : ''; // 本系统发起支付的 - 商品名称
$data['pay_price'] = isset($data['Amount']) ? $data['Amount'] : 0; // 本系统发起支付的 - 总价
return $data;
}
}
?>
\ No newline at end of file
......@@ -51,7 +51,7 @@ define('APP_PATH', ROOT.'application'.DS);
// 请求应用 [web, app] 默认web(ios|android|小程序 均为app)
define('APPLICATION', empty($_REQUEST['application']) ? 'web' : trim($_REQUEST['application']));
// 请求客户端 [pc, h5, ios, android, alipay, weixin, baidu] 默认pc(目前系统为自适应,h5需自行校验)
// 请求客户端 [pc, h5, ios, android, alipay, weixin, baidu, toutiao, qq] 默认pc(目前系统为自适应,h5需自行校验)
define('APPLICATION_CLIENT_TYPE', empty($_REQUEST['application_client_type']) ? 'pc' : trim($_REQUEST['application_client_type']));
// 是否ajax
......
......@@ -3,7 +3,7 @@
<view class="data-card bg-white br-b" a:for="{{data_list}}">
<view class="data-box oh">
<import src="/pages/common/nodata.axml" />
<text class="data-title">{{item.type_name}}</text>
<text class="data-title">{{item.type_text}}</text>
<text class="data-time fr">{{item.add_time_time}}</text>
</view>
<view class="data-value">
......
......@@ -3,7 +3,7 @@
<view class="data-card bg-white br-b" s-for="item, index in data_list">
<view class="data-box oh">
<import src="/pages/common/nodata.swan" />
<text class="data-title">{{item.type_name}}</text>
<text class="data-title">{{item.type_text}}</text>
<text class="data-time fr">{{item.add_time_time}}</text>
</view>
<view class="data-value">
......
......@@ -3,7 +3,7 @@
<view class="data-card bg-white br-b" qq:for="{{data_list}}">
<view class="data-box oh">
<import src="/pages/common/nodata.qml" />
<text class="data-title">{{item.type_name}}</text>
<text class="data-title">{{item.type_text}}</text>
<text class="data-time fr">{{item.add_time_time}}</text>
</view>
<view class="data-value">
......
......@@ -3,7 +3,7 @@
<view class="data-card bg-white br-b" tt:for="{{data_list}}">
<view class="data-box oh">
<import src="/pages/common/nodata.ttml" />
<text class="data-title">{{item.type_name}}</text>
<text class="data-title">{{item.type_text}}</text>
<text class="data-time fr">{{item.add_time_time}}</text>
</view>
<view class="data-value">
......
......@@ -3,7 +3,7 @@
<view class="data-card bg-white br-b" wx:for="{{data_list}}">
<view class="data-box oh">
<import src="/pages/common/nodata.wxml" />
<text class="data-title">{{item.type_name}}</text>
<text class="data-title">{{item.type_text}}</text>
<text class="data-time fr">{{item.add_time_time}}</text>
</view>
<view class="data-value">
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册