Banner::getStatus PHP Method

getStatus() public method

public getStatus ( )
    public function getStatus()
    {
        if ($this->status == self::STATUS_DISABLED) {
            return Yii::t('common', 'Disabled');
        } else {
            return Yii::t('common', 'Enabled');
        }
    }

Usage Example

コード例 #1
0
 /**
  * 返回广告列表
  * @access public
  */
 function ads()
 {
     $field = array('banner_id', 'img_path', 'created', 'start_time', 'end_time', 'title', 'status', 'orders', 'language', 'created_name', 'audit_name');
     $m = new Banner();
     $m->clear();
     $m->setField($field);
     $m->setTable('vcb_index_banner2');
     //$m->setWhere('status', '!=', '60000');//暂不设置
     if ($type != '') {
         $m->setWhere('type', '=', $type);
     }
     if ($language != '') {
         $m->setWhere('language', '=', $language);
     }
     if ($key != '') {
         $m->setWhere('title', 'LIKE', '%' . $key . '%');
     }
     $m->setOrderBy('orders');
     $data = $m->select();
     //状态标题    在每一条数据后加上4个数据
     $count = count($data);
     for ($i = 0; $i < $count; $i++) {
         $data[$i]['status_cn'] = $m->getStatus('cn', $data[$i]['status']);
         $data[$i]['status_th'] = $m->getStatus('th', $data[$i]['status']);
     }
     //print_r($data) ;
     $this->assign('data', $data);
 }
All Usage Examples Of Banner::getStatus