Browse Source

开发售后模块处理售后申请操作方法

antshop
linyaostalker 5 years ago
parent
commit
a86cdf66e9
  1. 24
      backend/modules/shop/controllers/AfterSaleController.php

24
backend/modules/shop/controllers/AfterSaleController.php

@ -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);
}
}
}
Loading…
Cancel
Save