BusinessmanController.php
6.2 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
<?php
/**
* 展商服务
* Author : xiaojie
* DateTime: 2018/12/06 11:21
*/
namespace app\portal\controller;
use app\portal\model\PageModel;
use app\portal\model\PortalCategoryModel;
use app\portal\model\ShowModel;
use app\portal\model\StandModel;
use cmf\controller\HomeBaseController;
use think\Session;
class BusinessmanController extends HomeBaseController
{
/**
* 展商名录
* portal/businessman/directories
*/
public function directories()
{
$keyword = $this->request->param('keyword','');
$showModel = new ShowModel();
$list = $showModel->getList(24,$keyword,16);
$page = $this->getPageStyle($list);
//所在位置
$location = [
[
'location' => '展商服务',
'url' => 'javascript:;'
],
[
'location' => '展商名录',
'url' => url('portal/businessman/directories')
]
];
$this->assign('list',$list);
$this->assign('location',$location);
$this->assign('page',$page);
$this->assign('keyword',empty($keyword)?'':$keyword);
return $this->fetch();
}
/**
* 参展手册(参展流程)
* portal/businessman/manual
*/
public function manual()
{
$cate_id = 25;
$pageModel = new PageModel();
$info = $pageModel->where('cate_id',$cate_id)->find();
$this->setPageNum($info['id']);
//所在位置
$location = [
[
'location' => '展商服务',
'url' => 'javascript:;'
],
[
'location' => '参展手册',
'url' => url('portal/businessman/manual')
]
];
$this->assign('info',$info);
$this->assign('location',$location);
return $this->fetch(':page');
}
/**
* 展商心声
* portal/businessman/aspirations
*/
public function aspirations()
{
$cate_id = 27;
$showModel = new ShowModel();
$cateModel = new PortalCategoryModel();
//分类信息
$info = $cateModel->where('id',$cate_id)->find();
//列表信息
$list = $showModel->getList($cate_id,'',4);
//分页样式
$page = $this->getPageStyle($list);
//增加阅读量
$this->setCateNum($cate_id);
//所在位置
$location = [
[
'location' => '展商服务',
'url' => 'javascript:;'
],
[
'location' => '展商心声',
'url' => url('portal/businessman/aspirations')
]
];
$this->assign('location',$location);
$this->assign('list',$list);
$this->assign('page',$page);
$this->assign('info',$info);
return $this->fetch();
}
/**
* 特装搭建
* portal/businessman/build
*/
public function build()
{
$cate_id = 26;
$pageModel = new PageModel();
$info = $pageModel->where('cate_id',$cate_id)->find();
$this->setPageNum($info['id']);
//所在位置
$location = [
[
'location' => '展商服务',
'url' => 'javascript:;'
],
[
'location' => '特装搭建',
'url' => url('portal/businessman/build')
]
];
$this->assign('info',$info);
$this->assign('location',$location);
return $this->fetch(':page');
}
/**
* 展位预定
* portal/businessman/reserve
*/
public function reserve()
{
return $this->fetch();
}
/**
* 展位预定提交
*/
public function ajax_reserve_add()
{
$user_mobile = Session::get('user_mobile');
if(empty($user_mobile)){
$this->apiResponse(-1,'请登录后在操作');
}
$param = $this->request->param();
if(empty($param['enterprise_name']) or !isset($param['enterprise_name'])){
$this->apiResponse(0,'企业名称不能为空');
}
if(empty($param['exhibits_name']) or !isset($param['exhibits_name'])){
$this->apiResponse(0,'展品名称不能为空');
}
if(empty($param['application']) or !isset($param['application'])){
$this->apiResponse(0,'应用行业不能为空');
}
if(empty($param['name']) or !isset($param['name'])){
$this->apiResponse(0,'联系人不能为空');
}
if(empty($param['mobile']) or !isset($param['mobile'])){
$this->apiResponse(0,'手机号不能为空');
}
if(empty($param['email']) or !isset($param['email'])){
$this->apiResponse(0,'邮箱不能为空');
}
// if(empty($param['phone']) or !isset($param['phone'])){
// $this->apiResponse(0,'座机不能为空');
// }
if(empty($param['company']) or !isset($param['company'])){
$this->apiResponse(0,'公司不能为空');
}
if(empty($param['booth']) or !isset($param['booth'])){
$this->apiResponse(0,'展位要求不能为空');
}
if(empty($param['area']) or !isset($param['area'])){
$this->apiResponse(0,'展区要求不能为空');
}
if(!in_array(2,$param['booth'])){
$param['booth_data'][1] = '';
}else{
if(empty($param['booth_data'][1])){
$this->apiResponse(0,'请填写标准展位个数');
}
}
if(!in_array(3,$param['booth'])){
$param['booth_data'][2] = '';
}else{
if(empty($param['booth_data'][2])){
$this->apiResponse(0,'请填写空地所占平米数');
}
}
if(!in_array(8,$param['area'])){
$param['area_data'] = '';
}else{
if(empty($param['area_data'])){
$this->apiResponse(0,'请填写其他的具体内容');
}
}
$standModel = new StandModel();
$res = $standModel->save($param);
if($res){
$this->apiResponse(1,'提交成功');
}
$this->apiResponse(0,'请稍后重试');
}
}