|
|
@ -146,4 +146,28 @@ class AfterSaleController extends Controller |
|
|
|
'columns' => $searchModel->columns() |
|
|
|
]); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @param $status |
|
|
|
* @param $id |
|
|
|
* @return \yii\web\Response |
|
|
|
* 处理售后申请 |
|
|
|
*/ |
|
|
|
public function actionHandle($status, $id) |
|
|
|
{ |
|
|
|
$url = Yii::$app->request->referrer; |
|
|
|
$model = AfterSale::findOne($id); |
|
|
|
if ($status == AfterSale::STATUS_ACCEPT) { |
|
|
|
$model->status = AfterSale::STATUS_ACCEPT; |
|
|
|
} else { |
|
|
|
$model->status = AfterSale::STATUS_REJECT; |
|
|
|
} |
|
|
|
$model->dealt_at = time(); |
|
|
|
$model->operator_id = Yii::$app->user->id; |
|
|
|
if ($model->save()) { |
|
|
|
return $this->redirect('index'); |
|
|
|
} else { |
|
|
|
return $this->redirect($url); |
|
|
|
} |
|
|
|
} |
|
|
|
} |