细节优化

This commit is contained in:
Devil 2020-12-09 11:54:55 +08:00
parent a2cbd72f85
commit 1f05267e62
30 changed files with 51 additions and 40 deletions

View File

@ -171,6 +171,7 @@ class Admin extends Common
]));
// 数据
unset($params['id']);
$this->assign('data', $data);
$this->assign('params', $params);
return $this->fetch();

View File

@ -159,7 +159,6 @@ class Answer extends Common
// 参数
unset($params['id']);
$this->assign('params', $params);
return $this->fetch();
}

View File

@ -133,20 +133,16 @@ class AppCenterNav extends Common
$ret = AppCenterNavService::AppCenterNavList($data_params);
$data = empty($ret['data'][0]) ? [] : $ret['data'][0];
}
$this->assign('data', $data);
// 所属平台
// 静态数据
$this->assign('common_platform_type', lang('common_platform_type'));
// app事件类型
$this->assign('common_app_event_type', lang('common_app_event_type'));
// 参数
$this->assign('params', $params);
// 编辑器文件存放地址
// 数据
unset($params['id']);
$this->assign('editor_path_type', 'app_center_nav');
$this->assign('params', $params);
$this->assign('data', $data);
return $this->fetch();
}

View File

@ -133,18 +133,16 @@ class AppHomeNav extends Common
$ret = AppHomeNavService::AppHomeNavList($data_params);
$data = empty($ret['data'][0]) ? [] : $ret['data'][0];
}
$this->assign('data', $data);
// 静态数据
$this->assign('common_platform_type', lang('common_platform_type'));
$this->assign('common_app_event_type', lang('common_app_event_type'));
// 参数
$this->assign('params', $params);
// 编辑器文件存放地址
// 数据
unset($params['id']);
$this->assign('editor_path_type', 'app_nav');
$this->assign('params', $params);
$this->assign('data', $data);
return $this->fetch();
}

View File

@ -153,6 +153,7 @@ class Article extends Common
$this->assign('editor_path_type', 'article');
// 数据
unset($params['id']);
$this->assign('data', $data);
$this->assign('params', $params);
return $this->fetch();

View File

@ -158,6 +158,7 @@ class Brand extends Common
$this->assign('editor_path_type', 'brand');
// 数据
unset($params['id']);
$this->assign('data', $data);
$this->assign('params', $params);
return $this->fetch();

View File

@ -133,7 +133,9 @@ class CustomView extends Common
$ret = CustomViewService::CustomViewList($data_params);
$data = empty($ret['data'][0]) ? [] : $ret['data'][0];
}
unset($params['id']);
$this->assign('data', $data);
$this->assign('params', $params);
return $this->fetch();
}

View File

@ -147,7 +147,6 @@ class Goodscomments extends Common
// 参数
unset($params['id']);
$this->assign('params', $params);
return $this->fetch();
}

View File

@ -164,6 +164,7 @@ class GoodsParamsTemplate extends Common
]));
// 数据
unset($params['id']);
$this->assign('data', $data);
$this->assign('params', $params);
return $this->fetch();

View File

@ -255,8 +255,7 @@ class Order extends Common
public function Pay()
{
$params = $this->data_request;
$params['user'] = $this->admin;
$params['user']['user_name_view'] = '管理员'.'-'.$this->admin['username'];
$params['admin'] = $this->admin;
return OrderService::AdminPay($params);
}
}

View File

@ -153,6 +153,7 @@ class Role extends Common
]));
// 数据
unset($params['id']);
$this->assign('data', $data);
$this->assign('params', $params);
return $this->fetch();

View File

@ -140,6 +140,7 @@ class Slide extends Common
$this->assign('common_app_event_type', lang('common_app_event_type'));
// 数据
unset($params['id']);
$this->assign('editor_path_type', 'slide');
$this->assign('params', $params);
$this->assign('data', $data);

View File

@ -182,7 +182,8 @@ class User extends Common
$this->assign('common_gender_list', lang('common_gender_list'));
// 数据
$this->assign('data', $data);
unset($params['id']);
$this->assign('data', $data);
$this->assign('params', $params);
return $this->fetch();
}

View File

@ -150,6 +150,7 @@ class UserAddress extends Common
}
// 数据
unset($params['id']);
$this->assign('data', $data);
$this->assign('params', $params);
return $this->fetch();

View File

@ -144,6 +144,7 @@ class Warehouse extends Common
$this->assign('editor_path_type', 'warehouse');
// 数据
unset($params['id']);
$this->assign('data', $data);
$this->assign('params', $params);
return $this->fetch();

View File

@ -5,7 +5,7 @@
</button>
<!-- 非管理员不能操作 -->
{{if $module_data['id'] neq 1 or $module_data['id'] eq $admin['id']}}
<a class="am-btn am-btn-secondary am-btn-xs am-radius am-btn-block" href="{{:MyUrl('admin/admin/saveinfo', array('id'=>$module_data['id']))}}">
<a class="am-btn am-btn-secondary am-btn-xs am-radius am-btn-block" href="{{:MyUrl('admin/admin/saveinfo', array_merge($params, ['id'=>$module_data['id']]))}}">
<i class="am-icon-edit"></i>
<span>编辑</span>
</a>

View File

@ -4,10 +4,10 @@
<div class="content-right">
<div class="content">
<!-- form start -->
<form class="am-form form-validation view-save" action="{{:MyUrl('admin/admin/save')}}" method="POST" request-type="ajax-url" request-value="{{:MyUrl('admin/admin/index')}}">
<form class="am-form form-validation view-save" action="{{:MyUrl('admin/admin/save')}}" method="POST" request-type="ajax-url" request-value="{{:MyUrl('admin/admin/index', $params)}}">
<legend>
<span class="am-text-default">管理员{{if empty($data['id'])}}添加{{else /}}编辑{{/if}}</span>
<a href="{{:MyUrl('admin/admin/index')}}" class="am-fr am-text-sm am-margin-top-xs am-icon-mail-reply"> 返回</a>
<a href="{{:MyUrl('admin/admin/index', $params)}}" class="am-fr am-text-sm am-margin-top-xs am-icon-mail-reply"> 返回</a>
</legend>
<div class="am-form-group">
<label>用户名<span class="am-form-group-label-tips">创建后不可更改</span></label>

View File

@ -3,7 +3,7 @@
<i class="am-icon-eye"></i>
<span>详情</span>
</button>
<a class="am-btn am-btn-secondary am-btn-xs am-radius am-btn-block" href="{{:MyUrl('admin/appcenternav/saveinfo', array('id'=>$module_data['id']))}}">
<a class="am-btn am-btn-secondary am-btn-xs am-radius am-btn-block" href="{{:MyUrl('admin/appcenternav/saveinfo', array_merge($params, ['id'=>$module_data['id']]))}}">
<i class="am-icon-edit"></i>
<span>编辑</span>
</a>

View File

@ -3,7 +3,7 @@
<i class="am-icon-eye"></i>
<span>详情</span>
</button>
<a class="am-btn am-btn-secondary am-btn-xs am-radius am-btn-block" href="{{:MyUrl('admin/apphomenav/saveinfo', array('id'=>$module_data['id']))}}">
<a class="am-btn am-btn-secondary am-btn-xs am-radius am-btn-block" href="{{:MyUrl('admin/apphomenav/saveinfo', array_merge($params, ['id'=>$module_data['id']]))}}">
<i class="am-icon-edit"></i>
<span>编辑</span>
</a>

View File

@ -3,7 +3,7 @@
<i class="am-icon-eye"></i>
<span>详情</span>
</button>
<a class="am-btn am-btn-secondary am-btn-xs am-radius am-btn-block" href="{{:MyUrl('admin/article/saveinfo', array('id'=>$module_data['id']))}}">
<a class="am-btn am-btn-secondary am-btn-xs am-radius am-btn-block" href="{{:MyUrl('admin/article/saveinfo', array_merge($params, ['id'=>$module_data['id']]))}}">
<i class="am-icon-edit"></i>
<span>编辑</span>
</a>

View File

@ -3,7 +3,7 @@
<i class="am-icon-eye"></i>
<span>详情</span>
</button>
<a class="am-btn am-btn-secondary am-btn-xs am-radius am-btn-block" href="{{:MyUrl('admin/brand/saveinfo', array('id'=>$module_data['id']))}}">
<a class="am-btn am-btn-secondary am-btn-xs am-radius am-btn-block" href="{{:MyUrl('admin/brand/saveinfo', array_merge($params, ['id'=>$module_data['id']]))}}">
<i class="am-icon-edit"></i>
<span>编辑</span>
</a>

View File

@ -4,10 +4,10 @@
<div class="content-right">
<div class="content">
<!-- form start -->
<form class="am-form form-validation view-save" action="{{:MyUrl('admin/customview/save')}}" method="POST" request-type="ajax-url" request-value="{{:MyUrl('admin/customview/index')}}">
<form class="am-form form-validation view-save" action="{{:MyUrl('admin/customview/save')}}" method="POST" request-type="ajax-url" request-value="{{:MyUrl('admin/customview/index', $params)}}">
<legend>
<span class="am-text-default">自定义页面{{if empty($data['id'])}}添加{{else /}}编辑{{/if}}</span>
<a href="{{:MyUrl('admin/customview/index')}}" class="am-fr am-text-sm am-margin-top-xs am-icon-mail-reply"> 返回</a>
<a href="{{:MyUrl('admin/customview/index', $params)}}" class="am-fr am-text-sm am-margin-top-xs am-icon-mail-reply"> 返回</a>
</legend>
<div class="am-form-group">
<label>标题</label>

View File

@ -3,7 +3,7 @@
<i class="am-icon-eye"></i>
<span>详情</span>
</button>
<a class="am-btn am-btn-secondary am-btn-xs am-radius am-btn-block" href="{{:MyUrl('admin/goodsparamstemplate/saveinfo', array('id'=>$module_data['id']))}}">
<a class="am-btn am-btn-secondary am-btn-xs am-radius am-btn-block" href="{{:MyUrl('admin/goodsparamstemplate/saveinfo', array_merge($params, ['id'=>$module_data['id']]))}}">
<i class="am-icon-edit"></i>
<span>编辑</span>
</a>

View File

@ -4,7 +4,7 @@
<span>详情</span>
</button>
{{if $module_data['id'] neq 1}}
<a class="am-btn am-btn-secondary am-btn-xs am-radius am-btn-block" href="{{:MyUrl('admin/role/saveinfo', array('id'=>$module_data['id']))}}">
<a class="am-btn am-btn-secondary am-btn-xs am-radius am-btn-block" href="{{:MyUrl('admin/role/saveinfo', array_merge($params, ['id'=>$module_data['id']]))}}">
<i class="am-icon-edit"></i>
<span>编辑</span>
</a>

View File

@ -4,10 +4,10 @@
<div class="content-right">
<div class="content">
<!-- form start -->
<form class="am-form form-validation view-save" action="{{:MyUrl('admin/role/save')}}" method="POST" request-type="ajax-url" request-value="{{:MyUrl('admin/role/index')}}">
<form class="am-form form-validation view-save" action="{{:MyUrl('admin/role/save')}}" method="POST" request-type="ajax-url" request-value="{{:MyUrl('admin/role/index', $params)}}">
<legend>
<span class="am-text-default">角色{{if empty($data['id'])}}添加{{else /}}编辑{{/if}}</span>
<a href="{{:MyUrl('admin/role/index')}}" class="am-fr am-text-sm am-margin-top-xs am-icon-mail-reply"> 返回</a>
<a href="{{:MyUrl('admin/role/index', $params)}}" class="am-fr am-text-sm am-margin-top-xs am-icon-mail-reply"> 返回</a>
</legend>
<div class="am-form-group">
<label>角色名称</label>

View File

@ -3,7 +3,7 @@
<i class="am-icon-eye"></i>
<span>详情</span>
</button>
<a class="am-btn am-btn-secondary am-btn-xs am-radius am-btn-block" href="{{:MyUrl('admin/slide/saveinfo', array('id'=>$module_data['id']))}}">
<a class="am-btn am-btn-secondary am-btn-xs am-radius am-btn-block" href="{{:MyUrl('admin/slide/saveinfo', array_merge($params, ['id'=>$module_data['id']]))}}">
<i class="am-icon-edit"></i>
<span>编辑</span>
</a>

View File

@ -3,7 +3,7 @@
<i class="am-icon-eye"></i>
<span>详情</span>
</button>
<a class="am-btn am-btn-secondary am-btn-xs am-radius am-btn-block" href="{{:MyUrl('admin/user/saveinfo', array_merge($params,array('id'=>$module_data['id'])))}}">
<a class="am-btn am-btn-secondary am-btn-xs am-radius am-btn-block" href="{{:MyUrl('admin/user/saveinfo', array_merge($params, ['id'=>$module_data['id']]))}}">
<i class="am-icon-edit"></i>
<span>编辑</span>
</a>

View File

@ -3,7 +3,7 @@
<i class="am-icon-eye"></i>
<span>详情</span>
</button>
<a class="am-btn am-btn-secondary am-btn-xs am-radius am-btn-block" href="{{:MyUrl('admin/warehouse/saveinfo', ['id'=>$module_data['id']])}}">
<a class="am-btn am-btn-secondary am-btn-xs am-radius am-btn-block" href="{{:MyUrl('admin/warehouse/saveinfo', array_merge($params, ['id'=>$module_data['id']]))}}">
<i class="am-icon-edit"></i>
<span>编辑</span>
</a>

View File

@ -362,7 +362,7 @@ class OrderService
],
[
'checked_type' => 'empty',
'key_name' => 'user',
'key_name' => 'admin',
'error_msg' => '管理员信息有误',
],
];
@ -406,7 +406,7 @@ class OrderService
return self::OrderPaymentUnderLineSuccess([
'order' => $order,
'payment' => $payment,
'user' => $params['user'],
'user' => UserService::GetUserViewInfo($order['user_id']),
'params' => $params,
]);
}
@ -1044,7 +1044,7 @@ class OrderService
$currency_data = OrderCurrencyService::OrderCurrencyGroupList(array_column($data, 'id'));
// 用户列表
if(in_array('warehouse_id', $keys) && isset($params['is_public']) && $params['is_public'] == 0)
if(in_array('user_id', $keys) && isset($params['is_public']) && $params['is_public'] == 0)
{
$user_list = UserService::GetUserViewInfo(array_column($data, 'user_id'));
}

View File

@ -186,6 +186,9 @@ class PayLogService
$data = Db::name('PayLog')->where($where)->field($field)->limit($m, $n)->order($order_by)->select();
if(!empty($data))
{
// 字段列表
$keys = ArrayKeys($data);
// 获取支付业务关联数据
$log_value_list = [];
$log_value = Db::name('PayLogValue')->field('pay_log_id,business_id,business_no')->where(['pay_log_id'=>array_column($data, 'id')])->select();
@ -195,6 +198,12 @@ class PayLogService
{
$log_value_list[$lv['pay_log_id']][] = $lv;
}
// 用户列表
if(in_array('user_id', $keys) && isset($params['is_public']) && $params['is_public'] == 0)
{
$user_list = UserService::GetUserViewInfo(array_column($data, 'user_id'));
}
}
// 循环处理数据
@ -205,7 +214,7 @@ class PayLogService
{
if(isset($params['is_public']) && $params['is_public'] == 0)
{
$v['user'] = UserService::GetUserViewInfo($v['user_id']);
$v['user'] = (!empty($user_list) && is_array($user_list) && array_key_exists($v['user_id'], $user_list)) ? $user_list[$v['user_id']] : [];
}
}