mirror of
https://gitee.com/zongzhige/shopxo.git
synced 2024-12-03 04:19:37 +08:00
后台订单管理
This commit is contained in:
parent
aca34dc672
commit
3d69c09ae4
@ -3,6 +3,7 @@
|
||||
namespace Admin\Controller;
|
||||
|
||||
use Service\OrderService;
|
||||
use Service\ResourcesService;
|
||||
|
||||
/**
|
||||
* 订单管理
|
||||
@ -70,7 +71,7 @@ class OrderController extends CommonController
|
||||
$this->assign('common_order_pay_status', L('common_order_pay_status'));
|
||||
|
||||
// 快递公司
|
||||
$this->assign('express_list', M('Express')->field('id,name')->where(['is_enable'=>1])->select());
|
||||
$this->assign('express_list', ResourcesService::ExpressList());
|
||||
|
||||
// 参数
|
||||
$this->assign('param', $param);
|
||||
@ -131,7 +132,6 @@ class OrderController extends CommonController
|
||||
|
||||
// 快递公司
|
||||
$v['express_name'] = GetExpressName($v['express_id']);
|
||||
unset($v['express_id']);
|
||||
|
||||
// 收件人地址
|
||||
$v['receive_province_name'] = GetRegionName($v['receive_province']);
|
||||
@ -280,39 +280,12 @@ class OrderController extends CommonController
|
||||
$this->error(L('common_unauthorized_access'));
|
||||
}
|
||||
|
||||
// 参数处理
|
||||
$id = I('id');
|
||||
|
||||
// 取消数据
|
||||
if(!empty($id))
|
||||
{
|
||||
// 订单模型
|
||||
$m = M('Order');
|
||||
|
||||
// 订单是否存在
|
||||
$data = $m->field('id,status')->find($id);
|
||||
if(empty($data))
|
||||
{
|
||||
$this->ajaxReturn(L('common_data_no_exist_error'), -2);
|
||||
}
|
||||
|
||||
// 状态
|
||||
if(!in_array($data['status'], [2]))
|
||||
{
|
||||
$this->ajaxReturn('状态不可操作['.L('common_order_admin_status')[$data['status']]['name'].']', -3);
|
||||
}
|
||||
|
||||
// 取消订单
|
||||
$status = $m->where(array('id'=>$id))->save(['status'=>3, 'upd_time'=>time(), 'delivery_time'=>time()]);
|
||||
if($status !== false)
|
||||
{
|
||||
$this->ajaxReturn(L('common_operation_delivery_success'));
|
||||
} else {
|
||||
$this->ajaxReturn(L('common_operation_delivery_error'), -100);
|
||||
}
|
||||
} else {
|
||||
$this->ajaxReturn(L('common_param_error'), -1);
|
||||
}
|
||||
// 发货操作
|
||||
$params = $_POST;
|
||||
$params['creator'] = $this->admin['id'];
|
||||
$params['creator_name'] = $this->admin['username'];
|
||||
$ret = OrderService::OrderDelivery($params);
|
||||
$this->ajaxReturn($ret['msg'], $ret['code'], $ret['data']);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -23,5 +23,11 @@ return array(
|
||||
'order_delivery_time_text' => '发货时间',
|
||||
'order_cancel_time_text' => '取消时间',
|
||||
'order_success_time_text' => '完成时间',
|
||||
|
||||
'order_delivery_popup_title' => '发货操作',
|
||||
'order_express_not_data_tips' => '没有快递方式',
|
||||
'order_business_express_title' => '选择快递',
|
||||
'order_express_number_text' => '快递单号',
|
||||
'order_express_number_format' => '请填写快递单号',
|
||||
);
|
||||
?>
|
@ -100,8 +100,15 @@
|
||||
{{$v.express_name}}<br />{{$v.express_number}}
|
||||
</if>
|
||||
</td>
|
||||
<td>{{$v.status_text}}</td>
|
||||
<td>{{$v.pay_status_text}}</td>
|
||||
<td>
|
||||
<span class="block">{{$v.status_text}}</span>
|
||||
<if condition="$v['user_is_delete_time'] neq 0">
|
||||
<span class="block cr-red fs-12">用户已删除</span>
|
||||
</if>
|
||||
</td>
|
||||
<td>
|
||||
<span class="block">{{$v.pay_status_text}}</span>
|
||||
</td>
|
||||
<td>
|
||||
订单金额:{{$v.price}}<br />
|
||||
优惠金额:{{$v.preferential_price}}<br />
|
||||
@ -205,12 +212,12 @@
|
||||
<button class="am-btn am-btn-default am-btn-xs am-radius am-icon-paint-brush am-btn-block submit-ajax" data-url="{{:U('Admin/Order/Cancel')}}" data-id="{{$v.id}}" data-value="{{$v.user_id}}" data-view="reload" data-msg="{{:L('common_cancel_tips')}}"> {{:L('common_operation_cancel')}}</button>
|
||||
</if>
|
||||
<if condition="$v['status'] eq 2">
|
||||
<button class="am-btn am-btn-default am-btn-xs am-radius am-icon-send-o am-btn-block submit-ajax" data-url="{{:U('Admin/Order/Delivery')}}" data-id="{{$v.id}}" data-value="{{$v.user_id}}" data-view="reload" data-msg="{{:L('common_delivery_tips')}}"> {{:L('common_delivery_submit')}}</button>
|
||||
<button class="am-btn am-btn-default am-btn-xs am-radius am-icon-send-o am-btn-block submit-delivery" data-url="{{:U('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'}"> {{:L('common_delivery_submit')}}</button>
|
||||
</if>
|
||||
<if condition="$v['status'] eq 3">
|
||||
<button class="am-btn am-btn-default am-btn-xs am-radius am-icon-check-circle-o am-btn-block submit-ajax" data-url="{{:U('Admin/Order/Collect')}}" data-id="{{$v.id}}" data-value="{{$v.user_id}}" data-view="reload" data-msg="{{:L('common_collect_tips')}}"> {{:L('common_collect_submit')}}</button>
|
||||
</if>
|
||||
<if condition="in_array($v['status'], [0,1,5,6])">
|
||||
<if condition="in_array($v['status'], [5,6])">
|
||||
<button class="am-btn am-btn-default am-btn-xs am-radius am-icon-trash-o am-btn-block submit-ajax" data-url="{{:U('Admin/Order/Delete')}}" data-id="{{$v.id}}" data-value="{{$v.user_id}}" data-view="delete" data-msg="{{:L('common_delete_tips')}}"> {{:L('common_operation_delete')}}</button>
|
||||
</if>
|
||||
</td>
|
||||
@ -223,6 +230,52 @@
|
||||
</table>
|
||||
<!-- list end -->
|
||||
|
||||
<!-- 发货弹窗 -->
|
||||
<div class="am-popup" id="order-delivery-popup">
|
||||
<div class="am-popup-inner">
|
||||
<div class="am-popup-hd">
|
||||
<h4 class="am-popup-title">{{:L('order_delivery_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-form" method="post" action="{{:U('Admin/Order/Delivery')}}" request-type="ajax-reload">
|
||||
<!-- 支付方式 -->
|
||||
<div class="business-item">
|
||||
<h3>{{:L('order_business_express_title')}}</h3>
|
||||
<notempty name="express_list">
|
||||
<ul class="express-list" data-type="express">
|
||||
<foreach name="express_list" item="express">
|
||||
<if condition="$express.is_enable eq 1">
|
||||
<li class="express-items-{{$express.id}}" data-value="{{$express.id}}">
|
||||
<notempty name="express.icon">
|
||||
<img src="{{$express.icon}}" />
|
||||
</notempty>
|
||||
<span>{{$express.name}}</span>
|
||||
<i class="icon-active"></i>
|
||||
</li>
|
||||
</if>
|
||||
</foreach>
|
||||
</ul>
|
||||
</notempty>
|
||||
<empty name="express_list">
|
||||
<div class="table-no"><i class="am-icon-warning"></i> {{:L('order_express_not_data_tips')}}</div>
|
||||
</empty>
|
||||
</div>
|
||||
|
||||
<div class="am-form-group">
|
||||
<label>{{:L('order_express_number_text')}}</label>
|
||||
<input type="text" name="express_number" placeholder="{{:L('order_express_number_text')}}" minlength="1" data-validation-message="{{:L('order_express_number_format')}}" class="am-radius" required />
|
||||
</div>
|
||||
<div class="am-form-group">
|
||||
<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:'{{:L('common_form_loading_tips')}}'}">{{:L('common_operation_confirm')}}</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- page start -->
|
||||
<if condition="!empty($list)">
|
||||
{{$page_html}}
|
||||
|
@ -55,10 +55,10 @@ class BuyController extends CommonController
|
||||
$this->assign('user_address_list', UserService::UserAddressList(['user'=>$this->user])['data']);
|
||||
|
||||
// 快递
|
||||
$this->assign('express_list', ResourcesService::ExpressList());
|
||||
$this->assign('express_list', ResourcesService::ExpressList(['is_enable'=>1]));
|
||||
|
||||
// 支付方式
|
||||
$this->assign('payment_list', ResourcesService::BuyPaymentList());
|
||||
$this->assign('payment_list', ResourcesService::BuyPaymentList(['is_enable'=>1]));
|
||||
|
||||
// 商品/基础信息
|
||||
$base = [
|
||||
|
@ -211,32 +211,32 @@
|
||||
</div>
|
||||
<div class="am-popup-bd">
|
||||
<form class="am-form pay-form" method="post" action="{{:U('Home/Order/Pay')}}">
|
||||
<!-- 支付方式 -->
|
||||
<div class="business-item">
|
||||
<h3>选择支付</h3>
|
||||
<notempty name="buy_payment_list">
|
||||
<ul class="payment-list">
|
||||
<foreach name="buy_payment_list" item="payment">
|
||||
<li class="payment-items-{{$payment.id}}" data-value="{{$payment.id}}">
|
||||
<notempty name="payment.logo">
|
||||
<img src="{{$payment.logo}}" />
|
||||
</notempty>
|
||||
<span>{{$payment.name}}</span>
|
||||
<i class="icon-active"></i>
|
||||
</li>
|
||||
</foreach>
|
||||
</ul>
|
||||
</notempty>
|
||||
<empty name="buy_payment_list">
|
||||
<div class="table-no"><i class="am-icon-warning"></i> {{:L('order_payment_not_data_tips')}}</div>
|
||||
</empty>
|
||||
</div>
|
||||
<div class="am-form-group">
|
||||
<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:'{{:L('common_form_loading_tips')}}'}">确认支付</button>
|
||||
</div>
|
||||
</form>
|
||||
<!-- 支付方式 -->
|
||||
<div class="business-item">
|
||||
<h3>选择支付</h3>
|
||||
<notempty name="buy_payment_list">
|
||||
<ul class="payment-list" data-type="payment">
|
||||
<foreach name="buy_payment_list" item="payment">
|
||||
<li class="payment-items-{{$payment.id}}" data-value="{{$payment.id}}">
|
||||
<notempty name="payment.logo">
|
||||
<img src="{{$payment.logo}}" />
|
||||
</notempty>
|
||||
<span>{{$payment.name}}</span>
|
||||
<i class="icon-active"></i>
|
||||
</li>
|
||||
</foreach>
|
||||
</ul>
|
||||
</notempty>
|
||||
<empty name="buy_payment_list">
|
||||
<div class="table-no"><i class="am-icon-warning"></i> {{:L('order_payment_not_data_tips')}}</div>
|
||||
</empty>
|
||||
</div>
|
||||
<div class="am-form-group">
|
||||
<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:'{{:L('common_form_loading_tips')}}'}">确认支付</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
2
service/Application/Runtime/Temp/8cde93cbd070139d84f31d26f8ea8f4d.php
Executable file → Normal file
2
service/Application/Runtime/Temp/8cde93cbd070139d84f31d26f8ea8f4d.php
Executable file → Normal file
@ -1,3 +1,3 @@
|
||||
<?php
|
||||
//000000000000a:133:{i:41;s:12:"config_index";i:42;s:11:"config_save";i:81;s:10:"site_index";i:103;s:10:"site_index";i:105;s:9:"site_save";i:104;s:9:"sms_index";i:107;s:8:"sms_save";i:219;s:11:"email_index";i:220;s:10:"email_save";i:221;s:15:"email_emailtest";i:199;s:9:"seo_index";i:200;s:8:"seo_save";i:1;s:11:"power_index";i:22;s:11:"admin_index";i:19;s:14:"admin_saveinfo";i:20;s:10:"admin_save";i:21;s:12:"admin_delete";i:4;s:10:"power_role";i:17;s:18:"power_rolesaveinfo";i:18;s:14:"power_rolesave";i:23;s:16:"power_roledelete";i:13;s:11:"power_index";i:15;s:15:"power_powersave";i:16;s:17:"power_powerdelete";i:126;s:10:"user_index";i:127;s:10:"user_index";i:128;s:13:"user_saveinfo";i:129;s:9:"user_save";i:130;s:11:"user_delete";i:146;s:16:"user_excelexport";i:38;s:11:"goods_index";i:39;s:11:"goods_index";i:57;s:14:"goods_saveinfo";i:58;s:10:"goods_save";i:59;s:12:"goods_delete";i:181;s:19:"goods_statusshelves";i:218;s:27:"goods_statushomerecommended";i:201;s:19:"goodscategory_index";i:202;s:18:"goodscategory_save";i:203;s:20:"goodscategory_delete";i:177;s:11:"order_index";i:178;s:11:"order_index";i:179;s:12:"order_delete";i:180;s:12:"order_cancel";i:213;s:12:"answer_index";i:214;s:12:"answer_index";i:215;s:11:"answer_save";i:216;s:13:"answer_delete";i:217;s:19:"answer_statusupdate";i:222;s:16:"navigation_index";i:223;s:16:"navigation_index";i:226;s:15:"navigation_save";i:227;s:17:"navigation_delete";i:228;s:23:"navigation_statusupdate";i:234;s:16:"customview_index";i:235;s:19:"customview_saveinfo";i:236;s:15:"customview_save";i:237;s:17:"customview_delete";i:238;s:23:"customview_statusupdate";i:239;s:10:"link_index";i:240;s:13:"link_saveinfo";i:241;s:9:"link_save";i:242;s:11:"link_delete";i:243;s:17:"link_statusupdate";i:244;s:11:"theme_index";i:245;s:10:"theme_save";i:246;s:12:"theme_upload";i:247;s:12:"theme_delete";i:252;s:11:"brand_index";i:249;s:11:"brand_index";i:256;s:14:"brand_saveinfo";i:250;s:10:"brand_save";i:257;s:17:"brand_stateupdate";i:251;s:12:"brand_delete";i:253;s:19:"brandcategory_index";i:254;s:18:"brandcategory_save";i:255;s:20:"brandcategory_delete";i:204;s:13:"article_index";i:205;s:13:"article_index";i:206;s:16:"article_saveinfo";i:207;s:12:"article_save";i:208;s:14:"article_delete";i:209;s:20:"article_statusupdate";i:248;s:29:"article_statushomerecommended";i:210;s:21:"articlecategory_index";i:211;s:20:"articlecategory_save";i:212;s:22:"articlecategory_delete";i:162;s:15:"marketing_index";i:163;s:12:"coupon_index";i:164;s:18:"coupon_stateupdate";i:165;s:15:"coupon_saveinfo";i:166;s:11:"coupon_save";i:167;s:11:"coupon_user";i:168;s:13:"coupon_delete";i:169;s:15:"coupon_sendinfo";i:170;s:11:"coupon_send";i:171;s:16:"coupon_userquery";i:182;s:10:"data_index";i:183;s:13:"message_index";i:184;s:14:"message_delete";i:185;s:12:"paylog_index";i:186;s:21:"userintegrallog_index";i:187;s:15:"complaint_index";i:188;s:14:"complaint_save";i:189;s:16:"complaint_delete";i:152;s:15:"resources_index";i:153;s:12:"region_index";i:154;s:11:"region_save";i:155;s:13:"region_delete";i:156;s:13:"express_index";i:157;s:12:"express_save";i:158;s:14:"express_delete";i:172;s:11:"slide_index";i:173;s:14:"slide_saveinfo";i:174;s:10:"slide_save";i:175;s:17:"slide_stateupdate";i:176;s:12:"slide_delete";i:193;s:20:"screeningprice_index";i:194;s:19:"screeningprice_save";i:258;s:21:"screeningprice_delete";i:259;s:13:"payment_index";i:260;s:16:"payment_saveinfo";i:261;s:12:"payment_save";i:262;s:14:"payment_delete";i:263;s:15:"payment_install";i:264;s:20:"payment_statusupdate";i:265;s:17:"payment_uninstall";i:266;s:14:"payment_upload";i:118;s:10:"tool_index";i:119;s:11:"cache_index";i:120;s:16:"cache_siteupdate";i:121;s:20:"cache_templateupdate";i:122;s:18:"cache_moduleupdate";}
|
||||
//000000000000a:135:{i:41;s:12:"config_index";i:42;s:11:"config_save";i:81;s:10:"site_index";i:103;s:10:"site_index";i:105;s:9:"site_save";i:104;s:9:"sms_index";i:107;s:8:"sms_save";i:219;s:11:"email_index";i:220;s:10:"email_save";i:221;s:15:"email_emailtest";i:199;s:9:"seo_index";i:200;s:8:"seo_save";i:1;s:11:"power_index";i:22;s:11:"admin_index";i:19;s:14:"admin_saveinfo";i:20;s:10:"admin_save";i:21;s:12:"admin_delete";i:4;s:10:"power_role";i:17;s:18:"power_rolesaveinfo";i:18;s:14:"power_rolesave";i:23;s:16:"power_roledelete";i:13;s:11:"power_index";i:15;s:15:"power_powersave";i:16;s:17:"power_powerdelete";i:126;s:10:"user_index";i:127;s:10:"user_index";i:128;s:13:"user_saveinfo";i:129;s:9:"user_save";i:130;s:11:"user_delete";i:146;s:16:"user_excelexport";i:38;s:11:"goods_index";i:39;s:11:"goods_index";i:57;s:14:"goods_saveinfo";i:58;s:10:"goods_save";i:59;s:12:"goods_delete";i:181;s:19:"goods_statusshelves";i:218;s:27:"goods_statushomerecommended";i:201;s:19:"goodscategory_index";i:202;s:18:"goodscategory_save";i:203;s:20:"goodscategory_delete";i:177;s:11:"order_index";i:178;s:11:"order_index";i:179;s:12:"order_delete";i:180;s:12:"order_cancel";i:267;s:14:"order_delivery";i:268;s:13:"order_collect";i:213;s:12:"answer_index";i:214;s:12:"answer_index";i:215;s:11:"answer_save";i:216;s:13:"answer_delete";i:217;s:19:"answer_statusupdate";i:222;s:16:"navigation_index";i:223;s:16:"navigation_index";i:226;s:15:"navigation_save";i:227;s:17:"navigation_delete";i:228;s:23:"navigation_statusupdate";i:234;s:16:"customview_index";i:235;s:19:"customview_saveinfo";i:236;s:15:"customview_save";i:237;s:17:"customview_delete";i:238;s:23:"customview_statusupdate";i:239;s:10:"link_index";i:240;s:13:"link_saveinfo";i:241;s:9:"link_save";i:242;s:11:"link_delete";i:243;s:17:"link_statusupdate";i:244;s:11:"theme_index";i:245;s:10:"theme_save";i:246;s:12:"theme_upload";i:247;s:12:"theme_delete";i:252;s:11:"brand_index";i:249;s:11:"brand_index";i:256;s:14:"brand_saveinfo";i:250;s:10:"brand_save";i:257;s:17:"brand_stateupdate";i:251;s:12:"brand_delete";i:253;s:19:"brandcategory_index";i:254;s:18:"brandcategory_save";i:255;s:20:"brandcategory_delete";i:204;s:13:"article_index";i:205;s:13:"article_index";i:206;s:16:"article_saveinfo";i:207;s:12:"article_save";i:208;s:14:"article_delete";i:209;s:20:"article_statusupdate";i:248;s:29:"article_statushomerecommended";i:210;s:21:"articlecategory_index";i:211;s:20:"articlecategory_save";i:212;s:22:"articlecategory_delete";i:162;s:15:"marketing_index";i:163;s:12:"coupon_index";i:164;s:18:"coupon_stateupdate";i:165;s:15:"coupon_saveinfo";i:166;s:11:"coupon_save";i:167;s:11:"coupon_user";i:168;s:13:"coupon_delete";i:169;s:15:"coupon_sendinfo";i:170;s:11:"coupon_send";i:171;s:16:"coupon_userquery";i:182;s:10:"data_index";i:183;s:13:"message_index";i:184;s:14:"message_delete";i:185;s:12:"paylog_index";i:186;s:21:"userintegrallog_index";i:187;s:15:"complaint_index";i:188;s:14:"complaint_save";i:189;s:16:"complaint_delete";i:152;s:15:"resources_index";i:153;s:12:"region_index";i:154;s:11:"region_save";i:155;s:13:"region_delete";i:156;s:13:"express_index";i:157;s:12:"express_save";i:158;s:14:"express_delete";i:172;s:11:"slide_index";i:173;s:14:"slide_saveinfo";i:174;s:10:"slide_save";i:175;s:17:"slide_stateupdate";i:176;s:12:"slide_delete";i:193;s:20:"screeningprice_index";i:194;s:19:"screeningprice_save";i:258;s:21:"screeningprice_delete";i:259;s:13:"payment_index";i:260;s:16:"payment_saveinfo";i:261;s:12:"payment_save";i:262;s:14:"payment_delete";i:263;s:15:"payment_install";i:264;s:20:"payment_statusupdate";i:265;s:17:"payment_uninstall";i:266;s:14:"payment_upload";i:118;s:10:"tool_index";i:119;s:11:"cache_index";i:120;s:16:"cache_siteupdate";i:121;s:20:"cache_templateupdate";i:122;s:18:"cache_moduleupdate";}
|
||||
?>
|
0
service/Application/Runtime/Temp/a58f8070835be94249ea77f3601c6647.php
Executable file → Normal file
0
service/Application/Runtime/Temp/a58f8070835be94249ea77f3601c6647.php
Executable file → Normal file
@ -486,6 +486,80 @@ class OrderService
|
||||
return DataReturn(L('common_cancel_error'), -1);
|
||||
}
|
||||
|
||||
/**
|
||||
* 订单发货
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @date 2018-09-30
|
||||
* @desc description
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public static function OrderDelivery($params = [])
|
||||
{
|
||||
// 请求参数
|
||||
$p = [
|
||||
[
|
||||
'checked_type' => 'empty',
|
||||
'key_name' => 'id',
|
||||
'error_msg' => '订单id有误',
|
||||
],
|
||||
[
|
||||
'checked_type' => 'empty',
|
||||
'key_name' => 'user_id',
|
||||
'error_msg' => '用户id有误',
|
||||
],
|
||||
[
|
||||
'checked_type' => 'empty',
|
||||
'key_name' => 'express_id',
|
||||
'error_msg' => '快递id有误',
|
||||
],
|
||||
[
|
||||
'checked_type' => 'empty',
|
||||
'key_name' => 'express_number',
|
||||
'error_msg' => '快递单号有误',
|
||||
],
|
||||
];
|
||||
$ret = params_checked($params, $p);
|
||||
if($ret !== true)
|
||||
{
|
||||
return DataReturn($ret, -1);
|
||||
}
|
||||
|
||||
// 获取订单信息
|
||||
$m = M('Order');
|
||||
$where = ['id'=>intval($params['id']), 'user_id'=>$params['user_id'], 'is_delete_time'=>0, 'user_is_delete_time'=>0];
|
||||
$order = $m->where($where)->field('id,status,user_id')->find();
|
||||
if(empty($order))
|
||||
{
|
||||
return DataReturn(L('common_data_no_exist_error'), -1);
|
||||
}
|
||||
if(!in_array($order['status'], [2]))
|
||||
{
|
||||
$status_text = L('common_order_user_status')[$order['status']]['name'];
|
||||
return DataReturn('状态不可操作['.$status_text.']', -1);
|
||||
}
|
||||
|
||||
$data = [
|
||||
'status' => 3,
|
||||
'express_id' => intval($params['express_id']),
|
||||
'express_number' => I('express_number', '', '', $params),
|
||||
'upd_time' => time(),
|
||||
];
|
||||
if($m->where($where)->save($data))
|
||||
{
|
||||
// 用户消息
|
||||
ResourcesService::MessageAdd($order['user_id'], '订单发货', '订单已发货', 1, $order['id']);
|
||||
|
||||
// 订单状态日志
|
||||
$creator = isset($params['creator']) ? intval($params['creator']) : 0;
|
||||
$creator_name = isset($params['creator_name']) ? htmlentities($params['creator_name']) : '';
|
||||
self::OrderHistoryAdd($order['id'], $data['status'], $order['status'], '收货', $creator, $creator_name);
|
||||
return DataReturn(L('common_operation_delivery_success'), 0);
|
||||
}
|
||||
return DataReturn(L('common_operation_delivery_error'), -1);
|
||||
}
|
||||
|
||||
/**
|
||||
* 订单收货
|
||||
* @author Devil
|
||||
|
@ -36,8 +36,12 @@ class ResourcesService
|
||||
*/
|
||||
public static function ExpressList($params = [])
|
||||
{
|
||||
$where = ['is_enable'=>1];
|
||||
$data = M('Express')->where($where)->field('id,icon,name,sort')->order('sort asc')->select();
|
||||
$where = [];
|
||||
if(isset($params['is_enable']))
|
||||
{
|
||||
$where['is_enable'] = intval($params['is_enable']);
|
||||
}
|
||||
$data = M('Express')->where($where)->field('id,icon,name,sort,is_enable')->order('sort asc')->select();
|
||||
if(!empty($data) && is_array($data))
|
||||
{
|
||||
$images_host = C('IMAGE_HOST');
|
||||
@ -61,7 +65,9 @@ class ResourcesService
|
||||
*/
|
||||
public static function PaymentList($params = [])
|
||||
{
|
||||
$where = empty($params['where']) ? ['is_enable'=>1] : $params['where'];
|
||||
$where = empty($params['where']) ? [] : $params['where'];
|
||||
$where['is_enable'] = isset($params['is_enable']) ? intval($params['is_enable']) : 1;
|
||||
|
||||
$data = M('Payment')->where($where)->field('id,logo,name,sort,payment,config,apply_terminal,apply_terminal,element,is_enable')->order('sort asc')->select();
|
||||
if(!empty($data) && is_array($data))
|
||||
{
|
||||
|
@ -23,4 +23,23 @@
|
||||
.am-table .goods-item { padding: 5px 0; }
|
||||
.am-table .goods-item, .am-table .goods-item .base { overflow: hidden; }
|
||||
.am-table .goods-item .other .fl { width: 60%; }
|
||||
.am-table .goods-item:not(:last-child) { border-bottom: 1px solid #eee; }
|
||||
.am-table .goods-item:not(:last-child) { border-bottom: 1px solid #eee; }
|
||||
|
||||
|
||||
/**
|
||||
* 快递弹窗
|
||||
*/
|
||||
.business-item h3 { border-bottom: 3px solid #e3e3e3; margin:5px 0 0 0; font-size: 14px;font-weight: 700; }
|
||||
.business-item ul { padding: 10px 3px 5px 5px; overflow: hidden; }
|
||||
.business-item ul li { border:1px solid transparent ;overflow: hidden; float: left; cursor: pointer; padding: 5px; border: 1px solid #eee; margin: 0 10px 10px 0; }
|
||||
.business-item ul li img { width: 36px; height: 36px; }
|
||||
.business-item ul li.selected { border-color: #d2364c ; position: relative; }
|
||||
.business-item ul li.selected i.icon-active { position: absolute; width: 10px; height: 10px; font-size: 0; line-height: 0; right: 0px; bottom: 0px; background: url(../Images/sys_item_selected.gif) no-repeat right bottom; }
|
||||
@media only screen and (min-width:640px) {
|
||||
.business-item ul li {width:calc(33% - 5px); }
|
||||
.business-item ul li:nth-child(3n) { margin-right: 0; }
|
||||
}
|
||||
@media only screen and (max-width:640px) {
|
||||
.business-item ul li { width: calc(50% - 5px); }
|
||||
.business-item ul li:nth-child(2n) { margin-right: 0; }
|
||||
}
|
BIN
service/Public/Admin/Default/Images/sys_item_selected.gif
Executable file
BIN
service/Public/Admin/Default/Images/sys_item_selected.gif
Executable file
Binary file not shown.
After Width: | Height: | Size: 70 B |
@ -1,4 +1,51 @@
|
||||
$(function()
|
||||
{
|
||||
// 支付操作
|
||||
$('.submit-delivery').on('click', function()
|
||||
{
|
||||
$('form.delivery-form input[name=id]').val($(this).data('id'));
|
||||
$('form.delivery-form input[name=express_number]').val('');
|
||||
var express_id = $(this).data('express-id') || 0;
|
||||
var user_id = $(this).data('user-id') || 0;
|
||||
if($('.express-items-'+express_id).length > 0)
|
||||
{
|
||||
$('form.delivery-form input[name=express_id]').val(express_id);
|
||||
$('form.delivery-form input[name=user_id]').val(user_id);
|
||||
$('.express-items-'+express_id).addClass('selected').siblings('li').removeClass('selected');
|
||||
} else {
|
||||
$('form.delivery-form input[name=express_id]').val(0);
|
||||
$('form.delivery-form input[name=user_id]').val(0);
|
||||
$('ul.express-list li.selected').removeClass('selected');
|
||||
}
|
||||
});
|
||||
|
||||
// 混合列表选择
|
||||
$('.business-item ul li').on('click', function()
|
||||
{
|
||||
if($(this).hasClass('selected'))
|
||||
{
|
||||
$('form.delivery-form input[name='+$(this).parent().data('type')+'_id]').val(0);
|
||||
$(this).removeClass('selected');
|
||||
} else {
|
||||
$('form.delivery-form input[name='+$(this).parent().data('type')+'_id]').val($(this).data('value'));
|
||||
$(this).addClass('selected').siblings('li').removeClass('selected');
|
||||
}
|
||||
});
|
||||
|
||||
// 发货表单
|
||||
$('form.delivery-form button[type=submit]').on('click', function()
|
||||
{
|
||||
var id = $('form.delivery-form input[name=id]').val() || 0;
|
||||
if(id == 0)
|
||||
{
|
||||
Prompt('订单id有误');
|
||||
return false;
|
||||
}
|
||||
var express_id = $('form.delivery-form input[name=express_id]').val() || 0;
|
||||
if(express_id == 0)
|
||||
{
|
||||
Prompt('请选择快递方式');
|
||||
return false;
|
||||
}
|
||||
});
|
||||
});
|
@ -42,8 +42,10 @@ $(function()
|
||||
{
|
||||
if($(this).hasClass('selected'))
|
||||
{
|
||||
$('form.pay-form input[name='+$(this).parent().data('type')+'_id]').val(0);
|
||||
$(this).removeClass('selected');
|
||||
} else {
|
||||
$('form.pay-form input[name='+$(this).parent().data('type')+'_id]').val($(this).data('value'));
|
||||
$(this).addClass('selected').siblings('li').removeClass('selected');
|
||||
}
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user