diff --git a/application/admin/controller/Orderaftersale.php b/application/admin/controller/Orderaftersale.php
index 44ab9afee..c98bd8195 100644
--- a/application/admin/controller/Orderaftersale.php
+++ b/application/admin/controller/Orderaftersale.php
@@ -156,6 +156,8 @@ class Orderaftersale extends Common
}
$params = input();
+ $params['creator'] = $this->admin['id'];
+ $params['creator_name'] = $this->admin['username'];
return OrderAftersaleService::AftersaleRefuse($params);
}
@@ -176,7 +178,31 @@ class Orderaftersale extends Common
}
$params = input();
+ $params['creator'] = $this->admin['id'];
+ $params['creator_name'] = $this->admin['username'];
return OrderAftersaleService::AftersaleCancel($params);
}
+
+ /**
+ * 订单删除
+ * @author Devil
+ * @blog http://gong.gg/
+ * @version 1.0.0
+ * @date 2018-09-30
+ * @desc description
+ */
+ public function Delete()
+ {
+ // 是否ajax请求
+ if(!IS_AJAX)
+ {
+ return $this->error('非法访问');
+ }
+
+ $params = input();
+ $params['creator'] = $this->admin['id'];
+ $params['creator_name'] = $this->admin['username'];
+ return OrderAftersaleService::AftersaleDelete($params);
+ }
}
?>
\ No newline at end of file
diff --git a/application/admin/view/default/orderaftersale/index.html b/application/admin/view/default/orderaftersale/index.html
index 392b05b55..86ebc418e 100644
--- a/application/admin/view/default/orderaftersale/index.html
+++ b/application/admin/view/default/orderaftersale/index.html
@@ -81,7 +81,7 @@
凭证 |
状态 |
快递信息 |
- 更多 |
+ 更多 |
操作 |
@@ -150,7 +150,7 @@
{{$v.refundment_text}}
{{/if}}
{{if $v['status'] eq 4 and !empty($v['refuse_reason'])}}
- {{$v.refuse_reason}}
+ {{$v.refuse_reason}}
{{/if}}
@@ -236,10 +236,9 @@
{{if $v['status'] eq 3 and !empty($v['refundment_text'])}}
{{$v.refundment_text}}
{{/if}}
- {{if $v['status'] eq 4 and !empty($v['refuse_reason'])}}
- {{$v.refuse_reason}}
- {{/if}}
+ 拒绝原因
+ {{$v.refuse_reason}}
快递信息
diff --git a/application/index/view/default/orderaftersale/aftersale.html b/application/index/view/default/orderaftersale/aftersale.html
index a5f7abed1..4a3c46a0e 100644
--- a/application/index/view/default/orderaftersale/aftersale.html
+++ b/application/index/view/default/orderaftersale/aftersale.html
@@ -215,7 +215,7 @@
拒绝原因:
- {{$new_aftersale_data.refuse_reason}}
+ {{$new_aftersale_data.refuse_reason}}
申请时间:
@@ -274,10 +274,10 @@
凭证
-
+
{{if !empty($new_aftersale_data['images'])}}
{{foreach $new_aftersale_data.images as $img}}
-
+
{{/foreach}}
diff --git a/application/index/view/default/orderaftersale/index.html b/application/index/view/default/orderaftersale/index.html
index 7c53e7c99..a724eb0c4 100644
--- a/application/index/view/default/orderaftersale/index.html
+++ b/application/index/view/default/orderaftersale/index.html
@@ -155,7 +155,7 @@
{{$v.refundment_text}}
{{/if}}
{{if $v['status'] eq 4 and !empty($v['refuse_reason'])}}
- {{$v.refuse_reason}}
+ {{$v.refuse_reason}}
{{/if}}
|
@@ -169,7 +169,7 @@
{{if $v['status'] eq 1 and $v['type'] eq 1}}
发货
{{/if}}
- {{if !in_array($v['status'], [3,4,5])}}
+ {{if !in_array($v['status'], [3,5])}}
{{/if}}
详情
diff --git a/application/service/OrderAftersaleService.php b/application/service/OrderAftersaleService.php
index 8152eb4ec..4dc6a5eaf 100644
--- a/application/service/OrderAftersaleService.php
+++ b/application/service/OrderAftersaleService.php
@@ -176,7 +176,7 @@ class OrderAftersaleService
$history_price = PriceNumberFormat(Db::name('OrderAftersale')->where($where)->sum('price'));
if($price+$history_price > $order['data']['pay_price'])
{
- return DataReturn('退款金额大于支付金额[ 历史退款 '.$history_price.' ]', -1);
+ return DataReturn('退款金额大于支付金额[ 历史退款'.$history_price.'元, 订单金额'.$order['data']['pay_price'].'元 ]', -1);
}
// 退货数量
@@ -189,7 +189,7 @@ class OrderAftersaleService
{
if($number+$history_number > $order['data']['items']['buy_number'])
{
- return DataReturn('退货数量大于购买数量[ 历史退货数量 '.$history_number.' ]', -1);
+ return DataReturn('退货数量大于购买数量[ 历史退货数量 '.$history_number.', 订单商品数量 '.$order['data']['items']['buy_number'].' ]', -1);
}
}
@@ -683,7 +683,7 @@ class OrderAftersaleService
$history_price = PriceNumberFormat(Db::name('OrderAftersale')->where($where)->sum('price'));
if($aftersale['price']+$history_price > $order['data']['pay_price'])
{
- return DataReturn('退款金额大于支付金额[ 历史退款 '.$history_price.' ]', -1);
+ return DataReturn('退款金额大于支付金额[ 历史退款'.$history_price.'元, 订单金额'.$order['data']['pay_price'].'元 ]', -1);
}
// 历史退货数量
@@ -693,7 +693,7 @@ class OrderAftersaleService
{
if($aftersale['number']+$history_number > $order['data']['items']['buy_number'])
{
- return DataReturn('退货数量大于购买数量[ 历史退货数量 '.$history_number.' ]', -1);
+ return DataReturn('退货数量大于购买数量[ 历史退货数量 '.$history_number.', 订单商品数量 '.$order['data']['items']['buy_number'].' ]', -1);
}
}
@@ -964,7 +964,99 @@ class OrderAftersaleService
*/
public static function AftersaleRefuse($params = [])
{
- return DataReturn('开发中', -10);
+ // 请求参数
+ $p = [
+ [
+ 'checked_type' => 'empty',
+ 'key_name' => 'id',
+ 'error_msg' => '操作id有误',
+ ],
+ [
+ 'checked_type' => 'length',
+ 'key_name' => 'refuse_reason',
+ 'checked_data' => '2,230',
+ 'error_msg' => '拒绝原因格式 2~230 个字符',
+ ],
+ ];
+ $ret = ParamsChecked($params, $p);
+ if($ret !== true)
+ {
+ return DataReturn($ret, -1);
+ }
+
+ // 售后订单
+ $aftersale = Db::name('OrderAftersale')->where(['id' => intval($params['id'])])->find();
+ if(empty($aftersale))
+ {
+ return DataReturn('数据不存在或已删除', -1);
+ }
+
+ // 状态校验
+ if(!in_array($aftersale['status'], [0,2]))
+ {
+ $status_list = lang('common_order_aftersale_status_list');
+ return DataReturn('状态不可操作['.$status_list[$aftersale['status']]['name'].']', -1);
+ }
+
+ // 更新操作
+ $data = [
+ 'status' => 4,
+ 'refuse_reason' => $params['refuse_reason'],
+ 'audit_time' => time(),
+ 'upd_time' => time(),
+ ];
+ if(Db::name('OrderAftersale')->where(['id' => intval($params['id'])])->update($data))
+ {
+ return DataReturn('拒绝成功', 0);
+ }
+ return DataReturn('拒绝失败', -100);
+ }
+
+ /**
+ * 删除
+ * @author Devil
+ * @blog http://gong.gg/
+ * @version 1.0.0
+ * @date 2019-05-27
+ * @desc description
+ * @param [array] $params [输入参数]
+ */
+ public static function AftersaleDelete($params = [])
+ {
+ // 请求参数
+ $p = [
+ [
+ 'checked_type' => 'empty',
+ 'key_name' => 'id',
+ 'error_msg' => '操作id有误',
+ ],
+ ];
+ $ret = ParamsChecked($params, $p);
+ if($ret !== true)
+ {
+ return DataReturn($ret, -1);
+ }
+
+ // 售后订单
+ $aftersale = Db::name('OrderAftersale')->where(['id' => intval($params['id'])])->find();
+ if(empty($aftersale))
+ {
+ return DataReturn('数据不存在或已删除', -1);
+ }
+
+ // 状态校验
+ if(!in_array($aftersale['status'], [4,5]))
+ {
+ $status_list = lang('common_order_aftersale_status_list');
+ return DataReturn('状态不可操作['.$status_list[$aftersale['status']]['name'].']', -1);
+ }
+
+ // 删除操作
+ if(Db::name('OrderAftersale')->where(['id' => intval($params['id'])])->delete())
+ {
+ return DataReturn('删除成功', 0);
+ }
+ return DataReturn('删除失败', -100);
}
}
?>
\ No newline at end of file
diff --git a/extend/payment/Weixin.php b/extend/payment/Weixin.php
index c19c4eb75..fab880af2 100755
--- a/extend/payment/Weixin.php
+++ b/extend/payment/Weixin.php
@@ -636,18 +636,13 @@ class Weixin
if($use_cert == true)
{
+ //设置证书
+ //使用证书:cert 与 key 分别属于两个.pem文件
$apiclient = $this->GetApiclientFile();
$options[CURLOPT_SSLCERTTYPE] = 'PEM';
$options[CURLOPT_SSLCERT] = $apiclient['cert'];
$options[CURLOPT_SSLKEYTYPE] = 'PEM';
$options[CURLOPT_SSLKEY] = $apiclient['key'];
-
- //设置证书
- //使用证书:cert 与 key 分别属于两个.pem文件
- // $options[CURLOPT_SSLCERTTYPE] = 'PEM';
- // $options[CURLOPT_SSLCERT] = ROOT.'cert/apiclient_cert.pem';
- // $options[CURLOPT_SSLKEYTYPE] = 'PEM';
- // $options[CURLOPT_SSLKEY] = ROOT.'cert/apiclient_key.pem';
}
$ch = curl_init($url);
diff --git a/public/static/admin/default/css/orderaftersale.css b/public/static/admin/default/css/orderaftersale.css
index 751b701f1..0ab4d876c 100644
--- a/public/static/admin/default/css/orderaftersale.css
+++ b/public/static/admin/default/css/orderaftersale.css
@@ -33,11 +33,12 @@
.content-right table.am-table tr .row-user-info { width: 20%; }
.content-right table.am-table tr .row-goods { width: 20%; }
.content-right table.am-table tr .row-apply { width: 25%; }
+ .content-right table.am-table tr .row-more { width: 80px; }
.content-right table.am-table tr .row-operation { width: 85px; }
}
@media only screen and (max-width:640px) {
.content-right table.am-table tr .row-apply { width: 50%; }
- .content-right table.am-table tr .row-operation { width: 75px; }
+ .content-right table.am-table tr .row-operation, .content-right table.am-table tr .row-more { width: 75px; }
}
.content-right table.am-table .am-slider {
diff --git a/public/static/index/default/css/orderaftersale.aftersale.css b/public/static/index/default/css/orderaftersale.aftersale.css
index 8c7e58e73..616642c93 100644
--- a/public/static/index/default/css/orderaftersale.aftersale.css
+++ b/public/static/index/default/css/orderaftersale.aftersale.css
@@ -169,7 +169,14 @@ form.form-validation .number-container .am-input-group-label {
/**
* 详情信息
*/
-@media only screen and (min-width:460px) {
+.user-content-body .detail .am-u-md-6 .am-panel {
+ box-shadow: none;
+ -webkit-box-shadow: none;
+}
+.user-content-body .detail .am-u-md-6 .am-panel-bd {
+ padding: 10px;
+}
+@media only screen and (min-width:641px) {
.user-content-body .apply-container {
padding-left: 0;
padding-right: 10px;
@@ -179,15 +186,8 @@ form.form-validation .number-container .am-input-group-label {
padding-right: 0;
}
}
-@media only screen and (max-width:460px) {
+@media only screen and (max-width:641px) {
.user-content-body .detail .am-u-md-6 {
padding: 0;
}
-}
-.user-content-body .detail .am-u-md-6 .am-panel {
- box-shadow: none;
- -webkit-box-shadow: none;
-}
-.user-content-body .detail .am-u-md-6 .am-panel-bd {
- padding: 10px;
}
\ No newline at end of file
|