Your Name 9 månader sedan
förälder
incheckning
f7d551d085

+ 109
- 143
application/admin/controller/ZcPosition.php Visa fil

@@ -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([

+ 26
- 12
application/admin/template/zc_position/add.htm Visa fil

@@ -5,10 +5,10 @@
5 5
 <div id="append_parent"></div>
6 6
 <div id="ajaxwaitid"></div>
7 7
 <div class="page min-hg-c-10">
8
-    <form class="form-horizontal" id="post_form" action="{:url('AdPosition/add')}" method="post">
8
+    <form class="form-horizontal" id="post_form" action="{:url('ZcPosition/add')}" method="post">
9 9
         <div class="ncap-form-default">
10 10
             <dl class="row">
11
-                <dt class="tit"> <label for="title"><em>*</em>广告名称</label> </dt>
11
+                <dt class="tit"> <label for="title"><em>*</em>职称名称</label> </dt>
12 12
                 <dd class="opt">
13 13
                     <input type="text" name="title" id="title" onkeyup="DetectionTitleRepeat(this);" class="input-txt" autocomplete="off">
14 14
                     <span class="err"></span>
@@ -17,20 +17,34 @@
17 17
             </dl>
18 18
 
19 19
             <dl class="row">
20
-                <dt class="tit"> <label for="type">广告类型</label> </dt>
20
+                <dt class="tit">
21
+                    <label for="type">选择地区</label>
22
+                </dt>
21 23
                 <dd class="opt">
22
-                    <label class="curpoin"><input type="radio" id="type1" name="type" value="1" onclick="TypeSwitch(1);">图片</label>
23
-                    &nbsp; &nbsp;
24
-                    <label class="curpoin"><input type="radio" id="type2" name="type" value="2" onclick="TypeSwitch(2);">多媒体</label>
25
-                    &nbsp; &nbsp;
26
-                    <label class="curpoin"><input type="radio" id="type3" name="type" value="3" onclick="TypeSwitch(3);">HTML代码</label>
24
+
25
+
26
+                    <!--<label class="curpoin"><input type="radio" id="type{$field1.id}" name="type" value="{$field1.id}" onclick="TypeSwitch({$field1.id});">{$field1.name}</label>
27
+                    -->
28
+
29
+
30
+                    <select name="type" class="select" style="margin:0px 5px;height:30px;">
31
+                        <option value="">--选择地区--</option>
32
+
33
+                        {eyou:foreach name='$pro_list' item='field1'}
34
+                        <option value="{$field1.id}" {eq name="$Request.param.type" value="$field1.id"}selected{/eq}>{$field1.name}</option>
35
+                        {/eyou:foreach}
36
+
37
+                    </select>
38
+
39
+
27 40
                     <span class="err"></span>
28 41
                     <p class="notic"></p>
29 42
                 </dd>
30 43
             </dl>
31 44
 
45
+
32 46
             <dl class="row 1615775137_dl" style="display: none;" id="1615775137_1">
33
-                <dt class="tit"> <label>广告内容</label> </dt>
47
+                <dt class="tit"> <label>主题背景</label> </dt>
34 48
                 <dd class="opt">
35 49
                     <div class="tab-pane" id="tab_imgupload">
36 50
                         <table class="table table-bordered">
@@ -104,7 +118,7 @@
104 118
                     &nbsp;<a href="javascript:void(0);" class="ncap-btn ncap-btn-green" id="upload_video_litpic_cos" onclick="$('#courseware_file').attr('data-type', 'cos').trigger('click');">cos上传</a>
105 119
                     {/eq}
106 120
                     &nbsp;<a href="javascript:void(0);" class="ncap-btn ncap-btn-green " id="upload_video_litpic_local" onclick="$('#courseware_file').attr('data-type', 'local').trigger('click');">本地上传</a>
107
-                    <input type="hidden" id="OpenPreviewVideoUrl" value="{:url('AdPosition/open_preview_video')}">
121
+                    <input type="hidden" id="OpenPreviewVideoUrl" value="{:url('ZcPosition/open_preview_video')}">
108 122
                     &nbsp;<a href="javascript:void(0);" class="ncap-btn ncap-btn-green" id="PreviewVideo" onclick="OpenPreviewVideo();">预览</a>
109 123
                 </dd>
110 124
             </dl>
@@ -596,7 +610,7 @@
596 610
         // 执行检测
597 611
         $.ajax({
598 612
             type: 'post',
599
-            url : "{:url('AdPosition/detection_title_repeat', ['_ajax'=>1])}",
613
+            url : "{:url('ZcPosition/detection_title_repeat', ['_ajax'=>1])}",
600 614
             data: {id: id, title: title},
601 615
             dataType: 'json',
602 616
             success: function(res) {
@@ -622,7 +636,7 @@
622 636
         layer_loading('正在处理');
623 637
         $.ajax({
624 638
             type : 'post',
625
-            url : "{:url('AdPosition/add', ['_ajax'=>1])}",
639
+            url : "{:url('ZcPosition/add', ['_ajax'=>1])}",
626 640
             data : $('#post_form').serialize(),
627 641
             dataType : 'json',
628 642
             success : function(res) {

+ 18
- 10
application/admin/template/zc_position/edit.htm Visa fil

@@ -5,10 +5,10 @@
5 5
 <div id="append_parent"></div>
6 6
 <div id="ajaxwaitid"></div>
7 7
 <div class="page min-hg-c-10">
8
-    <form class="form-horizontal" id="post_form" action="{:url('AdPosition/edit')}" method="post">
8
+    <form class="form-horizontal" id="post_form" action="{:url('ZcPosition/edit')}" method="post">
9 9
         <div class="ncap-form-default">
10 10
             <dl class="row">
11
-                <dt class="tit"> <label for="title"><em>*</em>广告名称</label> </dt>
11
+                <dt class="tit"> <label for="title"><em>*</em>职称名称</label> </dt>
12 12
                 <dd class="opt">
13 13
                     <input type="text" name="title" value="{$field.title}" id="title" onkeyup="DetectionTitleRepeat(this);" class="input-txt" autocomplete="off">
14 14
                     <span class="err"></span>
@@ -17,14 +17,22 @@
17 17
             </dl>
18 18
 
19 19
             <dl class="row">
20
-                <dt class="tit"> <label for="type">广告类型</label> </dt>
20
+                <dt class="tit"> <label for="type">选择地区</label> </dt>
21 21
                 <dd class="opt">
22
-                    <input type="hidden" name="type" value="{$field.type}"> {$field.type_name} 
22
+                    <select name="type" class="select" style="margin:0px 5px;height:30px;">
23
+                        <option value="">--选择地区--</option>
24
+
25
+                        {eyou:foreach name='$pro_list' item='field1'}
26
+                        <option value="{$field1.id}" {eq name="$curr_id" value="$field1.id"}selected{/eq}>{$field1.name}</option>
27
+                        {/eyou:foreach}
28
+
29
+                    </select>
23 30
                 </dd>
24 31
             </dl>
25 32
 
26
-            <dl class="row 1615775137_dl" style="display: none;" id="1615775137_1" style="z-index: 2">
27
-                <dt class="tit"> <label>广告内容</label> </dt>
33
+            <!--暂时找不到控制显示隐藏的地方-->
34
+            <dl class="row 1615775137_dl" style="display: block;" id="1615775137_1" style="z-index: 2">
35
+                <dt class="tit"> <label>主题背景</label> </dt>
28 36
                 <dd class="opt">
29 37
                     <div class="tab-pane" id="tab_imgupload">
30 38
                         <table class="table table-bordered">
@@ -152,7 +160,7 @@
152 160
                     &nbsp;<a href="javascript:void(0);" class="ncap-btn ncap-btn-green" id="upload_video_litpic_cos" onclick="$('#courseware_file').attr('data-type', 'cos').trigger('click');">cos上传</a>
153 161
                     {/eq}
154 162
                     &nbsp;<a href="javascript:void(0);" class="ncap-btn ncap-btn-green " id="upload_video_litpic_local" onclick="$('#courseware_file').attr('data-type', 'local').trigger('click');">本地上传</a>
155
-                    <input type="hidden" id="OpenPreviewVideoUrl" value="{:url('AdPosition/open_preview_video')}">
163
+                    <input type="hidden" id="OpenPreviewVideoUrl" value="{:url('ZcPosition/open_preview_video')}">
156 164
                     &nbsp;<a href="javascript:void(0);" class="ncap-btn ncap-btn-green" id="PreviewVideo" onclick="OpenPreviewVideo();">预览</a>
157 165
                 </dd>
158 166
             </dl>
@@ -654,7 +662,7 @@
654 662
         // 执行检测
655 663
         $.ajax({
656 664
             type: 'post',
657
-            url : "{:url('AdPosition/detection_title_repeat', ['_ajax'=>1])}",
665
+            url : "{:url('ZcPosition/detection_title_repeat', ['_ajax'=>1])}",
658 666
             data: {id: id, title: title},
659 667
             dataType: 'json',
660 668
             success: function(res) {
@@ -680,7 +688,7 @@
680 688
         layer_loading('正在处理');
681 689
         $.ajax({
682 690
             type : 'post',
683
-            url : "{:url('AdPosition/edit', ['_ajax'=>1])}",
691
+            url : "{:url('ZcPosition/edit', ['_ajax'=>1])}",
684 692
             data : $('#post_form').serialize(),
685 693
             dataType : 'json',
686 694
             success : function(res){
@@ -781,7 +789,7 @@
781 789
         // 删除数据库记录
782 790
         $.ajax({
783 791
             type:'POST',
784
-            url:"{:url('AdPosition/del_imgupload')}",
792
+            url:"{:url('ZcPosition/del_imgupload')}",
785 793
             data:{del_id:id,_ajax:1},
786 794
             success:function(){
787 795
                 $(obj).parent().parent().parent().remove(); // 删除完服务器的, 再删除 html上的图片

+ 19
- 17
application/admin/template/zc_position/index.htm Visa fil

@@ -10,7 +10,7 @@
10 10
 				{if condition="$main_lang == $admin_lang || !empty($global['language_split'])"}
11 11
 				    {eq name="$Think.const.CONTROLLER_NAME.'@add'|is_check_access" value="1"}
12 12
         				 <div class="fbutton">
13
-        				     <a href="javascript:void(0);" data-href="{:url('AdPosition/add')}" onclick="openFullframe(this, '新增广告222', '100%', '100%');">
13
+        				     <a href="javascript:void(0);" data-href="{:url('ZcPosition/add')}" onclick="openFullframe(this, '新增职称', '100%', '100%');">
14 14
         				         <div class="add">
15 15
         				             <span><i class="layui-icon layui-icon-addition"></i>新增职称</span>
16 16
         				         </div>
@@ -19,15 +19,17 @@
19 19
 				    {/eq}
20 20
 				 {/if}
21 21
             </div>
22
-            <form id="searchForm" class="navbar-form form-inline" action="{:url('AdPosition/index')}" method="get" onsubmit="layer_loading('正在处理');">
22
+            <form id="searchForm" class="navbar-form form-inline" action="{:url('ZcPosition/index')}" method="get" onsubmit="layer_loading('正在处理');">
23 23
                 {$searchform.hidden|default=''}
24 24
                 <div class="sDiv">
25 25
                     <div class="sDiv2">
26 26
                         <select name="type" class="select" style="margin:0px 5px;">
27
-                            <option value="">--广告类型--</option>
28
-                            <option value="1" {eq name="$Request.param.type" value="1"}selected{/eq}>图片</option>
29
-                            <option value="2" {eq name="$Request.param.type" value="2"}selected{/eq}>多媒体</option>
30
-                            <option value="3" {eq name="$Request.param.type" value="3"}selected{/eq}>HTML代码</option>
27
+                            <option value="">--选择地区--</option>
28
+
29
+                            {eyou:foreach name='$pro_list' item='field1'}
30
+                            <option value="{$field1.id}" {eq name="$Request.param.type" value="$field1.id"}selected{/eq}>{$field1.name}</option>
31
+                            {/eyou:foreach}
32
+
31 33
                         </select>
32 34
                     </div>
33 35
                     <div class="sDiv2">
@@ -55,15 +57,15 @@
55 57
                             </th>
56 58
 
57 59
                             <th abbr="article_title" axis="col3">
58
-                                <div class="tl text-l10" style="width: 100%">广告名称</div>
60
+                                <div class="tl text-l10" style="width: 100%">职称名称</div>
59 61
                             </th>
60 62
 
61 63
                             <th abbr="article_title" axis="col3" class="w100">
62
-                                <div class="tc">广告类型</div>
64
+                                <div class="tc">职称地区</div>
63 65
                             </th>
64 66
 
65 67
                             <th abbr="article_title" axis="col3" class="w120">
66
-                                <div class="tc">封面图片</div>
68
+                                <div class="tc">主题图片</div>
67 69
                             </th>
68 70
 
69 71
                             <th abbr="article_time" axis="col6" class="w60">
@@ -112,7 +114,7 @@
112 114
                                 <td align="left" style="width:100%;">
113 115
                                     <div class="tl text-l10">
114 116
                                         {eq name="$Think.const.CONTROLLER_NAME.'@edit'|is_check_access" value="1"}
115
-                                            <a href="javascript:void(0);" data-href="{:url('AdPosition/edit',array('id'=>$vo['id']))}" data-closereload="1" onclick="openFullframe(this, '编辑广告', '100%', '100%');">{$vo.title}</a>
117
+                                            <a href="javascript:void(0);" data-href="{:url('ZcPosition/edit',array('id'=>$vo['id']))}" data-closereload="1" onclick="openFullframe(this, '编辑广告', '100%', '100%');">{$vo.title}</a>
116 118
                                         {else /}
117 119
                                             {$vo.title}
118 120
                                         {/eq}
@@ -135,25 +137,25 @@
135 137
                                 <td>
136 138
                                     <div class="tc w60">
137 139
                                         {if condition="$vo['status'] eq 1"}
138
-                                            <span class="yes" {eq name="$Think.const.CONTROLLER_NAME.'@edit'|is_check_access" value="1"}onClick="changeTableVal('ad_position','id','{$vo.id}','status',this);"{/eq} ><i class="fa fa-check-circle"></i>是</span>
140
+                                            <span class="yes" {eq name="$Think.const.CONTROLLER_NAME.'@edit'|is_check_access" value="1"}onClick="changeTableVal('zc_position','id','{$vo.id}','status',this);"{/eq} ><i class="fa fa-check-circle"></i>是</span>
139 141
                                         {else /}
140
-                                            <span class="no" {eq name="$Think.const.CONTROLLER_NAME.'@edit'|is_check_access" value="1"}onClick="changeTableVal('ad_position','id','{$vo.id}','status',this);"{/eq} ><i class="fa fa-ban"></i>否</span>
142
+                                            <span class="no" {eq name="$Think.const.CONTROLLER_NAME.'@edit'|is_check_access" value="1"}onClick="changeTableVal('zc_position','id','{$vo.id}','status',this);"{/eq} ><i class="fa fa-ban"></i>否</span>
141 143
                                         {/if}
142 144
                                     </div>
143 145
                                 </td>
144 146
                                 <td class="operation">
145 147
                                     <div class="w180 tc">
146 148
                                         {eq name="$Think.const.CONTROLLER_NAME.'@edit'|is_check_access" value="1"}
147
-                                            <a href="javascript:void(0);" data-href="{:url('AdPosition/edit',array('id'=>$vo['id']))}" data-closereload="1" class="btn blue" onclick="openFullframe(this, '编辑广告', '100%', '100%');">编辑</a> <i></i>
149
+                                            <a href="javascript:void(0);" data-href="{:url('ZcPosition/edit',array('id'=>$vo['id']))}" data-closereload="1" class="btn blue" onclick="openFullframe(this, '编辑职称', '100%', '100%');">编辑</a> <i></i>
148 150
                                         {/eq}
149 151
 
150 152
                                         {if condition="$main_lang == $admin_lang || !empty($global['language_split'])"}
151 153
                                             {eq name="$Think.const.CONTROLLER_NAME.'@del'|is_check_access" value="1"}
152
-                                                <a class="btn red"  href="javascript:void(0);" data-url="{:url('AdPosition/del')}" data-id="{$vo.id}" onClick="delfun(this);">删除</a>
153
-                                            {/eq} <i></i>
154
+                                                <a class="btn red"  href="javascript:void(0);" data-url="{:url('ZcPosition/del')}" data-id="{$vo.id}" onClick="delfun(this);">删除</a>
155
+                                            {/eq} <!--<i></i>-->
154 156
                                         {/if}
155 157
     									
156
-                                        <a class="btn blue" href="javascript:void(0);" onclick="copyToClipBoard({$main_adv_list[$vo['id']]['id']|default=$vo['id']}, 1, {$vo['type']})">标签调用</a>
158
+                                       <!-- <a class="btn blue" href="javascript:void(0);" onclick="copyToClipBoard({$main_adv_list[$vo['id']]['id']|default=$vo['id']}, 1, {$vo['type']})">标签调用</a>-->
157 159
                                     </div>
158 160
                                 </td>
159 161
                             </tr>
@@ -171,7 +173,7 @@
171 173
                     <div class="fbutton checkboxall"> <input type="checkbox" class="checkAll"> </div>
172 174
                     {eq name="$Think.const.CONTROLLER_NAME.'@del'|is_check_access" value="1"}
173 175
                         <div class="fbutton">
174
-                            <a onclick="batch_del(this, 'ids');" data-url="{:url('AdPosition/del')}" class="layui-btn layui-btn-primary">批量删除</a>
176
+                            <a onclick="batch_del(this, 'ids');" data-url="{:url('ZcPosition/del')}" class="layui-btn layui-btn-primary">批量删除</a>
175 177
                         </div>
176 178
                     {/eq}
177 179
                 {/if}

Loading…
Avbryt
Spara