|
|
@@ -13,17 +13,18 @@ class LlEventController extends BaseController
|
|
|
|
|
|
public $guestAccess = [];
|
|
|
|
|
|
- public function actionAddMobile(){
|
|
|
+ public function actionAddMobile()
|
|
|
+ {
|
|
|
$post = Yii::$app->request->post();
|
|
|
$id = $post['id'] ?? 0;
|
|
|
- $mobile = $post['mobile']??'';
|
|
|
- if(empty($mobile)){
|
|
|
+ $mobile = $post['mobile'] ?? '';
|
|
|
+ if (empty($mobile)) {
|
|
|
util::fail('没有手机号');
|
|
|
}
|
|
|
- if(!stringUtil::isMobile($mobile)){
|
|
|
+ if (!stringUtil::isMobile($mobile)) {
|
|
|
util::fail('手机号错误');
|
|
|
}
|
|
|
- $event = LlEventClass::getById($id);
|
|
|
+ $event = LlEventClass::getById($id, true);
|
|
|
if (empty($event)) {
|
|
|
util::fail('没有找到');
|
|
|
}
|
|
|
@@ -31,19 +32,20 @@ class LlEventController extends BaseController
|
|
|
if (!isset($event['launchShopId']) || $event['launchShopId'] != $shopId) {
|
|
|
util::fail('不是你提交的');
|
|
|
}
|
|
|
- LlEventClass::addMobile($event,$mobile);
|
|
|
+ LlEventClass::addMobile($event, $mobile);
|
|
|
util::complete('添加成功');
|
|
|
}
|
|
|
|
|
|
//添加微信
|
|
|
- public function actionAddWx(){
|
|
|
+ public function actionAddWx()
|
|
|
+ {
|
|
|
$post = Yii::$app->request->post();
|
|
|
$id = $post['id'] ?? 0;
|
|
|
- $wx = $post['mobile']??'';
|
|
|
- if(empty($wx)){
|
|
|
+ $wx = $post['mobile'] ?? '';
|
|
|
+ if (empty($wx)) {
|
|
|
util::fail('没有微信');
|
|
|
}
|
|
|
- $event = LlEventClass::getById($id);
|
|
|
+ $event = LlEventClass::getById($id, true);
|
|
|
if (empty($event)) {
|
|
|
util::fail('没有找到');
|
|
|
}
|
|
|
@@ -51,7 +53,7 @@ class LlEventController extends BaseController
|
|
|
if (!isset($event['launchShopId']) || $event['launchShopId'] != $shopId) {
|
|
|
util::fail('不是你提交的');
|
|
|
}
|
|
|
- LlEventClass::addWx($event,$wx);
|
|
|
+ LlEventClass::addWx($event, $wx);
|
|
|
util::complete('添加成功');
|
|
|
}
|
|
|
|
|
|
@@ -60,11 +62,11 @@ class LlEventController extends BaseController
|
|
|
{
|
|
|
$post = Yii::$app->request->post();
|
|
|
$id = $post['id'] ?? 0;
|
|
|
- $no = $post['no']??'';
|
|
|
- if(empty($no)){
|
|
|
+ $no = $post['no'] ?? '';
|
|
|
+ if (empty($no)) {
|
|
|
util::fail('没有身份证号');
|
|
|
}
|
|
|
- $event = LlEventClass::getById($id);
|
|
|
+ $event = LlEventClass::getById($id, true);
|
|
|
if (empty($event)) {
|
|
|
util::fail('没有找到');
|
|
|
}
|
|
|
@@ -72,7 +74,7 @@ class LlEventController extends BaseController
|
|
|
if (!isset($event['launchShopId']) || $event['launchShopId'] != $shopId) {
|
|
|
util::fail('不是你提交的');
|
|
|
}
|
|
|
- LlEventClass::addNo($event,$no);
|
|
|
+ LlEventClass::addNo($event, $no);
|
|
|
util::complete('添加成功');
|
|
|
}
|
|
|
|