chengkun
2025-05-26 8f3df543230cd4403368b39b9bbe5726d11a0284
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
<?php
 
class comproduct_controller extends adminCommon{ 
    function index_action(){ 
        $CompanyM        =    $this -> MODEL('company');
        $where            =    array();
        if ($_GET['status']) {
            $status        =    intval($_GET['status']);
            $where['status']    =    $status==3 ? 0 : $status;
            $urlarr['status']    =    $status;
        }
        $urlarr['c']    =    $_GET['c'];
        $urlarr['page']    =    "{{page}}";
        $pageurl        =    Url($_GET['m'],$urlarr,'admin');
        $pageM    =    $this -> MODEL('page');
        $pages    =    $pageM -> pageList('company_product',$where,$pageurl,$_GET['page']);
        if($pages['total'] > 0){
            $where['orderby']    =    'id';
            $where['limit']        =    $pages['limit'];
            $rows                =    $CompanyM -> getCompanyProductList($where);
        }
        $this->yunset("rows",$rows); 
        $this->yunset("headertitle","企业产品");
        $this->yuntpl(array('wapadmin/admin_comproduct'));
    }  
    function show_action(){
        $CompanyM    =    $this -> MODEL('company');
        $row        =    $CompanyM -> getComProductInfo(array('id'=>intval($_GET['id'])));
        $com        =    $CompanyM -> getInfo($row['uid'],array('field'=>'`name`'));
        $row['name']=    $com['name'];
        $this->yunset('row',$row);
        $this->yunset("headertitle","企业产品");
        $this->yuntpl(array('wapadmin/admin_comproduct_show'));
    }
    function status_action(){    
        $CompanyM    =    $this -> MODEL('company');
        if($_POST['id']){
            $statusData        =    array(
                'status'        =>    intval($_POST['status']),
                'statusbody'    =>    trim($_POST['statusbody']),
            );
            $nid    =    $CompanyM -> upCompanyProductStatus(intval($_POST['id']),$statusData);
            if($nid){
                $this->layer_msg('企业产品审核成功!',9,0,"index.php?c=comproduct");
            }else{
                $this->layer_msg('企业产品审核失败!',8);
            }
        }
    }
    function del_action(){ 
        $CompanyM    =    $this -> MODEL('company');
        if(intval($_GET['id'])){
            $return    =    $CompanyM -> delCompanyProduct(intval($_GET['id']));
            if($return['errcode']==9){
                $this->layer_msg($return['msg'],$return['errcode'],$return['layertype'],"index.php?c=comproduct");
            }else{
                $this->layer_msg($return['msg'],$return['errcode'],$return['layertype'],$_SERVER['HTTP_REFERER']);
            }
        }
    } 
}
?>