...
|
...
|
@@ -4,6 +4,7 @@ namespace app\admin\controller\order; |
|
|
|
|
|
use app\api\controller\PrivateNumber;
|
|
|
use app\api\model\PrivateNumber as PrivateNumberModel;
|
|
|
use app\api\model\User;
|
|
|
use app\common\controller\Backend;
|
|
|
use app\common\controller\Wechat;
|
|
|
use app\admin\model\Third;
|
...
|
...
|
@@ -166,28 +167,22 @@ class Dispute extends Backend |
|
|
$grab->status = '6';
|
|
|
$grab->save();
|
|
|
|
|
|
// // 退定金到发单人余额
|
|
|
// \app\api\model\User::money($order['deposit'],$order['user_id'],'售后已完成',['order_id'=>$row['order_id']]);
|
|
|
// 退款
|
|
|
$Wecaht = new Wechat();
|
|
|
if(!$Wecaht->refund($order,'售后已完成')){
|
|
|
$this->error($Wecaht->getError());
|
|
|
if($params['status'] == '1') { // 同意
|
|
|
// 退款
|
|
|
$Wecaht = new Wechat();
|
|
|
if (!$Wecaht->refund($order, '售后已完成')) {
|
|
|
$this->error($Wecaht->getError());
|
|
|
}
|
|
|
}else{ //拒绝
|
|
|
// 添加抢单价格到抢单用户余额
|
|
|
User::money($grab['grab_price'],$grab['user_id'],'售后已完成',['order_id' => $order['id']]);
|
|
|
// 把定金多余金额退回发单用户余额
|
|
|
if($order['deposit'] > $grab['grab_price']){
|
|
|
$dec = $order['deposit'] - $grab['grab_price'];
|
|
|
User::money($dec,$order['user_id'],'退定金余额',['order_id' => $order['id']]);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
// // 退款成功通知
|
|
|
// $send_data = [
|
|
|
// "first" => '亲,您的订单已成功退款,请稍候查收。',
|
|
|
// "keyword1" => $order['order_sn'],
|
|
|
// "keyword2" => $order['license_plate'],
|
|
|
// "keyword3" => $order['deposit'],
|
|
|
// "keyword4" => '退款成功',
|
|
|
// "remark" => ['请点击查看详情','#FF0000'],
|
|
|
// ];
|
|
|
// $openid = Third::where('user_id',$order['user_id'])->value('openid');
|
|
|
// $templateid = config('tmplmsg.template')['refund_success'];
|
|
|
// $url = config('tmplmsg.vue_url').'/wallet';
|
|
|
// (new Wechat)->tmplmsg($openid,$send_data,$templateid,$url);
|
|
|
|
|
|
// 解绑隐私通话
|
|
|
\app\api\controller\Order::unbindPrivateNumber($row['order_id']);
|
|
|
|
...
|
...
|
|