|
@@ -45,17 +45,25 @@ class ZcPosition extends Base
|
45
|
45
|
}
|
46
|
46
|
|
47
|
47
|
// 多语言
|
48
|
|
- $condition['a.lang'] = array('eq', $this->admin_lang);
|
|
48
|
+ //$condition['a.lang'] = array('eq', $this->admin_lang);
|
49
|
49
|
|
50
|
|
- $adPositionM = Db::name('ad_position');
|
|
50
|
+ $adPositionM = Db::name('zc_position');
|
51
|
51
|
$count = $adPositionM->alias('a')->where($condition)->count();// 查询满足要求的总记录数
|
52
|
52
|
$Page = new Page($count, config('paginate.list_rows'));// 实例化分页类 传入总记录数和每页显示的记录数
|
53
|
53
|
$list = $adPositionM->alias('a')->where($condition)->order('id desc')->limit($Page->firstRow.','.$Page->listRows)->getAllWithIndex('id');
|
54
|
54
|
|
|
55
|
+ //var_dump($condition);die;
|
|
56
|
+
|
55
|
57
|
// 每组获取三张图片
|
56
|
58
|
$pids = get_arr_column($list, 'id');
|
57
|
|
- $ad = Db::name('ad')->where(['pid' => ['IN', $pids], 'lang' => $this->admin_lang])->order('pid asc, id asc')->select();
|
|
59
|
+ $ad = Db::name('zc')
|
|
60
|
+ ->where(['pid' => ['IN', $pids], 'lang' => $this->admin_lang])
|
|
61
|
+ ->order('pid asc, id asc')
|
|
62
|
+ ->select();
|
|
63
|
+
|
58
|
64
|
foreach ($list as $k => $v) {
|
|
65
|
+
|
|
66
|
+ /*
|
59
|
67
|
if (1 == $v['type']) {
|
60
|
68
|
// 图片封面图片
|
61
|
69
|
$v['ad'] = [];
|
|
@@ -87,7 +95,35 @@ class ZcPosition extends Base
|
87
|
95
|
$v['ad'][]['litpic'] = ROOT_DIR . '/public/static/admin/images/ad_type_html.png';
|
88
|
96
|
// 广告类型
|
89
|
97
|
$v['type_name'] = 'HTML代码';
|
|
98
|
+ }*/
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+ //处理图片
|
|
102
|
+ $v['ad'] = [];
|
|
103
|
+ foreach ($ad as $m => $n) {
|
|
104
|
+ if ($v['id'] == $n['pid']) {
|
|
105
|
+ $n['litpic'] = get_default_pic($n['litpic']); // 支持子目录
|
|
106
|
+ $v['ad'][] = $n;
|
|
107
|
+ unset($ad[$m]);
|
|
108
|
+ } else {
|
|
109
|
+ continue;
|
|
110
|
+ }
|
90
|
111
|
}
|
|
112
|
+ // 若没有内容则显示默认图片
|
|
113
|
+ if (empty($v['ad'])) {
|
|
114
|
+ $v['ad_count'] = 0;
|
|
115
|
+ $v['ad'][]['litpic'] = ROOT_DIR . '/public/static/common/images/not_adv.jpg';
|
|
116
|
+ } else {
|
|
117
|
+ $v['ad_count'] = count($v['ad']);
|
|
118
|
+ }
|
|
119
|
+
|
|
120
|
+ //获取地区
|
|
121
|
+ $one = Db::name('citysite')
|
|
122
|
+ ->where(['id'=>$v['type']])
|
|
123
|
+ ->find();
|
|
124
|
+
|
|
125
|
+ $v['type_name'] = $one['name'];
|
|
126
|
+
|
91
|
127
|
$list[$k] = $v;
|
92
|
128
|
}
|
93
|
129
|
|
|
@@ -110,7 +146,7 @@ class ZcPosition extends Base
|
110
|
146
|
$tid_tmp = str_replace('adp', '', $val['attr_name']);
|
111
|
147
|
array_push($ids, intval($tid_tmp));
|
112
|
148
|
}
|
113
|
|
- $main_advRow = Db::name('ad_position')->field("id,title,CONCAT('adp', id) AS attr_name")
|
|
149
|
+ $main_advRow = Db::name('zc_position')->field("id,title,CONCAT('adp', id) AS attr_name")
|
114
|
150
|
->where([
|
115
|
151
|
'id' => ['IN', $ids],
|
116
|
152
|
'lang' => $this->main_lang,
|
|
@@ -126,6 +162,11 @@ class ZcPosition extends Base
|
126
|
162
|
$this->assign('main_adv_list', $main_adv_list);
|
127
|
163
|
/*end*/
|
128
|
164
|
|
|
165
|
+ //查找区域数据
|
|
166
|
+ $pro_list = Db::name('citysite')->where(['level'=>1,'is_open'=>1])->select();
|
|
167
|
+ //var_dump($pro_list);
|
|
168
|
+ $this->assign('pro_list', $pro_list);
|
|
169
|
+
|
129
|
170
|
return $this->fetch();
|
130
|
171
|
}
|
131
|
172
|
|
|
@@ -143,33 +184,44 @@ class ZcPosition extends Base
|
143
|
184
|
|
144
|
185
|
if (IS_POST) {
|
145
|
186
|
$post = input('post.');
|
|
187
|
+
|
|
188
|
+
|
|
189
|
+ /*
|
|
190
|
+ * array(11) { ["title"]=> string(12) "建筑职称" ["type"]=> string(1) "1" ["img_id"]=> array(1) { [0]=> string(0) "" } ["img_litpic"]=> array(1) { [0]=> string(67) "https://oss.zc10000.com/uploads/allimg/20240528/1-24052R01005Z4.png" } ["img_title"]=> array(1) { [0]=> string(0) "" } ["img_links"]=> array(1) { [0]=> string(0) "" } ["img_intro"]=> array(1) { [0]=> string(0) "" } ["img_target"]=> array(1) { [0]=> string(1) "0" } ["video_litpic"]=> string(0) "" ["html_intro"]=> string(0) "" ["intro"]=> string(0) "" }
|
|
191
|
+ */
|
|
192
|
+ //var_dump($post);die;
|
|
193
|
+
|
|
194
|
+
|
146
|
195
|
$map = array(
|
147
|
196
|
'title' => trim($post['title']),
|
148
|
197
|
'lang' => $this->admin_lang,
|
149
|
198
|
);
|
150
|
|
- if(Db::name('ad_position')->where($map)->count() > 0){
|
151
|
|
- $this->error('该广告名称已存在,请检查', url('AdPosition/index'));
|
|
199
|
+ if(Db::name('zc_position')->where($map)->count() > 0){
|
|
200
|
+ $this->error('该职称名称已存在,请检查', url('ZcPosition/index'));
|
152
|
201
|
}
|
153
|
202
|
|
|
203
|
+
|
154
|
204
|
// 添加广告位置表信息
|
155
|
205
|
$data = array(
|
156
|
206
|
'title' => trim($post['title']),
|
157
|
|
- 'type' => $post['type'],
|
158
|
|
- 'intro' => $post['intro'],
|
|
207
|
+ 'type' => $post['type'], //职称地区
|
|
208
|
+ 'intro' => $post['intro'], //备注
|
159
|
209
|
'admin_id' => session('admin_id'),
|
160
|
210
|
'lang' => $this->admin_lang,
|
161
|
211
|
'add_time' => getTime(),
|
162
|
212
|
'update_time' => getTime(),
|
163
|
213
|
);
|
164
|
|
- $insertID = Db::name('ad_position')->insertGetId($data);
|
|
214
|
+ $insertID = Db::name('zc_position')->insertGetId($data);
|
|
215
|
+
|
165
|
216
|
|
166
|
217
|
if (!empty($insertID)) {
|
|
218
|
+
|
167
|
219
|
// 同步广告位置ID到多语言的模板变量里,添加多语言广告位
|
168
|
|
- $this->syn_add_language_attribute($insertID);
|
|
220
|
+ //$this->syn_add_language_attribute($insertID);
|
169
|
221
|
|
170
|
222
|
// 读取组合广告位的图片及信息
|
171
|
223
|
$AdData = [];
|
172
|
|
- if (1 == $post['type'] && !empty($post['img_litpic'])) { // 图片类型
|
|
224
|
+ if (!empty($post['img_litpic'])) { // 图片类型
|
173
|
225
|
$i = 1;
|
174
|
226
|
foreach ($post['img_litpic'] as $key => $value) {
|
175
|
227
|
if (!empty($value)) {
|
|
@@ -193,62 +245,18 @@ class ZcPosition extends Base
|
193
|
245
|
$AdData['add_time'] = getTime();
|
194
|
246
|
$AdData['update_time'] = getTime();
|
195
|
247
|
// 添加到广告图表
|
196
|
|
- $ad_id = Db::name('ad')->add($AdData);
|
|
248
|
+ $ad_id = Db::name('zc')->add($AdData);
|
197
|
249
|
// 同步多语言
|
198
|
|
- $this->syn_add_ad_language_attribute($ad_id);
|
|
250
|
+ //$this->syn_add_ad_language_attribute($ad_id);
|
199
|
251
|
}
|
200
|
252
|
}
|
201
|
|
-
|
202
|
|
- } else if (2 == $post['type'] && !empty($post['video_litpic'])) { // 媒体类型
|
203
|
|
- // 去掉http:
|
204
|
|
- $video_litpic = str_replace("http:", "", $post['video_litpic']);
|
205
|
|
- // 去掉https:
|
206
|
|
- $video_litpic = str_replace("https:", "", $post['video_litpic']);
|
207
|
|
- // 主要参数
|
208
|
|
- $AdData['litpic'] = $video_litpic;
|
209
|
|
- $AdData['pid'] = $insertID;
|
210
|
|
- $AdData['title'] = trim($post['title']);
|
211
|
|
- // 其他参数
|
212
|
|
- $AdData['intro'] = '';
|
213
|
|
- $AdData['links'] = '';
|
214
|
|
- $AdData['target'] = 0;
|
215
|
|
- $AdData['media_type'] = 2;
|
216
|
|
- $AdData['admin_id'] = session('admin_id');
|
217
|
|
- $AdData['lang'] = $this->admin_lang;
|
218
|
|
- $AdData['sort_order'] = 1;
|
219
|
|
- $AdData['add_time'] = getTime();
|
220
|
|
- $AdData['update_time'] = getTime();
|
221
|
|
- // 添加到广告图表
|
222
|
|
- $ad_id = Db::name('ad')->add($AdData);
|
223
|
|
- // 同步多语言
|
224
|
|
- $this->syn_add_ad_language_attribute($ad_id);
|
225
|
|
-
|
226
|
|
- } else if (3 == $post['type'] && !empty($post['html_intro'])) { // HTML代码
|
227
|
|
- // 主要参数
|
228
|
|
- $AdData['pid'] = $insertID;
|
229
|
|
- $AdData['title'] = trim($post['title']);
|
230
|
|
- $AdData['intro'] = $post['html_intro'];
|
231
|
|
- // 其他参数
|
232
|
|
- $AdData['litpic'] = '';
|
233
|
|
- $AdData['links'] = '';
|
234
|
|
- $AdData['target'] = 0;
|
235
|
|
- $AdData['media_type'] = 3;
|
236
|
|
- $AdData['admin_id'] = session('admin_id');
|
237
|
|
- $AdData['lang'] = $this->admin_lang;
|
238
|
|
- $AdData['sort_order'] = 1;
|
239
|
|
- $AdData['add_time'] = getTime();
|
240
|
|
- $AdData['update_time'] = getTime();
|
241
|
|
- // 添加到广告图表
|
242
|
|
- $ad_id = Db::name('ad')->add($AdData);
|
243
|
|
- // 同步多语言
|
244
|
|
- $this->syn_add_ad_language_attribute($ad_id);
|
245
|
|
-
|
246
|
253
|
}
|
247
|
|
- Cache::clear('ad');
|
248
|
|
- adminLog('新增广告:'.$post['title']);
|
249
|
|
- $this->success("操作成功", url('AdPosition/index'));
|
|
254
|
+
|
|
255
|
+ //Cache::clear('ad');
|
|
256
|
+ adminLog('新增职称:'.$post['title']);
|
|
257
|
+ $this->success("操作成功", url('ZcPosition/index'));
|
250
|
258
|
} else {
|
251
|
|
- $this->error("操作失败", url('AdPosition/index'));
|
|
259
|
+ $this->error("操作失败", url('ZcPosition/index'));
|
252
|
260
|
}
|
253
|
261
|
}
|
254
|
262
|
|
|
@@ -277,6 +285,10 @@ class ZcPosition extends Base
|
277
|
285
|
$this->assign('media_type', $media_type);
|
278
|
286
|
|
279
|
287
|
|
|
288
|
+ //查找区域数据
|
|
289
|
+ $pro_list = Db::name('citysite')->where(['level'=>1,'is_open'=>1])->select();
|
|
290
|
+ //var_dump($pro_list);
|
|
291
|
+ $this->assign('pro_list', $pro_list);
|
280
|
292
|
|
281
|
293
|
|
282
|
294
|
return $this->fetch();
|
|
@@ -289,20 +301,24 @@ class ZcPosition extends Base
|
289
|
301
|
public function edit()
|
290
|
302
|
{
|
291
|
303
|
if (IS_POST) {
|
|
304
|
+
|
|
305
|
+
|
292
|
306
|
$post = input('post.');
|
293
|
307
|
if (!empty($post['id'])) {
|
|
308
|
+
|
|
309
|
+
|
294
|
310
|
$post['id'] = intval($post['id']);
|
295
|
311
|
if (array_key_exists($post['id'], $this->ad_position_system_id)) {
|
296
|
|
- $this->error("不可更改系统预定义位置", url('AdPosition/edit',array('id'=>$post['id'])));
|
|
312
|
+ $this->error("不可更改系统预定义位置", url('ZcPosition/edit',array('id'=>$post['id'])));
|
297
|
313
|
}
|
298
|
314
|
|
299
|
315
|
/* 判断除自身外是否还有相同广告名称已存在 */
|
300
|
316
|
$map = array(
|
301
|
317
|
'id' => array('NEQ', $post['id']),
|
302
|
318
|
'title' => trim($post['title']),
|
303
|
|
- 'lang' => $this->admin_lang,
|
|
319
|
+ //'lang' => $this->admin_lang,
|
304
|
320
|
);
|
305
|
|
- if (Db::name('ad_position')->where($map)->count() > 0) $this->error('该广告名称已存在,请检查');
|
|
321
|
+ if (Db::name('zc_position')->where($map)->count() > 0) $this->error('该职称名称已存在,请检查');
|
306
|
322
|
/* END */
|
307
|
323
|
|
308
|
324
|
/* 判断广告是否切换广告类型 */
|
|
@@ -311,13 +327,13 @@ class ZcPosition extends Base
|
311
|
327
|
// 'type' => $post['type'],
|
312
|
328
|
// 'lang' => $this->admin_lang
|
313
|
329
|
// ];
|
314
|
|
- // if (Db::name('ad_position')->where($where)->count() == 0) {
|
|
330
|
+ // if (Db::name('zc_position')->where($where)->count() == 0) {
|
315
|
331
|
// // 已切换广告类型,清除广告中的广告内容
|
316
|
332
|
// $where = [
|
317
|
333
|
// 'pid' => $post['id'],
|
318
|
334
|
// 'lang' => $this->admin_lang
|
319
|
335
|
// ];
|
320
|
|
- // Db::name('ad')->where($where)->delete();
|
|
336
|
+ // Db::name('zc')->where($where)->delete();
|
321
|
337
|
// }
|
322
|
338
|
/* END */
|
323
|
339
|
|
|
@@ -329,13 +345,13 @@ class ZcPosition extends Base
|
329
|
345
|
'intro' => $post['intro'],
|
330
|
346
|
'update_time' => getTime(),
|
331
|
347
|
);
|
332
|
|
- $resultID = Db::name('ad_position')->update($data);
|
|
348
|
+ $resultID = Db::name('zc_position')->update($data);
|
333
|
349
|
/* END */
|
334
|
350
|
}
|
335
|
351
|
|
336
|
352
|
if (!empty($resultID)) {
|
337
|
|
- $ad_db = Db::name('ad');
|
338
|
|
- if (1 == $post['type'] && !empty($post['img_litpic'])) { // 图片类型
|
|
353
|
+ $ad_db = Db::name('zc');
|
|
354
|
+ if (!empty($post['img_litpic'])) { // 图片类型
|
339
|
355
|
// 读取组合广告位的图片及信息
|
340
|
356
|
$i = 1;
|
341
|
357
|
foreach ($post['img_litpic'] as $key => $value) {
|
|
@@ -383,7 +399,7 @@ class ZcPosition extends Base
|
383
|
399
|
$AdData['update_time'] = getTime();
|
384
|
400
|
$ad_id = $ad_db->add($AdData);
|
385
|
401
|
// 同步多语言
|
386
|
|
- $this->syn_add_ad_language_attribute($ad_id);
|
|
402
|
+ //$this->syn_add_ad_language_attribute($ad_id);
|
387
|
403
|
}
|
388
|
404
|
} else {
|
389
|
405
|
// 主要参数
|
|
@@ -402,73 +418,15 @@ class ZcPosition extends Base
|
402
|
418
|
$AdData['update_time'] = getTime();
|
403
|
419
|
$ad_id = $ad_db->add($AdData);
|
404
|
420
|
// 同步多语言
|
405
|
|
- $this->syn_add_ad_language_attribute($ad_id);
|
|
421
|
+ //$this->syn_add_ad_language_attribute($ad_id);
|
406
|
422
|
}
|
407
|
423
|
}
|
408
|
424
|
}
|
409
|
425
|
|
410
|
|
- } else if (2 == $post['type'] && !empty($post['video_litpic'])) { // 媒体类型
|
411
|
|
- // 去掉http:
|
412
|
|
- $video_litpic = str_replace("http:", "", $post['video_litpic']);
|
413
|
|
- // 去掉https:
|
414
|
|
- $video_litpic = str_replace("https:", "", $post['video_litpic']);
|
415
|
|
- if (!empty($post['video_id'])) {
|
416
|
|
- // 更新广告内容
|
417
|
|
- $AdData['litpic'] = $video_litpic;
|
418
|
|
- $AdData['title'] = trim($post['title']);
|
419
|
|
- $AdData['media_type'] = 2;
|
420
|
|
- $AdData['update_time'] = getTime();
|
421
|
|
- $ad_db->where('id', $post['video_id'])->update($AdData);
|
422
|
|
- } else {
|
423
|
|
- // 新增广告内容
|
424
|
|
- $AdData['litpic'] = $video_litpic;
|
425
|
|
- $AdData['pid'] = $post['id'];
|
426
|
|
- $AdData['title'] = trim($post['title']);
|
427
|
|
- $AdData['links'] = '';
|
428
|
|
- $AdData['intro'] = '';
|
429
|
|
- $AdData['target'] = 0;
|
430
|
|
- $AdData['media_type'] = 2;
|
431
|
|
- $AdData['admin_id'] = session('admin_id');
|
432
|
|
- $AdData['lang'] = $this->admin_lang;
|
433
|
|
- $AdData['sort_order'] = 1;
|
434
|
|
- $AdData['add_time'] = getTime();
|
435
|
|
- $AdData['update_time'] = getTime();
|
436
|
|
- $ad_id = $ad_db->add($AdData);
|
437
|
|
- // 同步多语言
|
438
|
|
- $this->syn_add_ad_language_attribute($ad_id);
|
439
|
|
- }
|
440
|
|
-
|
441
|
|
- } else if (3 == $post['type'] && !empty($post['html_intro'])) { // HTML代码
|
442
|
|
- if (!empty($post['html_id'])) {
|
443
|
|
- // 更新广告内容
|
444
|
|
- $AdData['title'] = trim($post['title']);
|
445
|
|
- $AdData['intro'] = $post['html_intro'];
|
446
|
|
- $AdData['media_type'] = 3;
|
447
|
|
- $AdData['update_time'] = getTime();
|
448
|
|
- $ad_db->where('id', $post['html_id'])->update($AdData);
|
449
|
|
- } else {
|
450
|
|
- // 新增广告内容
|
451
|
|
- $AdData['litpic'] = '';
|
452
|
|
- $AdData['pid'] = $post['id'];
|
453
|
|
- $AdData['title'] = trim($post['title']);
|
454
|
|
- $AdData['intro'] = $post['html_intro'];
|
455
|
|
- $AdData['links'] = '';
|
456
|
|
- $AdData['target'] = 0;
|
457
|
|
- $AdData['media_type'] = 3;
|
458
|
|
- $AdData['admin_id'] = session('admin_id');
|
459
|
|
- $AdData['lang'] = $this->admin_lang;
|
460
|
|
- $AdData['sort_order'] = 1;
|
461
|
|
- $AdData['add_time'] = getTime();
|
462
|
|
- $AdData['update_time'] = getTime();
|
463
|
|
- $ad_id = $ad_db->add($AdData);
|
464
|
|
- // 同步多语言
|
465
|
|
- $this->syn_add_ad_language_attribute($ad_id);
|
466
|
|
- }
|
467
|
|
-
|
468
|
426
|
}
|
469
|
|
- Cache::clear('ad');
|
470
|
|
- adminLog('编辑广告:'.$post['title']);
|
471
|
|
- $this->success("操作成功", url('AdPosition/index'));
|
|
427
|
+ //Cache::clear('ad');
|
|
428
|
+ adminLog('编辑职称名称:'.$post['title']);
|
|
429
|
+ $this->success("操作成功", url('ZcPosition/index'));
|
472
|
430
|
} else {
|
473
|
431
|
$this->error("操作失败");
|
474
|
432
|
}
|
|
@@ -477,8 +435,8 @@ class ZcPosition extends Base
|
477
|
435
|
$assign_data = array();
|
478
|
436
|
|
479
|
437
|
$id = input('id/d');
|
480
|
|
- $field = Db::name('ad_position')->field('a.*')->alias('a')->where(array('a.id'=>$id))->find();
|
481
|
|
- if (empty($field)) $this->error('广告不存在,请联系管理员!');
|
|
438
|
+ $field = Db::name('zc_position')->field('a.*')->alias('a')->where(array('a.id'=>$id))->find();
|
|
439
|
+ if (empty($field)) $this->error('职称不存在,请联系管理员!');
|
482
|
440
|
switch ($field['type']) {
|
483
|
441
|
case '1':
|
484
|
442
|
$field['type_name'] = '图片';
|
|
@@ -493,7 +451,7 @@ class ZcPosition extends Base
|
493
|
451
|
$assign_data['field'] = $field;
|
494
|
452
|
|
495
|
453
|
// 广告
|
496
|
|
- $ad_data = Db::name('ad')->where(array('pid'=>$field['id']))->order('sort_order asc')->select();
|
|
454
|
+ $ad_data = Db::name('zc')->where(array('pid'=>$field['id']))->order('sort_order asc')->select();
|
497
|
455
|
foreach ($ad_data as $key => $val) {
|
498
|
456
|
if (1 == $val['media_type']) {
|
499
|
457
|
$ad_data[$key]['litpic'] = get_default_pic($val['litpic']); // 支持子目录
|
|
@@ -530,6 +488,14 @@ class ZcPosition extends Base
|
530
|
488
|
$media_type = str_replace(",", "|", $media_type);
|
531
|
489
|
$assign_data['media_type'] = $media_type;
|
532
|
490
|
|
|
491
|
+
|
|
492
|
+ //查找区域数据
|
|
493
|
+ $pro_list = Db::name('citysite')->where(['level'=>1,'is_open'=>1])->select();
|
|
494
|
+ //var_dump($pro_list);
|
|
495
|
+ $this->assign('pro_list', $pro_list);
|
|
496
|
+ $this->assign('curr_id', $field['type']);
|
|
497
|
+
|
|
498
|
+
|
533
|
499
|
$this->assign($assign_data);
|
534
|
500
|
return $this->fetch();
|
535
|
501
|
}
|
|
@@ -568,7 +534,7 @@ class ZcPosition extends Base
|
568
|
534
|
}
|
569
|
535
|
/*--end*/
|
570
|
536
|
|
571
|
|
- $r = Db::name('ad')->where([
|
|
537
|
+ $r = Db::name('zc')->where([
|
572
|
538
|
'id' => ['IN', $id_arr],
|
573
|
539
|
])
|
574
|
540
|
->delete();
|
|
@@ -623,7 +589,7 @@ class ZcPosition extends Base
|
623
|
589
|
!empty($new_id_arr) && $id_arr = $new_id_arr;
|
624
|
590
|
}
|
625
|
591
|
/*--end*/
|
626
|
|
- $r = Db::name('ad_position')->where('id','IN',$id_arr)->delete();
|
|
592
|
+ $r = Db::name('zc_position')->where('id','IN',$id_arr)->delete();
|
627
|
593
|
if ($r !== false) {
|
628
|
594
|
|
629
|
595
|
/*多语言*/
|
|
@@ -648,12 +614,12 @@ class ZcPosition extends Base
|
648
|
614
|
}
|
649
|
615
|
/*--end*/
|
650
|
616
|
|
651
|
|
- $ad_ids = Db::name('ad')->where(['pid'=>['IN', $id_arr]])->column('id');
|
|
617
|
+ $ad_ids = Db::name('zc')->where(['pid'=>['IN', $id_arr]])->column('id');
|
652
|
618
|
$attr_name_arr = [];
|
653
|
619
|
foreach ($ad_ids as $key => $val) {
|
654
|
620
|
$attr_name_arr[] = "ad{$val}";
|
655
|
621
|
}
|
656
|
|
- $r1 = Db::name('ad')->where('pid','IN',$id_arr)->delete();
|
|
622
|
+ $r1 = Db::name('zc')->where('pid','IN',$id_arr)->delete();
|
657
|
623
|
if ($r1 !== false) {
|
658
|
624
|
/*多语言*/
|
659
|
625
|
if (!empty($attr_name_arr)) {
|
|
@@ -714,7 +680,7 @@ class ZcPosition extends Base
|
714
|
680
|
'title' => trim($post['title']),
|
715
|
681
|
'lang' => $this->admin_lang,
|
716
|
682
|
];
|
717
|
|
- $count = Db::name('ad_position')->where($where)->count();
|
|
683
|
+ $count = Db::name('zc_position')->where($where)->count();
|
718
|
684
|
if (empty($count)) {
|
719
|
685
|
$this->success('检测通过');
|
720
|
686
|
} else {
|
|
@@ -739,7 +705,7 @@ class ZcPosition extends Base
|
739
|
705
|
$main_lang = $this->main_lang;
|
740
|
706
|
$languageRow = Db::name('language')->field('mark')->order('id asc')->select();
|
741
|
707
|
if (!empty($languageRow) && $admin_lang == $main_lang) { // 当前语言是主体语言,即语言列表最早新增的语言
|
742
|
|
- $ad_position_db = Db::name('ad_position');
|
|
708
|
+ $ad_position_db = Db::name('zc_position');
|
743
|
709
|
$result = $ad_position_db->find($adp_id);
|
744
|
710
|
$attr_name = 'adp'.$adp_id;
|
745
|
711
|
$r = Db::name('language_attribute')->save([
|
|
@@ -796,7 +762,7 @@ class ZcPosition extends Base
|
796
|
762
|
$main_lang = get_main_lang();
|
797
|
763
|
$languageRow = Db::name('language')->field('mark')->order('id asc')->select();
|
798
|
764
|
if (!empty($languageRow) && $admin_lang == $main_lang) { // 当前语言是主体语言,即语言列表最早新增的语言
|
799
|
|
- $ad_db = Db::name('ad');
|
|
765
|
+ $ad_db = Db::name('zc');
|
800
|
766
|
$result = $ad_db->find($ad_id);
|
801
|
767
|
$attr_name = 'ad'.$ad_id;
|
802
|
768
|
$r = Db::name('language_attribute')->save([
|