订单仓库
parent
5cde6e5a92
commit
9f9dcfb365
|
|
@ -109,5 +109,27 @@ class PayLog extends Common
|
|||
}
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* 关闭
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @date 2020-07-28
|
||||
* @desc description
|
||||
*/
|
||||
public function Close()
|
||||
{
|
||||
// 是否ajax
|
||||
if(!IS_AJAX)
|
||||
{
|
||||
return $this->error('非法访问');
|
||||
}
|
||||
|
||||
// 开始操作
|
||||
$params = $this->data_post;
|
||||
$params['admin'] = $this->admin;
|
||||
return PayLogService::PayLogClose($params);
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
|
@ -55,7 +55,7 @@ class Order
|
|||
'label' => '基础信息',
|
||||
'view_type' => 'module',
|
||||
'view_key' => 'order/module/goods',
|
||||
'grid_size' => 'lg',
|
||||
'grid_size' => 'xl',
|
||||
'is_detail' => 0,
|
||||
'search_config' => [
|
||||
'form_type' => 'input',
|
||||
|
|
@ -63,7 +63,7 @@ class Order
|
|||
'where_type' => 'like',
|
||||
'where_type_custom' => 'in',
|
||||
'where_handle_custom' => 'WhereBaseGoodsInfo',
|
||||
'placeholder' => '请输入订单ID/订单号/商品名称/型号',
|
||||
'placeholder' => '请输入订单ID/订单号/仓库/商品名称/型号',
|
||||
],
|
||||
],
|
||||
[
|
||||
|
|
@ -457,8 +457,11 @@ class Order
|
|||
{
|
||||
if(!empty($value))
|
||||
{
|
||||
// 仓库
|
||||
$wids = Db::name('Warehouse')->where('name', 'like', '%'.$value.'%')->column('id');
|
||||
|
||||
// 订单ID、订单号
|
||||
$ids = Db::name('Order')->where(['id|order_no'=>$value])->column('id');
|
||||
$ids = Db::name('Order')->where(['id|order_no'=>$value])->whereOr(['warehouse_id'=>$wids])->column('id');
|
||||
|
||||
// 获取订单详情搜索的订单 id
|
||||
if(empty($ids))
|
||||
|
|
|
|||
|
|
@ -65,6 +65,7 @@ class Paylog
|
|||
'label' => '支付单号',
|
||||
'view_type' => 'field',
|
||||
'view_key' => 'log_no',
|
||||
'width' => 165,
|
||||
'search_config' => [
|
||||
'form_type' => 'input',
|
||||
'where_type' => '=',
|
||||
|
|
@ -74,6 +75,7 @@ class Paylog
|
|||
'label' => '支付方式',
|
||||
'view_type' => 'module',
|
||||
'view_key' => 'paylog/module/payment',
|
||||
'grid_size' => 'sm',
|
||||
'search_config' => [
|
||||
'form_type' => 'select',
|
||||
'form_name' => 'payment',
|
||||
|
|
@ -240,8 +242,19 @@ class Paylog
|
|||
*/
|
||||
public function PayLogPaymentTypeList()
|
||||
{
|
||||
$data = [];
|
||||
$ret = PayLogService::PayLogTypeList();
|
||||
return empty($ret['data']) ? [] : $ret['data'];
|
||||
if(!empty($ret['data']))
|
||||
{
|
||||
foreach($ret['data'] as $v)
|
||||
{
|
||||
$data[] = [
|
||||
'id' => $v['id'],
|
||||
'name' => $v['name'].'('.$v['id'].')',
|
||||
];
|
||||
}
|
||||
}
|
||||
return $data;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -64,6 +64,7 @@ class Refundlog
|
|||
'label' => '支付方式',
|
||||
'view_type' => 'module',
|
||||
'view_key' => 'refundlog/module/payment',
|
||||
'grid_size' => 'sm',
|
||||
'search_config' => [
|
||||
'form_type' => 'select',
|
||||
'form_name' => 'payment',
|
||||
|
|
@ -102,6 +103,7 @@ class Refundlog
|
|||
'label' => '支付平台交易号',
|
||||
'view_type' => 'field',
|
||||
'view_key' => 'trade_no',
|
||||
'grid_size' => 'sm',
|
||||
'search_config' => [
|
||||
'form_type' => 'input',
|
||||
'where_type' => 'like',
|
||||
|
|
@ -111,6 +113,7 @@ class Refundlog
|
|||
'label' => '支付平台用户帐号',
|
||||
'view_type' => 'field',
|
||||
'view_key' => 'buyer_user',
|
||||
'grid_size' => 'sm',
|
||||
'search_config' => [
|
||||
'form_type' => 'input',
|
||||
'where_type' => 'like',
|
||||
|
|
|
|||
|
|
@ -1,8 +1,11 @@
|
|||
<!-- 订单商品信息 -->
|
||||
{{if !empty($module_data) and !empty($module_data['items'])}}
|
||||
<p class="am-nbfc am-margin-bottom-sm">
|
||||
<strong class="am-fl am-icon-bookmark-o"> {{$module_data.order_no}}</strong>
|
||||
<strong class="am-fr am-icon-circle-thin"> {{$module_data.id}}</strong>
|
||||
<strong class="am-icon-bookmark-o"> {{$module_data.order_no}}</strong>
|
||||
<strong class="am-icon-circle-thin am-margin-left-lg"> {{$module_data.id}}</strong>
|
||||
{{if !empty($module_data['warehouse_name'])}}
|
||||
<span class="am-badge am-badge-secondary-plain am-radius am-fr">{{$module_data.warehouse_name}}</span>
|
||||
{{/if}}
|
||||
</p>
|
||||
<hr data-am-widget="divider" class="am-divider am-divider-dashed am-margin-top-0" />
|
||||
{{foreach $module_data.items as $item}}
|
||||
|
|
|
|||
|
|
@ -2,4 +2,10 @@
|
|||
<button type="button" class="am-btn am-btn-default am-btn-xs am-radius am-btn-block submit-popup" data-url="{{:MyUrl('admin/paylog/detail', ['id'=>$module_data['id']])}}">
|
||||
<i class="am-icon-eye"></i>
|
||||
<span>详情</span>
|
||||
</button>
|
||||
</button>
|
||||
{{if $module_data['status'] eq 0}}
|
||||
<button type="button" class="am-btn am-btn-warning am-btn-xs am-radius am-btn-block submit-ajax" data-url="{{:MyUrl('admin/paylog/close')}}" data-id="{{$module_data.id}}" data-key="ids" data-view="reload">
|
||||
<i class="am-icon-close"></i>
|
||||
<span>关闭</span>
|
||||
</button>
|
||||
{{/if}}
|
||||
|
|
@ -20,7 +20,12 @@
|
|||
|
||||
<div class="am-form-group">
|
||||
<label>{{$data.common_order_close_limit_time.name}}<span class="am-form-group-label-tips">{{$data.common_order_close_limit_time.describe}}</span></label>
|
||||
<input type="number" name="{{$data.common_order_close_limit_time.only_tag}}" placeholder="{{$data.common_order_close_limit_time.name}}" data-validation-message="{{$data.common_order_close_limit_time.error_tips}}" class="am-radius" {{if !empty($data)}}value="{{$data.common_order_close_limit_time.value}}"{{/if}} required />
|
||||
<div class="am-input-group am-input-group-sm">
|
||||
<input type="number" min="0" name="{{$data.common_order_close_limit_time.only_tag}}" placeholder="{{$data.common_order_close_limit_time.name}}" data-validation-message="{{$data.common_order_close_limit_time.error_tips}}" class="am-radius" {{if !empty($data)}}value="{{$data.common_order_close_limit_time.value}}"{{/if}} />
|
||||
<span class="am-input-group-btn">
|
||||
<button class="am-btn am-btn-default" type="button">分钟</button>
|
||||
</span>
|
||||
</div>
|
||||
<div class="am-alert am-alert-warning" data-am-alert>
|
||||
<p class="am-text-warning">建议将该地址添加到linux定时任务定时请求即可(结果 sucs:0, fail:0 冒号后面则是处理的数据条数,sucs成功,fali失败)</p>
|
||||
<a href="{{:MyUrl('api/crontab/orderclose')}}" target="_blank">{{:MyUrl('api/crontab/orderclose')}}</a>
|
||||
|
|
@ -29,12 +34,31 @@
|
|||
|
||||
<div class="am-form-group">
|
||||
<label>{{$data.common_order_success_limit_time.name}}<span class="am-form-group-label-tips">{{$data.common_order_success_limit_time.describe}}</span></label>
|
||||
<input type="number" name="{{$data.common_order_success_limit_time.only_tag}}" placeholder="{{$data.common_order_success_limit_time.name}}" data-validation-message="{{$data.common_order_success_limit_time.error_tips}}" class="am-radius" {{if !empty($data)}}value="{{$data.common_order_success_limit_time.value}}"{{/if}} required />
|
||||
<div class="am-input-group am-input-group-sm">
|
||||
<input type="number" min="0" name="{{$data.common_order_success_limit_time.only_tag}}" placeholder="{{$data.common_order_success_limit_time.name}}" data-validation-message="{{$data.common_order_success_limit_time.error_tips}}" class="am-radius" {{if !empty($data)}}value="{{$data.common_order_success_limit_time.value}}"{{/if}} />
|
||||
<span class="am-input-group-btn">
|
||||
<button class="am-btn am-btn-default" type="button">分钟</button>
|
||||
</span>
|
||||
</div>
|
||||
<div class="am-alert am-alert-warning" data-am-alert>
|
||||
<p class="am-text-warning">建议将该地址添加到linux定时任务定时请求即可(结果 sucs:0, fail:0 冒号后面则是处理的数据条数,sucs成功,fali失败)</p>
|
||||
<a href="{{:MyUrl('api/crontab/ordersuccess')}}" target="_blank">{{:MyUrl('api/crontab/ordersuccess')}}</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="am-form-group">
|
||||
<label>{{$data.common_pay_log_order_close_limit_time.name}}<span class="am-form-group-label-tips">{{$data.common_pay_log_order_close_limit_time.describe}}</span></label>
|
||||
<div class="am-input-group am-input-group-sm">
|
||||
<input type="number" min="0" name="{{$data.common_pay_log_order_close_limit_time.only_tag}}" placeholder="{{$data.common_pay_log_order_close_limit_time.name}}" data-validation-message="{{$data.common_pay_log_order_close_limit_time.error_tips}}" class="am-radius" {{if !empty($data)}}value="{{$data.common_pay_log_order_close_limit_time.value}}"{{/if}} />
|
||||
<span class="am-input-group-btn">
|
||||
<button class="am-btn am-btn-default" type="button">分钟</button>
|
||||
</span>
|
||||
</div>
|
||||
<div class="am-alert am-alert-warning" data-am-alert>
|
||||
<p class="am-text-warning">建议将该地址添加到linux定时任务定时请求即可(结果 sucs:0, fail:0 冒号后面则是处理的数据条数,sucs成功,fali失败)</p>
|
||||
<a href="{{:MyUrl('api/crontab/paylogorderclose')}}" target="_blank">{{:MyUrl('api/crontab/paylogorderclose')}}</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="am-form-group am-form-group-refreshing">
|
||||
<input type="hidden" name="nav_type" value="{{$nav_type}}" />
|
||||
|
|
|
|||
|
|
@ -46,5 +46,18 @@ class Crontab extends Common
|
|||
$ret = CrontabService::OrderSuccess();
|
||||
return 'sucs:'.$ret['data']['sucs'].', fail:'.$ret['data']['fail'];
|
||||
}
|
||||
|
||||
/**
|
||||
* 支付日志订单关闭
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @datetime 2019-08-18T17:19:33+0800
|
||||
*/
|
||||
public function PayLogOrderClose()
|
||||
{
|
||||
$ret = CrontabService::PayLogOrderClose();
|
||||
return 'count:'.$ret['data'];
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
|
@ -91,7 +91,7 @@ class Order
|
|||
'where_type' => 'like',
|
||||
'where_type_custom' => 'in',
|
||||
'where_handle_custom' => 'WhereBaseGoodsInfo',
|
||||
'placeholder' => '请输入订单号/商品名称/型号',
|
||||
'placeholder' => '请输入订单号/仓库/商品名称/型号',
|
||||
],
|
||||
],
|
||||
[
|
||||
|
|
@ -441,8 +441,11 @@ class Order
|
|||
{
|
||||
if(!empty($value))
|
||||
{
|
||||
// 仓库
|
||||
$wids = Db::name('Warehouse')->where('name', 'like', '%'.$value.'%')->column('id');
|
||||
|
||||
// 订单号
|
||||
$ids = Db::name('Order')->where(['order_no'=>$value])->column('id');
|
||||
$ids = Db::name('Order')->where(['order_no'=>$value])->whereOr(['warehouse_id'=>$wids])->column('id');
|
||||
|
||||
// 获取订单详情搜索的订单 id
|
||||
if(empty($ids))
|
||||
|
|
|
|||
|
|
@ -93,10 +93,18 @@
|
|||
<div class="am-panel am-panel-default">
|
||||
<div class="am-panel-hd">订单信息</div>
|
||||
<div class="am-panel-bd">
|
||||
{{if !empty($data['warehouse_name'])}}
|
||||
<div class="items am-cf">
|
||||
<div class="items-title am-fl">出货仓库:</div>
|
||||
<div class="items-detail am-fl">
|
||||
<span class="am-badge am-badge-secondary-plain am-radius">{{$data.warehouse_name}}</span>
|
||||
</div>
|
||||
</div>
|
||||
{{/if}}
|
||||
<div class="items am-cf">
|
||||
<div class="items-title am-fl">订单模式:</div>
|
||||
<div class="items-detail am-fl">
|
||||
<span class="am-badge am-badge-secondary am-radius">{{$data.order_model_name}}</span>
|
||||
<span class="am-badge am-badge-secondary-plain am-radius">{{$data.order_model_name}}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="items am-cf">
|
||||
|
|
|
|||
|
|
@ -1,7 +1,10 @@
|
|||
<!-- 订单商品信息 -->
|
||||
{{if !empty($module_data) and !empty($module_data['items'])}}
|
||||
<p class="am-icon-bookmark-o am-margin-bottom-sm">
|
||||
<strong>{{$module_data.order_no}}</strong>
|
||||
<p class="am-margin-bottom-sm">
|
||||
<strong class="am-icon-bookmark-o"> {{$module_data.order_no}}</strong>
|
||||
{{if !empty($module_data['warehouse_name'])}}
|
||||
<span class="am-badge am-badge-secondary-plain am-radius am-fr">{{$module_data.warehouse_name}}</span>
|
||||
{{/if}}
|
||||
</p>
|
||||
<hr data-am-widget="divider" class="am-divider am-divider-dashed am-margin-top-0" />
|
||||
{{foreach $module_data.items as $item}}
|
||||
|
|
|
|||
|
|
@ -1037,6 +1037,7 @@ class BuyService
|
|||
$order = [
|
||||
'order_no' => date('YmdHis').GetNumberCode(6),
|
||||
'user_id' => $params['user']['id'],
|
||||
'warehouse_id' => $v['id'],
|
||||
'user_note' => $user_note,
|
||||
'status' => $status,
|
||||
'preferential_price' => ($v['order_base']['preferential_price'] <= 0.00) ? 0.00 : $v['order_base']['preferential_price'],
|
||||
|
|
|
|||
|
|
@ -149,5 +149,32 @@ class CrontabService
|
|||
}
|
||||
return DataReturn('操作成功', 0, ['sucs'=>$sucs, 'fail'=>$fail]);
|
||||
}
|
||||
|
||||
/**
|
||||
* 支付日志订单关闭
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @date 2020-07-28
|
||||
* @desc description
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public static function PayLogOrderClose($params = [])
|
||||
{
|
||||
// 时长
|
||||
$time = time()-(intval(MyC('common_pay_log_order_close_limit_time', 30, true))*60);
|
||||
|
||||
// 更新关闭
|
||||
$where = [
|
||||
['add_time', '<', $time],
|
||||
['status', '=', 0],
|
||||
];
|
||||
$data = [
|
||||
'status' => 2,
|
||||
'close_time' => time(),
|
||||
];
|
||||
$res = Db::name('PayLog')->where($where)->update($data);
|
||||
return DataReturn('操作成功', 0, $res);
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
|
@ -978,6 +978,9 @@ class OrderService
|
|||
$result = [];
|
||||
if(!empty($data))
|
||||
{
|
||||
// 字段列表
|
||||
$keys = ArrayKeys($data);
|
||||
|
||||
// 其它额外处理
|
||||
$is_items = isset($params['is_items']) ? intval($params['is_items']) : 1;
|
||||
$is_orderaftersale = isset($params['is_orderaftersale']) ? intval($params['is_orderaftersale']) : 0;
|
||||
|
|
@ -989,6 +992,14 @@ class OrderService
|
|||
$common_platform_type = lang('common_platform_type');
|
||||
$common_site_type_list = lang('common_site_type_list');
|
||||
|
||||
// 仓库信息
|
||||
if(in_array('warehouse_id', $keys))
|
||||
{
|
||||
// 地区数据
|
||||
$we_ids = array_unique(array_column($data, 'warehouse_id'));
|
||||
$warehouse = Db::name('Warehouse')->where(['id'=>$we_ids])->column('name', 'id');
|
||||
}
|
||||
|
||||
// 循环处理数据
|
||||
foreach($data as &$v)
|
||||
{
|
||||
|
|
@ -1006,6 +1017,12 @@ class OrderService
|
|||
return $ret;
|
||||
}
|
||||
|
||||
// 订单所属仓库
|
||||
if(isset($v['warehouse_id']))
|
||||
{
|
||||
$v['warehouse_name'] = isset($warehouse[$v['warehouse_id']]) ? $warehouse[$v['warehouse_id']] : '';
|
||||
}
|
||||
|
||||
// 订单模式处理
|
||||
// 销售型模式+自提模式
|
||||
if(in_array($v['order_model'], [0,2]))
|
||||
|
|
|
|||
|
|
@ -240,5 +240,36 @@ class PayLogService
|
|||
{
|
||||
return (int) Db::name('PayLog')->where($where)->count();
|
||||
}
|
||||
|
||||
/**
|
||||
* 关闭
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @date 2018-12-18
|
||||
* @desc description
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public static function PayLogClose($params = [])
|
||||
{
|
||||
// 参数是否有误
|
||||
if(empty($params['ids']))
|
||||
{
|
||||
return DataReturn('操作id有误', -1);
|
||||
}
|
||||
// 是否数组
|
||||
if(!is_array($params['ids']))
|
||||
{
|
||||
$params['ids'] = explode(',', $params['ids']);
|
||||
}
|
||||
|
||||
// 关闭操作
|
||||
if(Db::name('PayLog')->where(['id'=>$params['ids']])->update(['status'=>2, 'close_time'=>time()]))
|
||||
{
|
||||
return DataReturn('关闭成功');
|
||||
}
|
||||
|
||||
return DataReturn('关闭失败', -100);
|
||||
}
|
||||
}
|
||||
?>
|
||||
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue