芝麻web文件管理V1.00
编辑当前文件:/home2/sdektunc/xmintal-back/controllers/PaymentController.php
request->getBodyParams(); $payment->attributes=$params; $payment->validity_start_date=date('Y-m-d H:i:s',strtotime($payment->validity_start_date)); $payment->validity_end_date=date('Y-m-d H:i:s',strtotime($payment->validity_end_date)); $now=date('Y-m-d H:i:s'); $customerlicense_id=$params['customerlicense_id']; $payment->payment_date=$now; if(isset($customerlicense_id)){ $cm=CustomerLicense::findOne((int)$customerlicense_id); $amount=$cm->price; $payment->amount=$amount; } $done=0; $code=200; $error=[]; $message=''; if($payment->save()){ $done=1; }else{ $code=422; $error=$payment->getErrors(); } Yii::$app->response->statusCode=$code; return ['done'=>$done,'message'=>$message,'error'=>$error]; } } ?>