DefaultController.php
1.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<?php
namespace app\wx\modules\order\controllers;
use Yii;
use stdClass;
use yii\helpers\HtmlPurifier;
/**
* 控制器
*/
class DefaultController extends BaseController
{
/**
* 首页
*/
public function actionIndex()
{
return $this->render('index');
}
/**
* @return string
*/
public function actionSubmit()
{
$e = new stdClass();
$e->success = false;
$e->message = 'ok';
$userId = 0;
$req = Yii::$app->request;
$carNo = HtmlPurifier::process($req->post('carNo'), ['HTML.Allowed' => '']);
$carModel = HtmlPurifier::process($req->post('carModel'), ['HTML.Allowed' => '']);
$customer = HtmlPurifier::process($req->post('customer'), ['HTML.Allowed' => '']);
$phone = HtmlPurifier::process($req->post('phone'), ['HTML.Allowed' => '']);
$preRepair = HtmlPurifier::process($req->post('preRepair'), ['HTML.Allowed' => '']);
$repairPrice = HtmlPurifier::process($req->post('repairPrice'), ['HTML.Allowed' => '']);
$finishDate = HtmlPurifier::process($req->post('finishDate'), ['HTML.Allowed' => '']);
$images = $req->post('images');
//echo $carNo.'_'.$carModel.'_'.$customer.'_'.$phone.'_'.$preRepair.'_'.$repairPrice.'_'.$finishDate.'_'.json_encode($images);
$e->success = true;
return $this->renderJson($e);
}
}