You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
57 lines
1.6 KiB
57 lines
1.6 KiB
<?php
|
|
|
|
namespace App\Admin\Forms;
|
|
|
|
use App\Admin\Common\Rpc;
|
|
use App\Models\ImsCjdcOrder;
|
|
use App\Models\ImsCjdcOrderMain;
|
|
use Dcat\Admin\Widgets\Form;
|
|
use Symfony\Component\HttpFoundation\Response;
|
|
|
|
class RefundNote extends Form
|
|
{
|
|
/**
|
|
* Handle the form request.
|
|
*
|
|
* @param array $input
|
|
*
|
|
* @return Response
|
|
*/
|
|
public function handle(array $input)
|
|
{
|
|
$note = request()->get('refuse_refund_note');
|
|
$oid = request()->get('order_id');
|
|
$current_page = request()->get('current_page');
|
|
$order = ImsCjdcOrderMain::where('id', $oid)->first();
|
|
$order->refuse_refund_note = $note;
|
|
$order->state = 10;
|
|
$order->updated_at = time();
|
|
if ($order->save()) {
|
|
$storeIds = ImsCjdcOrder::where('order_main_id',$order->global_order_id)->pluck('store_id')->toArray();
|
|
Rpc::doByOrder($order->user_id,$storeIds,$order->global_order_id,10);
|
|
return $this->success('操作成功', "order?page={$current_page}");
|
|
} else {
|
|
return $this->error('操作失败');
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Build a form here.
|
|
*/
|
|
public function form()
|
|
{
|
|
$this->textarea('refuse_refund_note', '原因')->placeholder('请填写拒绝退款的理由,字数不得超过50个字')->required();
|
|
$this->hidden('order_id')->value($this->data['order_id']);
|
|
$this->hidden('current_page')->value($this->data['current_page']);
|
|
}
|
|
|
|
/**
|
|
* The data of the form.
|
|
*
|
|
* @return array
|
|
*/
|
|
public function default()
|
|
{
|
|
|
|
}
|
|
}
|