- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
public function actionOrderDelete(){
$params = Yii::$app->request;
$param = Json::decode($params->getRawBody());
if($params->headers->get('Token') and $params->headers->has('Token')){
if($us = User::findOne(['token'=>$params->headers->get('Token')])){
$order = EnbekOrders::findOne($param['id']);
$order->status = '0';
$order_j = OrderJoin::findOne(['order_id' => $param['id']]);
$order_j->exucotor_id = '0';
$cab = CabinetJoin::findOne(['user_id' => $us->id]);
$st = UserSt::findOne($cab->personal_id);
$cab->status = '1';
$st->reting-='0.1';
if($order_j->save() and $order->save() and $cab->save() and $st->save())
return ['success'=>true];
else
return ['success'=>false];
}else{
return ['success'=>];
}
}else{
return ['message'=>];
}
}
Комментарии (0) RSS
Добавить комментарий