EditEnterpriseController.class.php
1.43 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<?php
/**
* 后台登录-普通登陆:完善企业信息
* Created by PhpStorm.
* User: 何岳龙
* Date: 2016年8月2日14:26:06
*
* @update 2016-10-12 zhuxun37 修改数据获取方式
*/
namespace Apicp\Controller\SysSetting;
use Common\Common\Sms;
use VcySDK\Enterprise;
use VcySDK\Service;
class EditEnterpriseController extends AbstractController
{
public function Index()
{
// 接收数据
$fields = array(
'epName',
'epIndustry',
'epCompanysize',
'epContacter',
'epContactmobile',
'epContactemail',
'epProvince',
'epCity',
'epArea',
'epPostalCode',
'epAddress',
'mobileCode'
);
extract_field($postData, $fields, I('post.'));
if (!empty($postData['mobileCode'])) {
// 验证手机验证码
$service = &Service::instance();
// 实例化短信
$smsService = new Sms($service);
// 验证验证码信息
$smsService->verifyCodeSDK($postData['epContactmobile'], $postData['mobileCode']);
} else {
// 否则不让更改手机号
unset($postData['epContactmobile']);
}
// 更新
$enterpriseSdk = new Enterprise(Service::instance());
$this->_result = $enterpriseSdk->modify($postData);
return true;
}
}