Commit 341f5e5a authored by Shakarim Sapa's avatar Shakarim Sapa

- Тест

parent bfaad013
......@@ -35,20 +35,20 @@ class DefaultController extends BaseController
* @param $email
* @throws \yii\web\NotFoundHttpException
*/
public function actionAdd($email){
public function actionAdd(){
// Результирующий массив
$result = [
'result' => false
];
// Получили и переопределили данные из формы
if(Yii::$app->request->isAjax) {
if(Yii::$app->request->isAjax && isset($_POST['email'])) {
// Создали модель
$model = new CasesBids();
// Получили дату
$date = new \DateTime();
// Переопределили дату
$model->date = $date->format('Y-m-d H:i:s');
$model->email = $email;
$model->email = $_POST['email'];
// Открыли транзакцию
$transaction = Yii::$app->db->beginTransaction();
// Пытаемся сохранить запись в базе
......
......@@ -63,7 +63,7 @@ if ($cacheEmail!==false && CasesBids::find()->where(['email' => $cacheEmail])->e
data: {
email: email
},
method: 'GET',
method: 'POST',
success: function(response) {
var result = JSON.parse(response);
if (result.result==true) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment