コード例 #1
0
ファイル: CmsFeedback.php プロジェクト: zwq/unpei
    /**
	 * @return array customized attribute labels (name=>label)
	 */
    public function attributeLabels()
    {
        return array('ID' => 'ID', 'Name' => '名字', 'Tel' => '电话', 'Email' => 'Email', 'Content' => '内容', 'Reply' => '回复', 'CreateTime' => '发布时间', 'UpdateTime' => '更新时间');
    }
    /**
	 * Retrieves a list of models based on the current search/filter conditions.
	 * @return CActiveDataProvider the data provider that can return the models based on the search/filter conditions.
	 */
    public function search()
    {
コード例 #2
0
ファイル: CmsArticle.php プロジェクト: zwq/unpei
 public function beforeSave()
 {
     if (parent::beforeSave()) {
         if ($this->isNewRecord) {
             $this->CreateTime = $this->UpdateTime = time();
             $this->AuthorID = Yii::app()->user->id;
         } else {
             $this->UpdateTime = time();
         }
         return true;
     } else {
         return false;
     }
 }
コード例 #3
0
ファイル: Make.php プロジェクト: zwq/unpei
 /**
  * Returns the static model of the specified AR class.
  * Please note that you should have this exact method in all your CActiveRecord descendants!
  * @param string $className active record class name.
  * @return Make the static model class
  */
 public static function model($className = __CLASS__)
 {
     return parent::model($className);
 }
コード例 #4
0
ファイル: EpcModelTemp.php プロジェクト: zwq/unpei
 public function afterFind()
 {
     parent::afterFind();
     // 修改时间格式
     //if(self::model()->scenario == 'list') {
     $this->setAttribute('GreateTime', date('Y-m-d H:i:s', $this->getAttribute('createTime')));
     $this->setAttribute('UpdateTime', date('Y-m-d H:i:s', $this->getAttribute('updateTime')));
     $status = $this->getAttribute('status');
     $this->setAttribute('Status', $status == '0' ? '待审核' : ($status == '1' ? '审核通过' : ($status == '2' ? '审核未通过' : '其他')));
     //}
 }
コード例 #5
0
ファイル: Contacts.php プロジェクト: zwq/unpei
 protected function beforeSave()
 {
     if (parent::beforeSave()) {
         if ($this->isNewRecord) {
             $this->CreateTime = time();
             $this->UpdateTime = time();
             $this->OrganID = Yii::app()->user->getOrganID();
         } else {
             $this->CreateTime = time();
             $this->UpdateTime = time();
             $this->OrganID = Yii::app()->user->getOrganID();
         }
         return true;
     } else {
         return false;
     }
 }