diff --git a/application/admin/controller/Orderaftersale.php b/application/admin/controller/Orderaftersale.php
index 44ab9afeea21355ef9e08acb7397404db4e71751..c98bd819558ec752ff0d168b33b301f30f332c92 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 392b05b559e088e82c758d20ff3f5c946b32cf85..86ebc418e24e2219b95dd6512f4c0c77f1e0bb22 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 a5f7abed1fcf1004bcdfff2182bef119ff4ba6ea..4a3c46a0e1102285dd9dd40e7fb42bd6c67e562e 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 7c53e7c997677ad0f9a7fdd082b60dbe1432737b..a724eb0c449eb00bef8dac6a94016e816f8ac038 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 8152eb4ec814842fc2015ac8f9a470f747810fcd..4dc6a5eafa6abeade6f02c440ba29584c5a3e649 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 c19c4eb75bb2c294d3d934990b954b58eadad3db..fab880af2c093c8799e77e256aafd30bea8dd200 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 751b701f135973f1a20744b1eb170f65fb04e3f2..0ab4d876c8152ae46a809eb7344fc9c729dee6e2 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 8c7e58e73dbc7936da9943b5ed7746c66d390448..616642c930781a982986c74deee956e4d351f38d 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
|