订单列表
parent
b081167d19
commit
2e8825e80f
|
|
@ -66,7 +66,7 @@ class Goods
|
|||
'label' => '商品ID',
|
||||
'view_type' => 'field',
|
||||
'view_key' => 'id',
|
||||
'width' => 120,
|
||||
'width' => 105,
|
||||
'search_config' => [
|
||||
'form_type' => 'input',
|
||||
'form_name' => 'id',
|
||||
|
|
|
|||
|
|
@ -0,0 +1,334 @@
|
|||
<?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\GoodsService;
|
||||
use app\service\RegionService;
|
||||
use app\service\BrandService;
|
||||
use app\service\PaymentService;
|
||||
|
||||
/**
|
||||
* 订单动态表单
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @date 2020-05-16
|
||||
* @desc description
|
||||
*/
|
||||
class Order
|
||||
{
|
||||
// 基础条件
|
||||
public $condition_base = [
|
||||
['is_delete_time', '=', 0],
|
||||
];
|
||||
|
||||
/**
|
||||
* 入口
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @date 2020-05-16
|
||||
* @desc description
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public function Run($params = [])
|
||||
{
|
||||
return [
|
||||
// 基础配置
|
||||
'base' => [
|
||||
'key_field' => 'id',
|
||||
'status_field' => 'is_shelves',
|
||||
'is_search' => 1,
|
||||
'search_url' => MyUrl('admin/order/index'),
|
||||
],
|
||||
// 表单配置
|
||||
'form' => [
|
||||
[
|
||||
'label' => '订单ID',
|
||||
'view_type' => 'field',
|
||||
'view_key' => 'id',
|
||||
'width' => 105,
|
||||
'search_config' => [
|
||||
'form_type' => 'input',
|
||||
'where_type' => '=',
|
||||
],
|
||||
],
|
||||
[
|
||||
'label' => '订单号',
|
||||
'view_type' => 'field',
|
||||
'view_key' => 'order_no',
|
||||
'width' => 170,
|
||||
'search_config' => [
|
||||
'form_type' => 'input',
|
||||
'where_type' => '=',
|
||||
],
|
||||
],
|
||||
[
|
||||
'label' => '基础信息',
|
||||
'view_type' => 'module',
|
||||
'view_key' => 'order/module/info',
|
||||
'grid_size' => 'lg',
|
||||
'search_config' => [
|
||||
'form_type' => 'input',
|
||||
'form_name' => 'id',
|
||||
'where_type' => 'in',
|
||||
'placeholder' => '请输入商品名称/型号',
|
||||
'where_custom' => 'WhereValueBaseInfo',
|
||||
],
|
||||
],
|
||||
[
|
||||
'label' => '用户信息',
|
||||
'view_type' => 'module',
|
||||
'view_key' => 'order/module/user',
|
||||
'grid_size' => 'sm',
|
||||
'search_config' => [
|
||||
'form_type' => 'input',
|
||||
'form_name' => 'user_id',
|
||||
'where_type' => 'in',
|
||||
'placeholder' => '请输入用户名/昵称/手机/邮箱',
|
||||
'where_custom' => 'WhereValueUserInfo',
|
||||
],
|
||||
],
|
||||
[
|
||||
'label' => '地址信息',
|
||||
'view_type' => 'module',
|
||||
'view_key' => 'order/module/address',
|
||||
'grid_size' => 'sm',
|
||||
'search_config' => [
|
||||
'form_type' => 'input',
|
||||
'form_name' => 'user_id',
|
||||
'where_type' => 'in',
|
||||
'placeholder' => '请输入收件姓名/电话/地址',
|
||||
'where_custom' => 'WhereValueAddressInfo',
|
||||
],
|
||||
],
|
||||
[
|
||||
'label' => '取货信息',
|
||||
'view_type' => 'module',
|
||||
'view_key' => 'order/module/take',
|
||||
'width' => 120,
|
||||
'search_config' => [
|
||||
'form_type' => 'input',
|
||||
'form_name' => 'id',
|
||||
'where_type' => '=',
|
||||
'placeholder' => '请输入取货码',
|
||||
'where_custom' => 'WhereValueAddressInfo',
|
||||
],
|
||||
],
|
||||
[
|
||||
'label' => '订单状态',
|
||||
'view_type' => 'module',
|
||||
'view_key' => 'order/module/status',
|
||||
'width' => 120,
|
||||
'search_config' => [
|
||||
'form_type' => 'select',
|
||||
'form_name' => 'status',
|
||||
'where_type' => 'in',
|
||||
'data' => lang('common_order_admin_status'),
|
||||
'data_key' => 'id',
|
||||
'data_name' => 'name',
|
||||
'is_multiple' => 1,
|
||||
],
|
||||
],
|
||||
[
|
||||
'label' => '支付状态',
|
||||
'view_type' => 'module',
|
||||
'view_key' => 'order/module/pay_status',
|
||||
'width' => 120,
|
||||
'search_config' => [
|
||||
'form_type' => 'select',
|
||||
'form_name' => 'pay_status',
|
||||
'where_type' => 'in',
|
||||
'data' => lang('common_order_pay_status'),
|
||||
'data_key' => 'id',
|
||||
'data_name' => 'name',
|
||||
'is_multiple' => 1,
|
||||
],
|
||||
],
|
||||
[
|
||||
'label' => '订单模式',
|
||||
'view_type' => 'field',
|
||||
'view_key' => 'order_model_name',
|
||||
'width' => 120,
|
||||
'search_config' => [
|
||||
'form_type' => 'select',
|
||||
'form_name' => 'order_model',
|
||||
'where_type' => 'in',
|
||||
'data' => lang('common_site_type_list'),
|
||||
'data_key' => 'id',
|
||||
'data_name' => 'name',
|
||||
'is_multiple' => 1,
|
||||
],
|
||||
],
|
||||
[
|
||||
'label' => '来源',
|
||||
'view_type' => 'field',
|
||||
'view_key' => 'client_type_name',
|
||||
'width' => 120,
|
||||
'search_config' => [
|
||||
'form_type' => 'select',
|
||||
'form_name' => 'client_type',
|
||||
'where_type' => 'in',
|
||||
'data' => lang('common_platform_type'),
|
||||
'data_key' => 'id',
|
||||
'data_name' => 'name',
|
||||
'is_multiple' => 1,
|
||||
],
|
||||
],
|
||||
[
|
||||
'label' => '单价(元)',
|
||||
'view_type' => 'field',
|
||||
'view_key' => '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' => 'pay_price',
|
||||
'search_config' => [
|
||||
'form_type' => 'section',
|
||||
'is_point' => 1,
|
||||
],
|
||||
],
|
||||
[
|
||||
'label' => '退款金额(元)',
|
||||
'view_type' => 'field',
|
||||
'view_key' => 'refund_price',
|
||||
'search_config' => [
|
||||
'form_type' => 'section',
|
||||
'is_point' => 1,
|
||||
],
|
||||
],
|
||||
[
|
||||
'label' => '退货数量',
|
||||
'view_type' => 'field',
|
||||
'view_key' => 'returned_quantity',
|
||||
'search_config' => [
|
||||
'form_type' => 'section',
|
||||
],
|
||||
],
|
||||
[
|
||||
'label' => '增加金额(元)',
|
||||
'view_type' => 'field',
|
||||
'view_key' => 'increase_price',
|
||||
'search_config' => [
|
||||
'form_type' => 'section',
|
||||
'is_point' => 1,
|
||||
],
|
||||
],
|
||||
[
|
||||
'label' => '优惠金额(元)',
|
||||
'view_type' => 'field',
|
||||
'view_key' => 'preferential_price',
|
||||
'search_config' => [
|
||||
'form_type' => 'section',
|
||||
'is_point' => 1,
|
||||
],
|
||||
],
|
||||
[
|
||||
'label' => '支付方式',
|
||||
'view_type' => 'field',
|
||||
'view_key' => 'payment_name',
|
||||
'search_config' => [
|
||||
'form_type' => 'select',
|
||||
'form_name' => 'payment_id',
|
||||
'where_type' => 'in',
|
||||
'data' => PaymentService::PaymentList(),
|
||||
'data_key' => 'id',
|
||||
'data_name' => 'name',
|
||||
'is_multiple' => 1,
|
||||
],
|
||||
],
|
||||
[
|
||||
'label' => '扩展信息',
|
||||
'view_type' => 'module',
|
||||
'view_key' => 'order/module/extension',
|
||||
'grid_size' => 'sm',
|
||||
'search_config' => [
|
||||
'form_type' => 'input',
|
||||
'form_name' => 'extension_data',
|
||||
'where_type' => 'like',
|
||||
],
|
||||
],
|
||||
[
|
||||
'label' => '快递信息',
|
||||
'view_type' => 'module',
|
||||
'view_key' => 'order/module/express',
|
||||
'grid_size' => 'sm',
|
||||
'search_config' => [
|
||||
'form_type' => 'input',
|
||||
'form_name' => 'express_number',
|
||||
'where_type' => 'like',
|
||||
'placeholder' => '请输入快递单号',
|
||||
],
|
||||
],
|
||||
[
|
||||
'label' => '最新售后',
|
||||
'view_type' => 'module',
|
||||
'view_key' => 'order/module/aftersale',
|
||||
'grid_size' => 'sm',
|
||||
],
|
||||
[
|
||||
'label' => '操作',
|
||||
'view_type' => 'operate',
|
||||
'view_key' => 'order/module/operate',
|
||||
'align' => 'center',
|
||||
'fixed' => 'right',
|
||||
],
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* 商品分类条件处理
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @date 2020-06-03
|
||||
* @desc description
|
||||
* @param [string] $name [字段名称]
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public function WhereValueGoodsCategory($value, $params = [])
|
||||
{
|
||||
if(!empty($value))
|
||||
{
|
||||
// 是否为数组
|
||||
if(!is_array($value))
|
||||
{
|
||||
$value = [$value];
|
||||
}
|
||||
|
||||
// 获取分类下的所有分类 id
|
||||
$category_ids = GoodsService::GoodsCategoryItemsIds($value, 1);
|
||||
|
||||
// 获取商品 id
|
||||
$goods_ids = Db::name('GoodsCategoryJoin')->where(['category_id'=>$category_ids])->column('goods_id');
|
||||
|
||||
// 避免空条件造成无效的错觉
|
||||
return empty($goods_ids) ? [0] : $goods_ids;
|
||||
}
|
||||
return $value;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,483 +1,2 @@
|
|||
{{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/order/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="status" class="chosen-select" data-placeholder="订单状态...">
|
||||
<option value="-1">订单状态...</option>
|
||||
{{foreach $common_order_admin_status as $v}}
|
||||
<option value="{{$v.id}}" {{if isset($params['status']) and $params['status'] eq $v['id']}}selected{{/if}}>{{$v.name}}</option>
|
||||
{{/foreach}}
|
||||
</select>
|
||||
</td>
|
||||
<td>
|
||||
<span>快递:</span>
|
||||
<select name="express_id" class="chosen-select" data-placeholder="快递公司...">
|
||||
<option value="-1">快递公司...</option>
|
||||
{{foreach $express_list as $v}}
|
||||
<option value="{{$v.id}}" {{if isset($params['express_id']) and $params['express_id'] eq $v['id']}}selected{{/if}}>{{$v.name}}</option>
|
||||
{{/foreach}}
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<span>支付:</span>
|
||||
<select name="payment_id" class="chosen-select" data-placeholder="支付方式...">
|
||||
<option value="-1">支付方式...</option>
|
||||
{{foreach $payment_list as $v}}
|
||||
<option value="{{$v.id}}" {{if isset($params['payment_id']) and $params['payment_id'] eq $v['id']}}selected{{/if}}>{{$v.name}}</option>
|
||||
{{/foreach}}
|
||||
</select>
|
||||
</td>
|
||||
<td>
|
||||
<span>付款:</span>
|
||||
<select name="pay_status" class="chosen-select" data-placeholder="支付状态...">
|
||||
<option value="-1">支付状态...</option>
|
||||
{{foreach $common_order_pay_status as $v}}
|
||||
<option value="{{$v.id}}" {{if isset($params['pay_status']) and $params['pay_status'] eq $v['id']}}selected{{/if}}>{{$v.name}}</option>
|
||||
{{/foreach}}
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<span>来源:</span>
|
||||
<select name="client_type" class="chosen-select" data-placeholder="来源客户端...">
|
||||
<option value="">来源客户端...</option>
|
||||
{{foreach $common_platform_type as $v}}
|
||||
<option value="{{$v.value}}" {{if isset($params['client_type']) and $params['client_type'] eq $v['value']}}selected{{/if}}>{{$v.name}}</option>
|
||||
{{/foreach}}
|
||||
</select>
|
||||
</td>
|
||||
<td>
|
||||
<span>模式:</span>
|
||||
<select name="order_model" class="chosen-select" data-placeholder="订单模式...">
|
||||
<option value="-1">订单模式...</option>
|
||||
{{foreach $common_site_type_list as $v}}
|
||||
{{if !isset($v['is_ext']) or $v['is_ext'] neq 1}}
|
||||
<option value="{{$v.value}}" {{if isset($params['order_model']) and $params['order_model'] eq $v['value']}}selected{{/if}}>{{$v.name}}</option>
|
||||
{{/if}}
|
||||
{{/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/order/index')}}" class="am-btn am-btn-warning am-radius am-btn-sm reset-submit">清除条件</a>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</form>
|
||||
<!-- form end -->
|
||||
|
||||
<!-- top operation start -->
|
||||
<div class="am-g am-margin-top-sm">
|
||||
<!-- 顶部操作钩子 -->
|
||||
{{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}}
|
||||
<div class="plugins-tag">
|
||||
<span>plugins_view_admin_order_top_operate</span>
|
||||
</div>
|
||||
{{/if}}
|
||||
{{php}}
|
||||
$hook_name = 'plugins_view_admin_order_top_operate';
|
||||
$hook_data = Hook::listen($hook_name, ['hook_name'=>$hook_name, 'is_backend'=>true]);
|
||||
if(!empty($hook_data) && is_array($hook_data))
|
||||
{
|
||||
foreach($hook_data as $hook)
|
||||
{
|
||||
if(is_string($hook) || is_int($hook))
|
||||
{
|
||||
echo htmlspecialchars_decode($hook);
|
||||
}
|
||||
}
|
||||
}
|
||||
{{/php}}
|
||||
</div>
|
||||
<!-- top operation 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-lg">基础信息</th>
|
||||
<th class="am-grid-sm">用户信息</th>
|
||||
<th class="am-grid-sm">地址信息</th>
|
||||
<th>订单状态</th>
|
||||
<th class="am-grid-sm">订单金额(元)</th>
|
||||
<th class="am-grid-sm">最新售后</th>
|
||||
<th class="am-grid-sm">快递信息</th>
|
||||
<th class="am-grid-sm">扩展数据</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}}" {{if $v['pay_status'] eq 1 and $v['total_price'] gt $v['pay_price']}}class="am-danger"{{/if}}>
|
||||
<td class="am-text-middle">
|
||||
<div class="am-padding-bottom-xs">
|
||||
<strong>{{$v.order_no}}</strong>
|
||||
<span class="am-badge am-badge-primary am-radius" title="订单模式">{{$v.order_model_name}}</span>
|
||||
<span class="am-badge am-badge-secondary am-radius" title="客户端类型">{{$v.client_type_name}}</span>
|
||||
</div>
|
||||
<hr data-am-widget="divider" class="am-divider am-divider-dashed am-margin-vertical-0" />
|
||||
{{foreach $v.items as $vs}}
|
||||
<div class="goods-item am-padding-vertical-xs">
|
||||
<div class="base">
|
||||
<a href="{{:MyUrl('index/goods/index', ['id'=>$vs['goods_id']])}}" target="_blank" title="{{$vs.title}}">
|
||||
<img src="{{$vs['images']}}" class="am-img-thumbnail am-radius goods-images" />
|
||||
</a>
|
||||
<a href="{{:MyUrl('index/goods/index', ['id'=>$vs['goods_id']])}}" target="_blank" title="{{$vs.title}}" {{if !empty($vs['title_color'])}} style="color:{{$vs.title_color}};" {{/if}} class="am-nowrap-initial">{{$vs.title}}</a>
|
||||
</div>
|
||||
<div class="other">
|
||||
<span class="am-fl am-text-xs am-nowrap-initial">
|
||||
{{if !empty($vs.spec_text)}}
|
||||
{{$vs.spec_text}}
|
||||
{{/if}}
|
||||
</span>
|
||||
{{if $vs['returned_quantity'] gt 0 or $vs['refund_price'] gt 0}}
|
||||
<span class="am-text-danger am-fr am-margin-left-sm">已退 {{$vs.returned_quantity}} / {{$vs.refund_price}}</span>
|
||||
{{/if}}
|
||||
<span class="am-fr">{{$vs.price}}x{{$vs.buy_number}}</span>
|
||||
</div>
|
||||
</div>
|
||||
<hr data-am-widget="divider" class="am-divider am-divider-dashed am-margin-vertical-0" />
|
||||
{{/foreach}}
|
||||
<div class="am-margin-top-sm">{{$v.describe}}</div>
|
||||
</td>
|
||||
<td class="am-text-middle user-info">
|
||||
{{if !empty($v['user'])}}
|
||||
<img src="{{$v.user.avatar}}" alt="{{$v.user.user_name_view}}" class="am-img-thumbnail am-radius am-align-left" />
|
||||
<ul class="user-base">
|
||||
<li>名称:{{if empty($v['user']['username'])}}<span class="cr-ccc">未填写</span>{{else /}}{{$v.user.username}}{{/if}}</li>
|
||||
<li>昵称:{{if empty($v['user']['nickname'])}}<span class="cr-ccc">未填写</span>{{else /}}{{$v.user.nickname}}{{/if}}</li>
|
||||
<li>手机:{{if empty($v['user']['mobile'])}}<span class="cr-ccc">未填写</span>{{else /}}{{$v.user.mobile}}{{/if}}</li>
|
||||
<li>邮箱:{{if empty($v['user']['email'])}}<span class="cr-ccc">未填写</span>{{else /}}{{$v.user.email}}{{/if}}</li>
|
||||
</ul>
|
||||
{{else /}}
|
||||
用户信息异常
|
||||
{{/if}}
|
||||
</td>
|
||||
<td class="am-text-middle">
|
||||
{{if in_array($v['order_model'], [0,2])}}
|
||||
{{$v.address_data.name}}<br />
|
||||
{{$v.address_data.tel}}<br />
|
||||
{{$v.address_data.province_name}}<br />
|
||||
{{$v.address_data.city_name}}<br />
|
||||
{{$v.address_data.county_name}}<br />
|
||||
{{$v.address_data.address}}
|
||||
{{else /}}
|
||||
<span class="cr-ddd">无信息</span>
|
||||
{{/if}}
|
||||
</td>
|
||||
<td class="am-text-middle">
|
||||
<span class="block">{{$v.status_name}}</span>
|
||||
|
||||
{{if $v['pay_status'] eq 1}}
|
||||
<span class="block am-text-success am-text-xs">{{$v.pay_status_name}}</span>
|
||||
{{elseif $v['pay_status'] gt 1 /}}
|
||||
<span class="block am-text-danger am-text-xs">{{$v.pay_status_name}}</span>
|
||||
{{else /}}
|
||||
<span class="block am-text-xs">{{$v.pay_status_name}}</span>
|
||||
{{/if}}
|
||||
{{if !empty($v['is_under_line_text'])}}
|
||||
<span class="block am-text-danger am-text-xs">{{$v.is_under_line_text}}</p>
|
||||
{{/if}}
|
||||
{{if $v['user_is_delete_time'] neq 0}}
|
||||
<span class="block am-text-warning am-text-xs">用户已删除</span>
|
||||
{{/if}}
|
||||
</td>
|
||||
<td class="am-text-middle">
|
||||
金额:{{$v.price}}<br />
|
||||
增加:{{$v.increase_price}}<br />
|
||||
优惠:{{$v.preferential_price}}<br />
|
||||
总价:{{$v.total_price}}<br />
|
||||
支付:{{$v.pay_price}}<br />
|
||||
退款:{{if $v['refund_price'] gt 0}}<span class="am-text-danger">{{$v.refund_price}}</span>{{else /}}{{$v.refund_price}}{{/if}}
|
||||
</td>
|
||||
<td class="am-text-middle">
|
||||
{{if !empty($v['aftersale_first'])}}
|
||||
状态:{{$v.aftersale_first.status_text}}<br />
|
||||
类型:{{$v.aftersale_first.type_text}}<br />
|
||||
金额:<strong class="am-text-danger">{{$v.aftersale_first.price}}</strong><br />
|
||||
数量:{{$v.aftersale_first.number}}<br />
|
||||
原因:{{$v.aftersale_first.reason}}
|
||||
{{/if}}
|
||||
</td>
|
||||
<td class="am-text-middle">
|
||||
{{if !empty($v['express_name'])}}
|
||||
{{$v.express_name}}<br />{{$v.express_number}}
|
||||
{{/if}}
|
||||
</td>
|
||||
<td class="am-text-middle">
|
||||
{{if !empty($v['extension_data'])}}
|
||||
{{foreach $v.extension_data as $extk=>$ext}}
|
||||
{{if $extk gt 0}}<br />{{/if}}
|
||||
{{$ext.name}} [{{$ext.tips}}]
|
||||
{{/foreach}}
|
||||
{{/if}}
|
||||
</td>
|
||||
<td class="am-operate-grid">
|
||||
<div class="am-scrollable-vertical">
|
||||
<button class="am-btn am-btn-default am-btn-xs am-radius am-btn-block submit-popup" data-url="{{:MyUrl('admin/order/detail', ['id'=>$v['id']])}}">
|
||||
<i class="am-icon-eye"></i>
|
||||
<span>详情</span>
|
||||
</button>
|
||||
{{if in_array($v['status'], [0])}}
|
||||
<button class="am-btn am-btn-primary am-btn-xs am-radius am-btn-block submit-ajax" data-url="{{:MyUrl('admin/order/confirm')}}" data-id="{{$v.id}}" data-value="{{$v.user_id}}" data-view="reload" data-msg="是否操作收货,操作后不可恢复!">
|
||||
<i class="am-icon-check-circle-o"></i>
|
||||
<span>确认</span>
|
||||
</button>
|
||||
{{/if}}
|
||||
{{if in_array($v['status'], [0,1])}}
|
||||
<button class="am-btn am-btn-warning am-btn-xs am-radius am-btn-block submit-ajax" data-url="{{:MyUrl('admin/order/cancel')}}" data-id="{{$v.id}}" data-value="{{$v.user_id}}" data-view="reload" data-msg="取消后无法恢复,确定继续吗?">
|
||||
<i class="am-icon-paint-brush"></i>
|
||||
<span>取消</span>
|
||||
</button>
|
||||
{{if in_array($v['status'], [1])}}
|
||||
<button class="am-btn am-btn-success am-btn-xs am-radius am-btn-block submit-pay" data-id="{{$v.id}}" data-payment-id="{{$v.payment_id}}" data-am-modal="{target: '#order-pay-popup'}">
|
||||
<i class="am-icon-paypal"></i>
|
||||
<span>支付</span>
|
||||
</button>
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
{{if $v['status'] eq 2}}
|
||||
{{if $v['order_model'] eq 2}}
|
||||
<button class="am-btn am-btn-secondary am-btn-xs am-radius am-btn-block submit-take" data-id="{{$v.id}}" data-user-id="{{$v.user_id}}" data-am-modal="{target: '#order-take-modal', closeViaDimmer: 0, width: 200, height: 160}">
|
||||
<i class="am-icon-check"></i>
|
||||
<span>取货</span>
|
||||
</button>
|
||||
{{else /}}
|
||||
<button class="am-btn am-btn-secondary am-btn-xs am-radius am-btn-block submit-delivery" data-url="{{:MyUrl('admin/order/delivery')}}" data-id="{{$v.id}}" data-user-id="{{$v.user_id}}" data-express-id="{{$v.express_id}}" data-am-modal="{target: '#order-delivery-popup'}">
|
||||
<i class="am-icon-send-o"></i>
|
||||
<span>发货</span>
|
||||
</button>
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
{{if $v['status'] eq 3}}
|
||||
<button class="am-btn am-btn-success am-btn-xs am-radius am-btn-block submit-ajax" data-url="{{:MyUrl('admin/order/collect')}}" data-id="{{$v.id}}" data-value="{{$v.user_id}}" data-view="reload" data-msg="是否操作收货,操作后不可恢复!">
|
||||
<i class="am-icon-check-circle-o"></i>
|
||||
<span>收货</span>
|
||||
</button>
|
||||
{{/if}}
|
||||
{{if in_array($v['status'], [5,6])}}
|
||||
<button class="am-btn am-btn-danger am-btn-xs am-radius am-btn-block submit-ajax" data-url="{{:MyUrl('admin/order/delete')}}" data-id="{{$v.id}}" data-value="{{$v.user_id}}" data-view="delete" data-msg="删除后无法恢复,确定继续吗?">
|
||||
<i class="am-icon-trash-o"></i>
|
||||
<span>删除</span>
|
||||
</button>
|
||||
{{/if}}
|
||||
|
||||
<!-- 订单列表操作钩子 -->
|
||||
{{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}}
|
||||
<div class="plugins-tag">
|
||||
<span>plugins_view_admin_order_list_operate</span>
|
||||
</div>
|
||||
{{/if}}
|
||||
{{php}}
|
||||
$hook_name = 'plugins_view_admin_order_list_operate';
|
||||
$hook_data = Hook::listen($hook_name, ['hook_name'=>$hook_name, 'is_backend'=>true, 'id'=>$v['id'], 'data'=>$v]);
|
||||
if(!empty($hook_data) && is_array($hook_data))
|
||||
{
|
||||
foreach($hook_data as $hook)
|
||||
{
|
||||
if(is_string($hook) || is_int($hook))
|
||||
{
|
||||
echo htmlspecialchars_decode($hook);
|
||||
}
|
||||
}
|
||||
}
|
||||
{{/php}}
|
||||
</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 -->
|
||||
|
||||
<!-- bottom operation start -->
|
||||
<div class="am-g am-margin-top-sm">
|
||||
<!-- 底部操作钩子 -->
|
||||
{{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}}
|
||||
<div class="plugins-tag">
|
||||
<span>plugins_view_admin_order_bottom_operate</span>
|
||||
</div>
|
||||
{{/if}}
|
||||
{{php}}
|
||||
$hook_name = 'plugins_view_admin_order_bottom_operate';
|
||||
$hook_data = Hook::listen($hook_name, ['hook_name'=>$hook_name, 'is_backend'=>true]);
|
||||
if(!empty($hook_data) && is_array($hook_data))
|
||||
{
|
||||
foreach($hook_data as $hook)
|
||||
{
|
||||
if(is_string($hook) || is_int($hook))
|
||||
{
|
||||
echo htmlspecialchars_decode($hook);
|
||||
}
|
||||
}
|
||||
}
|
||||
{{/php}}
|
||||
</div>
|
||||
<!-- bottom operation end -->
|
||||
|
||||
<!-- 取货弹窗 -->
|
||||
<div class="am-modal am-modal-no-btn" tabindex="-1" id="order-take-modal">
|
||||
<div class="am-modal-dialog">
|
||||
<div class="am-modal-hd">
|
||||
<a href="javascript: void(0)" class="am-close am-close-spin" data-am-modal-close>×</a>
|
||||
</div>
|
||||
<div class="am-modal-bd">
|
||||
<form class="am-form form-validation-take take-form" method="post" action="{{:MyUrl('admin/order/delivery')}}" request-type="ajax-reload">
|
||||
<div class="am-form-group am-form-group-refreshing am-margin-bottom-0">
|
||||
<label>取货码</label>
|
||||
<input type="text" autocomplete="off" name="extraction_code" placeholder="取货码" minlength="4" maxlength="4" data-validation-message="请填写4位数取货码" class="am-radius" required />
|
||||
</div>
|
||||
<div class="am-form-group am-form-group-refreshing">
|
||||
<input type="hidden" name="id" value="0" />
|
||||
<input type="hidden" name="user_id" value="0" />
|
||||
<button type="submit" class="am-btn am-btn-primary am-radius btn-loading-example am-btn-sm am-btn-block" data-am-loading="{loadingText:'处理中...'}">确认</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 发货弹窗 -->
|
||||
<div class="am-popup" id="order-delivery-popup">
|
||||
<div class="am-popup-inner">
|
||||
<div class="am-popup-hd">
|
||||
<h4 class="am-popup-title">发货操作</h4>
|
||||
<span data-am-modal-close class="am-close">×</span>
|
||||
</div>
|
||||
<div class="am-popup-bd">
|
||||
<form class="am-form form-validation-delivery delivery-form" method="post" action="{{:MyUrl('admin/order/delivery')}}" request-type="ajax-reload">
|
||||
<div class="business-item">
|
||||
{{if !empty($express_list)}}
|
||||
<ul class="express-list" data-type="express">
|
||||
{{foreach $express_list as $express}}
|
||||
{{if $express.is_enable eq 1}}
|
||||
<li class="express-items-{{$express.id}}" data-value="{{$express.id}}">
|
||||
{{if !empty($express.icon)}}
|
||||
<img src="{{$express.icon}}" />
|
||||
{{/if}}
|
||||
<span>{{$express.name}}</span>
|
||||
<i class="icon-active"></i>
|
||||
</li>
|
||||
{{/if}}
|
||||
{{/foreach}}
|
||||
</ul>
|
||||
{{/if}}
|
||||
{{if empty($express_list)}}
|
||||
<div class="table-no"><i class="am-icon-warning"></i> 没有快递方式</div>
|
||||
{{/if}}
|
||||
</div>
|
||||
|
||||
<div class="am-margin-top-sm">
|
||||
<label>快递单号</label>
|
||||
<input type="text" autocomplete="off" name="express_number" placeholder="快递单号" minlength="1" data-validation-message="请填写快递单号" class="am-radius" required />
|
||||
</div>
|
||||
|
||||
<div class="am-margin-top-lg">
|
||||
<input type="hidden" name="id" value="0" />
|
||||
<input type="hidden" name="express_id" value="0" />
|
||||
<input type="hidden" name="user_id" value="0" />
|
||||
<button type="submit" class="am-btn am-btn-primary am-radius btn-loading-example am-btn-sm am-btn-block" data-am-loading="{loadingText:'处理中...'}">确认</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 支付弹窗 -->
|
||||
<div class="am-popup" id="order-pay-popup">
|
||||
<div class="am-popup-inner">
|
||||
<div class="am-popup-hd">
|
||||
<h4 class="am-popup-title">支付操作</h4>
|
||||
<span data-am-modal-close class="am-close">×</span>
|
||||
</div>
|
||||
<div class="am-popup-bd">
|
||||
<form class="am-form form-validation-pay pay-form" action="{{:MyUrl('admin/order/pay')}}" method="POST" request-type="ajax-reload">
|
||||
<div class="business-item">
|
||||
{{if !empty($buy_payment_list)}}
|
||||
<ul class="payment-list" data-type="payment">
|
||||
{{foreach $buy_payment_list as $payment}}
|
||||
<li class="payment-items-{{$payment.id}}" data-value="{{$payment.id}}">
|
||||
{{if !empty($payment.logo)}}
|
||||
<img src="{{$payment.logo}}" />
|
||||
{{/if}}
|
||||
<span>{{$payment.name}}</span>
|
||||
<i class="icon-active"></i>
|
||||
</li>
|
||||
{{/foreach}}
|
||||
</ul>
|
||||
{{/if}}
|
||||
{{if empty($buy_payment_list)}}
|
||||
<div class="table-no"><i class="am-icon-warning"></i> 没有支付方式</div>
|
||||
{{/if}}
|
||||
</div>
|
||||
<div class="am-margin-top-sm">
|
||||
<input type="hidden" name="id" value="0" />
|
||||
<input type="hidden" name="payment_id" value="0" />
|
||||
<button type="submit" class="am-btn am-btn-primary am-radius btn-loading-example am-btn-sm am-btn-block" data-am-loading="{loadingText:'处理中...'}">确认</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 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 -->
|
||||
<!-- 继承公共的 form -->
|
||||
{{extend name="public/module/form" /}}
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
<!-- 地址信息 -->
|
||||
{{if !empty($module_data)}}
|
||||
{{if in_array($module_data['order_model'], [0,2]) and !empty($module_data['address_data'])}}
|
||||
{{$module_data.address_data.name}}<br />
|
||||
{{$module_data.address_data.tel}}<br />
|
||||
{{$module_data.address_data.province_name}}<br />
|
||||
{{$module_data.address_data.city_name}}<br />
|
||||
{{$module_data.address_data.county_name}}<br />
|
||||
{{$module_data.address_data.address}}
|
||||
{{else /}}
|
||||
<span class="cr-ddd">无信息</span>
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
<!-- 最新售后信息 -->
|
||||
{{if !empty($module_data) and !empty($module_data['aftersale_first'])}}
|
||||
<p>状态:{{$module_data.aftersale_first.status_text}}</p>
|
||||
<p>类型:{{$module_data.aftersale_first.type_text}}</p>
|
||||
<p>金额:<strong class="am-text-danger">{{$module_data.aftersale_first.price}}</strong></p>
|
||||
<p>数量:{{$module_data.aftersale_first.number}}</p>
|
||||
<p>原因:{{$module_data.aftersale_first.reason}}</p>
|
||||
{{/if}}
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
<!-- 快递信息 -->
|
||||
{{if !empty($module_data) and !empty($module_data['express_name'])}}
|
||||
<p>快递:{{$module_data.express_name}}</p>
|
||||
<p>单号:{{$module_data.express_number}}</p>
|
||||
{{/if}}
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
<!-- 扩展信息 -->
|
||||
{{if !empty($module_data) and !empty($module_data['extension_data'])}}
|
||||
{{foreach $v.extension_data as $extk=>$ext}}
|
||||
<p>{{$ext.name}} [{{$ext.tips}}]</p>
|
||||
{{/foreach}}
|
||||
{{/if}}
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
<!-- 订单基础信息 -->
|
||||
{{if !empty($module_data) and !empty($module_data['items'])}}
|
||||
{{foreach $module_data.items as $item}}
|
||||
<div class="am-nbfc am-padding-vertical-xs">
|
||||
<div class="base am-nbfc">
|
||||
<a href="{{:MyUrl('index/goods/index', ['id'=>$item['goods_id']])}}" target="_blank" title="{{$item.title}}">
|
||||
<img src="{{$item['images']}}" class="am-img-thumbnail am-radius am-margin-right-xs am-fl" width="60" height="60" />
|
||||
</a>
|
||||
<a href="{{:MyUrl('index/goods/index', ['id'=>$item['goods_id']])}}" target="_blank" title="{{$item.title}}" {{if !empty($item['title_color'])}} style="color:{{$item.title_color}};" {{/if}} class="am-nowrap-initial">{{$item.title}}</a>
|
||||
</div>
|
||||
<div class="other am-nbfc">
|
||||
<span class="am-fl am-text-xs am-nowrap-initial">
|
||||
{{if !empty($item.spec_text)}}
|
||||
{{$item.spec_text}}
|
||||
{{/if}}
|
||||
</span>
|
||||
<span class="am-fr">{{$item.price}}x{{$item.buy_number}}</span>
|
||||
{{if $item['returned_quantity'] gt 0 or $item['refund_price'] gt 0}}
|
||||
<span class="am-text-danger am-fr am-margin-right-lg">已退 {{$item.returned_quantity}} / {{$item.refund_price}}</span>
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
<hr data-am-widget="divider" class="am-divider am-divider-dashed am-margin-vertical-0" />
|
||||
{{/foreach}}
|
||||
<div class="am-margin-top-sm">{{$module_data.describe}}</div>
|
||||
{{/if}}
|
||||
|
|
@ -0,0 +1,48 @@
|
|||
<!-- 操作栏 -->
|
||||
<button type="button" class="am-btn am-btn-default am-btn-xs am-radius am-btn-block submit-popup" data-url="{{:MyUrl('admin/order/detail', ['id'=>$module_data['id']])}}">
|
||||
<i class="am-icon-eye"></i>
|
||||
<span>详情</span>
|
||||
</button>
|
||||
{{if in_array($module_data['status'], [0])}}
|
||||
<button type="button" class="am-btn am-btn-primary am-btn-xs am-radius am-btn-block submit-ajax" data-url="{{:MyUrl('admin/order/confirm')}}" data-id="{{$module_data.id}}" data-value="{{$module_data.user_id}}" data-view="reload" data-msg="是否操作收货,操作后不可恢复!">
|
||||
<i class="am-icon-check-circle-o"></i>
|
||||
<span>确认</span>
|
||||
</button>
|
||||
{{/if}}
|
||||
{{if in_array($module_data['status'], [0,1])}}
|
||||
<button type="button" class="am-btn am-btn-warning am-btn-xs am-radius am-btn-block submit-ajax" data-url="{{:MyUrl('admin/order/cancel')}}" data-id="{{$module_data.id}}" data-value="{{$module_data.user_id}}" data-view="reload" data-msg="取消后无法恢复,确定继续吗?">
|
||||
<i class="am-icon-paint-brush"></i>
|
||||
<span>取消</span>
|
||||
</button>
|
||||
{{if in_array($module_data['status'], [1])}}
|
||||
<button type="button" class="am-btn am-btn-success am-btn-xs am-radius am-btn-block submit-pay" data-id="{{$module_data.id}}" data-payment-id="{{$module_data.payment_id}}" data-am-modal="{target: '#order-pay-popup'}">
|
||||
<i class="am-icon-paypal"></i>
|
||||
<span>支付</span>
|
||||
</button>
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
{{if $module_data['status'] eq 2}}
|
||||
{{if $module_data['order_model'] eq 2}}
|
||||
<button type="button" class="am-btn am-btn-secondary am-btn-xs am-radius am-btn-block submit-take" data-id="{{$module_data.id}}" data-user-id="{{$module_data.user_id}}" data-am-modal="{target: '#order-take-modal', closeViaDimmer: 0, width: 200, height: 160}">
|
||||
<i class="am-icon-check"></i>
|
||||
<span>取货</span>
|
||||
</button>
|
||||
{{else /}}
|
||||
<button type="button" class="am-btn am-btn-secondary am-btn-xs am-radius am-btn-block submit-delivery" data-url="{{:MyUrl('admin/order/delivery')}}" data-id="{{$module_data.id}}" data-user-id="{{$module_data.user_id}}" data-express-id="{{$module_data.express_id}}" data-am-modal="{target: '#order-delivery-popup'}">
|
||||
<i class="am-icon-send-o"></i>
|
||||
<span>发货</span>
|
||||
</button>
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
{{if $module_data['status'] eq 3}}
|
||||
<button type="button" class="am-btn am-btn-success am-btn-xs am-radius am-btn-block submit-ajax" data-url="{{:MyUrl('admin/order/collect')}}" data-id="{{$module_data.id}}" data-value="{{$module_data.user_id}}" data-view="reload" data-msg="是否操作收货,操作后不可恢复!">
|
||||
<i class="am-icon-check-circle-o"></i>
|
||||
<span>收货</span>
|
||||
</button>
|
||||
{{/if}}
|
||||
{{if in_array($module_data['status'], [5,6])}}
|
||||
<button type="button" class="am-btn am-btn-danger am-btn-xs am-radius am-btn-block submit-ajax" data-url="{{:MyUrl('admin/order/delete')}}" data-id="{{$module_data.id}}" data-value="{{$module_data.user_id}}" data-view="delete" data-msg="删除后无法恢复,确定继续吗?">
|
||||
<i class="am-icon-trash-o"></i>
|
||||
<span>删除</span>
|
||||
</button>
|
||||
{{/if}}
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
<!-- 支付状态 -->
|
||||
{{if !empty($module_data)}}
|
||||
{{if $module_data['pay_status'] eq 1}}
|
||||
<p class="am-text-success">{{$module_data.pay_status_name}}</p>
|
||||
{{elseif $module_data['pay_status'] gt 1 /}}
|
||||
<p class="am-text-danger">{{$module_data.pay_status_name}}</p>
|
||||
{{else /}}
|
||||
<p>{{$module_data.pay_status_name}}</p>
|
||||
{{/if}}
|
||||
{{if !empty($module_data['is_under_line_text'])}}
|
||||
<p class="am-text-warning">{{$module_data.is_under_line_text}}</p>
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
<!-- 订单状态 -->
|
||||
{{if !empty($module_data)}}
|
||||
<p>{{$module_data.status_name}}</p>
|
||||
{{if $module_data['user_is_delete_time'] neq 0}}
|
||||
<p class="am-text-warning">用户已删除</p>
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
<!-- 取货信息 -->
|
||||
{{if !empty($module_data) and !empty($module_data['extraction_data'])}}
|
||||
<p>
|
||||
<span>取货码:</span>
|
||||
{{if empty($module_data['extraction_data']['code'])}}
|
||||
<span class="am-text-danger">取货码不存在、请联系管理员</span>
|
||||
{{else /}}
|
||||
<span class="am-badge am-badge-success am-radius">{{$module_data.extraction_data.code}}</span>
|
||||
{{/if}}
|
||||
</p>
|
||||
{{if !empty($module_data['extraction_data']['images'])}}
|
||||
<p class="am-margin-top-xs">
|
||||
<img class="am-img-thumbnail" src="{{$module_data.extraction_data.images}}" alt="取货码" width="100" height="100" />
|
||||
</p>
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
<!-- 用户信息 -->
|
||||
{{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}}
|
||||
|
|
@ -164,181 +164,189 @@ class FormHandleModule
|
|||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// 条件处理
|
||||
if(!empty($v['search_config']) && !empty($v['search_config']['form_type']) && !empty($v['search_config']['form_name']))
|
||||
if(!empty($v['search_config']) && !empty($v['search_config']['form_type']))
|
||||
{
|
||||
// 基础数据处理
|
||||
// 显示名称
|
||||
$label = empty($v['label']) ? '' : $v['label'];
|
||||
|
||||
// 唯一 formkey
|
||||
$form_key = 'fp'.$k;
|
||||
$v['form_key'] = $form_key;
|
||||
|
||||
// 根据组件类型处理
|
||||
switch($v['search_config']['form_type'])
|
||||
// 搜索 key 未指定则使用显示数据的字段名称
|
||||
if(empty($v['search_config']['form_name']))
|
||||
{
|
||||
// 单个输入
|
||||
case 'input' :
|
||||
// 提示信息处理
|
||||
if(empty($v['search_config']['placeholder']))
|
||||
{
|
||||
$v['search_config']['placeholder'] = '请输入'.$label;
|
||||
}
|
||||
break;
|
||||
|
||||
// 选择
|
||||
case 'select' :
|
||||
// 提示信息处理
|
||||
if(empty($v['search_config']['placeholder']))
|
||||
{
|
||||
$v['search_config']['placeholder'] = '请选择'.$label;
|
||||
}
|
||||
|
||||
// 选择数据 key=>name
|
||||
if(empty($v['search_config']['data_key']))
|
||||
{
|
||||
$v['search_config']['data_key'] = 'id';
|
||||
}
|
||||
if(empty($v['search_config']['data_name']))
|
||||
{
|
||||
$v['search_config']['data_key'] = 'name';
|
||||
}
|
||||
break;
|
||||
|
||||
// 区间
|
||||
case 'section' :
|
||||
// 提示信息处理
|
||||
if(empty($v['search_config']['placeholder_min']))
|
||||
{
|
||||
$v['search_config']['placeholder_min'] = '最小值';
|
||||
}
|
||||
if(empty($v['search_config']['placeholder_max']))
|
||||
{
|
||||
$v['search_config']['placeholder_max'] = '最大值';
|
||||
}
|
||||
break;
|
||||
|
||||
// 时间
|
||||
case 'datetime' :
|
||||
case 'date' :
|
||||
// 提示信息处理
|
||||
if(empty($v['search_config']['placeholder_start']))
|
||||
{
|
||||
$v['search_config']['placeholder_start'] = '开始';
|
||||
}
|
||||
if(empty($v['search_config']['placeholder_end']))
|
||||
{
|
||||
$v['search_config']['placeholder_end'] = '结束';
|
||||
}
|
||||
break;
|
||||
$v['search_config']['form_name'] = isset($v['view_key']) ? $v['view_key'] : '';
|
||||
}
|
||||
|
||||
// 搜索条件数据处理
|
||||
// 表单字段名称
|
||||
$name = $v['search_config']['form_name'];
|
||||
// 条件类型
|
||||
$type = isset($v['search_config']['where_type']) ? $v['search_config']['where_type'] : $v['search_config']['form_type'];
|
||||
// 是否自定义条件处理方法
|
||||
$custom = isset($v['search_config']['where_custom']) ? $v['search_config']['where_custom'] : '';
|
||||
// 根据条件类型处理
|
||||
switch($type)
|
||||
// 基础数据处理
|
||||
if(!empty($v['search_config']['form_name']))
|
||||
{
|
||||
// 单个值
|
||||
case '=' :
|
||||
case '<' :
|
||||
case '>' :
|
||||
case '<=' :
|
||||
case '>=' :
|
||||
case 'like' :
|
||||
if(array_key_exists($form_key, $this->out_params) && $this->out_params[$form_key] !== null && $this->out_params[$form_key] !== '')
|
||||
{
|
||||
// 参数值
|
||||
$value = urldecode($this->out_params[$form_key]);
|
||||
$this->where_params[$form_key] = $value;
|
||||
// 显示名称
|
||||
$label = empty($v['label']) ? '' : $v['label'];
|
||||
|
||||
// 条件值处理
|
||||
$value = $this->WhereValueHandle($value, $custom);
|
||||
// 唯一 formkey
|
||||
$form_key = 'fp'.$k;
|
||||
$v['form_key'] = $form_key;
|
||||
|
||||
// 是否 like 条件
|
||||
if($type == 'like')
|
||||
// 根据组件类型处理
|
||||
switch($v['search_config']['form_type'])
|
||||
{
|
||||
// 单个输入
|
||||
case 'input' :
|
||||
// 提示信息处理
|
||||
if(empty($v['search_config']['placeholder']))
|
||||
{
|
||||
$value = '%'.$value.'%';
|
||||
$v['search_config']['placeholder'] = '请输入'.$label;
|
||||
}
|
||||
break;
|
||||
|
||||
// 选择
|
||||
case 'select' :
|
||||
// 提示信息处理
|
||||
if(empty($v['search_config']['placeholder']))
|
||||
{
|
||||
$v['search_config']['placeholder'] = '请选择'.$label;
|
||||
}
|
||||
|
||||
// 条件
|
||||
$this->where[] = [$name, $type, $value];
|
||||
}
|
||||
break;
|
||||
|
||||
// in
|
||||
case 'in' :
|
||||
if(array_key_exists($form_key, $this->out_params) && $this->out_params[$form_key] !== null && $this->out_params[$form_key] !== '')
|
||||
{
|
||||
// 参数值
|
||||
$value = urldecode($this->out_params[$form_key]);
|
||||
if(!is_array($value))
|
||||
// 选择数据 key=>name
|
||||
if(empty($v['search_config']['data_key']))
|
||||
{
|
||||
$value = explode(',', $value);
|
||||
$v['search_config']['data_key'] = 'id';
|
||||
}
|
||||
$this->where_params[$form_key] = $value;
|
||||
if(empty($v['search_config']['data_name']))
|
||||
{
|
||||
$v['search_config']['data_key'] = 'name';
|
||||
}
|
||||
break;
|
||||
|
||||
// 条件
|
||||
$this->where[] = [$name, $type, $this->WhereValueHandle($value, $custom)];
|
||||
}
|
||||
break;
|
||||
// 区间
|
||||
case 'section' :
|
||||
// 提示信息处理
|
||||
if(empty($v['search_config']['placeholder_min']))
|
||||
{
|
||||
$v['search_config']['placeholder_min'] = '最小值';
|
||||
}
|
||||
if(empty($v['search_config']['placeholder_max']))
|
||||
{
|
||||
$v['search_config']['placeholder_max'] = '最大值';
|
||||
}
|
||||
break;
|
||||
|
||||
// 区间值
|
||||
case 'section' :
|
||||
$key_min = $form_key.'_min';
|
||||
$key_max = $form_key.'_max';
|
||||
if(array_key_exists($key_min, $this->out_params) && $this->out_params[$key_min] !== null && $this->out_params[$key_min] !== '')
|
||||
{
|
||||
// 参数值
|
||||
$value = urldecode($this->out_params[$key_min]);
|
||||
$this->where_params[$key_min] = $value;
|
||||
// 时间
|
||||
case 'datetime' :
|
||||
case 'date' :
|
||||
// 提示信息处理
|
||||
if(empty($v['search_config']['placeholder_start']))
|
||||
{
|
||||
$v['search_config']['placeholder_start'] = '开始';
|
||||
}
|
||||
if(empty($v['search_config']['placeholder_end']))
|
||||
{
|
||||
$v['search_config']['placeholder_end'] = '结束';
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
// 条件
|
||||
$this->where[] = [$name, '>=', $this->WhereValueHandle($value, $custom, ['is_min'=>1])];
|
||||
}
|
||||
if(array_key_exists($key_max, $this->out_params) && $this->out_params[$key_max] !== null && $this->out_params[$key_max] !== '')
|
||||
{
|
||||
// 参数值
|
||||
$value = urldecode($this->out_params[$key_max]);
|
||||
$this->where_params[$key_max] = $value;
|
||||
// 搜索条件数据处理
|
||||
// 表单字段名称
|
||||
$name = $v['search_config']['form_name'];
|
||||
// 条件类型
|
||||
$type = isset($v['search_config']['where_type']) ? $v['search_config']['where_type'] : $v['search_config']['form_type'];
|
||||
// 是否自定义条件处理方法
|
||||
$custom = isset($v['search_config']['where_custom']) ? $v['search_config']['where_custom'] : '';
|
||||
// 根据条件类型处理
|
||||
switch($type)
|
||||
{
|
||||
// 单个值
|
||||
case '=' :
|
||||
case '<' :
|
||||
case '>' :
|
||||
case '<=' :
|
||||
case '>=' :
|
||||
case 'like' :
|
||||
if(array_key_exists($form_key, $this->out_params) && $this->out_params[$form_key] !== null && $this->out_params[$form_key] !== '')
|
||||
{
|
||||
// 参数值
|
||||
$value = urldecode($this->out_params[$form_key]);
|
||||
$this->where_params[$form_key] = $value;
|
||||
|
||||
// 条件
|
||||
$this->where[] = [$name, '<=', $this->WhereValueHandle($value, $custom, ['is_end'=>1])];
|
||||
}
|
||||
break;
|
||||
// 条件值处理
|
||||
$value = $this->WhereValueHandle($value, $custom);
|
||||
|
||||
// 时间
|
||||
case 'datetime' :
|
||||
case 'date' :
|
||||
$key_start = $form_key.'_start';
|
||||
$key_end = $form_key.'_end';
|
||||
if(array_key_exists($key_start, $this->out_params) && $this->out_params[$key_start] !== null && $this->out_params[$key_start] !== '')
|
||||
{
|
||||
// 参数值
|
||||
$value = urldecode($this->out_params[$key_start]);
|
||||
$this->where_params[$key_start] = $value;
|
||||
// 是否 like 条件
|
||||
if($type == 'like')
|
||||
{
|
||||
$value = '%'.$value.'%';
|
||||
}
|
||||
|
||||
// 条件
|
||||
$this->where[] = [$name, '>=', $this->WhereValueHandle(strtotime($value), $custom, ['is_start'=>1])];
|
||||
}
|
||||
if(array_key_exists($key_end, $this->out_params) && $this->out_params[$key_end] !== null && $this->out_params[$key_end] !== '')
|
||||
{
|
||||
// 参数值
|
||||
$value = urldecode($this->out_params[$key_end]);
|
||||
$this->where_params[$key_end] = $value;
|
||||
// 条件
|
||||
$this->where[] = [$name, $type, $value];
|
||||
}
|
||||
break;
|
||||
|
||||
// 条件
|
||||
$this->where[] = [$name, '<=', $this->WhereValueHandle(strtotime($value), $custom, ['is_end'=>1])];
|
||||
// in
|
||||
case 'in' :
|
||||
if(array_key_exists($form_key, $this->out_params) && $this->out_params[$form_key] !== null && $this->out_params[$form_key] !== '')
|
||||
{
|
||||
// 参数值
|
||||
$value = urldecode($this->out_params[$form_key]);
|
||||
if(!is_array($value))
|
||||
{
|
||||
$value = explode(',', $value);
|
||||
}
|
||||
$this->where_params[$form_key] = $value;
|
||||
|
||||
}
|
||||
break;
|
||||
// 条件
|
||||
$this->where[] = [$name, $type, $this->WhereValueHandle($value, $custom)];
|
||||
}
|
||||
break;
|
||||
|
||||
// 区间值
|
||||
case 'section' :
|
||||
$key_min = $form_key.'_min';
|
||||
$key_max = $form_key.'_max';
|
||||
if(array_key_exists($key_min, $this->out_params) && $this->out_params[$key_min] !== null && $this->out_params[$key_min] !== '')
|
||||
{
|
||||
// 参数值
|
||||
$value = urldecode($this->out_params[$key_min]);
|
||||
$this->where_params[$key_min] = $value;
|
||||
|
||||
// 条件
|
||||
$this->where[] = [$name, '>=', $this->WhereValueHandle($value, $custom, ['is_min'=>1])];
|
||||
}
|
||||
if(array_key_exists($key_max, $this->out_params) && $this->out_params[$key_max] !== null && $this->out_params[$key_max] !== '')
|
||||
{
|
||||
// 参数值
|
||||
$value = urldecode($this->out_params[$key_max]);
|
||||
$this->where_params[$key_max] = $value;
|
||||
|
||||
// 条件
|
||||
$this->where[] = [$name, '<=', $this->WhereValueHandle($value, $custom, ['is_end'=>1])];
|
||||
}
|
||||
break;
|
||||
|
||||
// 时间
|
||||
case 'datetime' :
|
||||
case 'date' :
|
||||
$key_start = $form_key.'_start';
|
||||
$key_end = $form_key.'_end';
|
||||
if(array_key_exists($key_start, $this->out_params) && $this->out_params[$key_start] !== null && $this->out_params[$key_start] !== '')
|
||||
{
|
||||
// 参数值
|
||||
$value = urldecode($this->out_params[$key_start]);
|
||||
$this->where_params[$key_start] = $value;
|
||||
|
||||
// 条件
|
||||
$this->where[] = [$name, '>=', $this->WhereValueHandle(strtotime($value), $custom, ['is_start'=>1])];
|
||||
}
|
||||
if(array_key_exists($key_end, $this->out_params) && $this->out_params[$key_end] !== null && $this->out_params[$key_end] !== '')
|
||||
{
|
||||
// 参数值
|
||||
$value = urldecode($this->out_params[$key_end]);
|
||||
$this->where_params[$key_end] = $value;
|
||||
|
||||
// 条件
|
||||
$this->where[] = [$name, '<=', $this->WhereValueHandle(strtotime($value), $custom, ['is_end'=>1])];
|
||||
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue