|
|
@@ -13,9 +13,29 @@ class LlEventController extends BaseController
|
|
|
public function actionAdd()
|
|
|
{
|
|
|
$post = Yii::$app->request->post();
|
|
|
- echo "<pre>";
|
|
|
- print_r($post);
|
|
|
- die;
|
|
|
+ $name = $post['name']??'';
|
|
|
+ if(empty($name)){
|
|
|
+ util::fail('请填写店名或姓名');
|
|
|
+ }
|
|
|
+ $no = $post['no']??'';
|
|
|
+ if(!empty($no)){
|
|
|
+ $pattern = '/^(?:\d{15}|\d{17}[\dxX])$/';
|
|
|
+ $valid = preg_match($pattern, $no);
|
|
|
+ if($valid == false){
|
|
|
+ util::fail('身份证号错误');
|
|
|
+ }
|
|
|
+ }
|
|
|
+ $mobile = $post['mobile']??'';
|
|
|
+ $wx = $post['wx']??'';
|
|
|
+ if(empty($wx) && empty($mobile) && empty($no)){
|
|
|
+ util::fail('手机号、微信号、身份证必填一项');
|
|
|
+ }
|
|
|
+ $prove = $post['prove']??[];
|
|
|
+ if(empty($prove)){
|
|
|
+ util::fail('证据最少要一张');
|
|
|
+ }
|
|
|
+ $json = json_encode($prove);
|
|
|
+ $intro = $post['intro']??'';
|
|
|
util::complete('添加成功');
|
|
|
}
|
|
|
|