chengkun
2025-05-22 1a8aea45ebb1582c9f65d9e8dcd520002f83ae12
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
<?php
 
 
 
class ad_order_controller extends company
{
    /*
    查看广告订单列表页面
    **/
    function index_action()
    {
 
        $this->public_action();
        $this->company_satic();
 
        $urlarr     =   array("c" => "ad_order", "page" => "{{page}}");
        $pageurl    =   Url('member', $urlarr);
 
        $where['comid'] =   $this->uid;
 
        $pageM  =   $this->MODEL('page');
        $pages  =   $pageM->pageList('ad_order', $where, $pageurl, $_GET['page']);
 
        if ($pages['total'] > 0) {
 
            $where['limit'] =   $pages['limit'];
 
            $adM            =   $this->MODEL('ad');
            $rows           =   $adM->getAdOrderList($where, array('utype' => 'order', 'uid' => $this->uid));
 
            $this->yunset('rows', $rows['list']);
        }
        $this->com_tpl('ad_order');
    }
    /*
    删除广告订单
    **/
    function del_action()
    {
 
        if ($_GET['id']) {
 
            $adM    =   $this->MODEL('ad');
 
            $adM->delAdOrder(array('id' => (int)$_GET['id'], 'comid' => $this->uid));
            $this->MODEL('log')->addMemberLog($this->uid, 2, "删除广告订单", 88, 3);//会员日志
            $this->layer_msg('删除成功!', 9, 0, $_SERVER['HTTP_REFERER']);
        }
    }
    /*
    查看广告订单详情
    **/
    function look_action()
    {
 
        $this->public_action();
 
        $adM    =   $this->MODEL('ad');
        $info   =   $adM->getAdOrderInfo(array('id' => (int)$_GET['id'], 'comid' => $this->uid), array('utype' => 'order', 'uid' => $this->uid));
 
        if ($info['status'] == 1) {
 
            $ad     =   $adM->getInfo(array('id' => $info['ad_id']));
            $start  =   @strtotime($ad['time_start']);
            $end    =   @strtotime($ad['time_end'] . " 23:59:59");
            $time   =   time();
 
            if ($ad['time_start'] != "" && $start != "" && ($ad['time_end'] == "" || $end != "")) {
                if ($ad['time_end'] == "" || $end > $time) {
                    if ($ad['is_open'] == '1' && $start < $time) {
 
                        $ad['type'] =   "<font color='green'>使用中..</font>";
                    } else if ($start < $time && $ad['is_open'] == '0') {
 
                        $ad['type'] =   "<font color='red'>已停用</font>";
                    } elseif ($start > $time && ($end > $time || $ad['time'] == "")) {
 
                        $ad['type'] =   "<font color='#ff6600'>广告暂未开始</font>";
                    }
                } else {
 
                    $ad['type']     =   "<font color='red'>过期广告</font>";
                }
            } else {
 
                $ad['type']         =   "<font color='red'>无效广告</font>";
            }
        } elseif ($info['status'] == 2) {
 
            $ad['type']             =   "<font color='red'>已退回</font>";
        } else {
 
            $ad['type']             =   "<font color='red'>未审核</font>";
        }
        $this->yunset("info", $info);
        $this->yunset("ad", $ad);
        $this->com_tpl('ad_detail');
    }
}
 
?>