Apply.php
1.1 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
<?php
namespace addons\groupon\controller\store;
use addons\groupon\exception\Exception;
use addons\groupon\controller\Base as GrouponBase;
/**
* 不继承门店的 base
*/
class Apply extends GrouponBase
{
protected $noNeedLogin = [];
protected $noNeedRight = ['*'];
public function info() {
$config = new \addons\groupon\model\Config;
$storeConfig = json_decode($config->where(['name' => 'store'])->value('value'), true);
$storeConfig['intro_image'] = (isset($storeConfig['intro_image']) && $storeConfig['intro_image']) ? cdnurl($storeConfig['intro_image'], true) : '';
$this->success('自提点申请', [
'apply' => \addons\groupon\model\store\Apply::info(),
'config' => $storeConfig
]);
}
public function apply() {
$params = $this->request->post();
// 表单验证
$this->grouponValidate($params, get_class(), 'apply');
$order = \addons\groupon\model\store\Apply::apply($params);
$this->success('自提点申请提交成功', $order);
}
}