SaveController.class.php
1016 Bytes
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
/**
* 【销售活动-后台】更新企业配置接口
*
* User: daijun
* Date: 2018-01-30
*/
namespace Apicp\Controller\RedSetting;
use Com\PackageValidate;
use VcySDK\Enterprise;
use VcySDK\Service;
class SaveController extends \Apicp\Controller\AbstractController
{
public function Index_post()
{
// 验证规则
$rules = [
'wxMchid' => 'require',
'wxMchkey' => 'require',
'wxMchSecret' => 'require'
];
// 验证数据
$validate = new PackageValidate($rules, [], array_keys($rules));
$postData = $validate->postData;
$data = [
'wxMchid' => $postData['wxMchid'],
'wxMchkey' => $postData['wxMchkey'],
'wxMchSecret' => $postData['wxMchSecret'],
];
// 实例化企业信息类
$enterprise = new Enterprise(Service::instance());
// 更新企业配置信息
$enterprise->modifySetting($data);
return true;
}
}