当前位置: 首页>>代码示例>>PHP>>正文


PHP Listing::model方法代码示例

本文整理汇总了PHP中Listing::model方法的典型用法代码示例。如果您正苦于以下问题:PHP Listing::model方法的具体用法?PHP Listing::model怎么用?PHP Listing::model使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Listing的用法示例。


在下文中一共展示了Listing::model方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: run

 public function run()
 {
     $box = Pages::getPageById(PAGE_PROPERTY_BOX);
     $model = new ProEnquiryProperty();
     $mListing = Listing::model()->findByPk($this->property_id);
     //        echo $mListing->property_name_or_address;die;
     Listing::ReplaceContentCmsPage($box, $mListing);
     $model->country_id = ActiveRecord::getDefaultAreaCode();
     if (isset(Yii::app()->user->id)) {
         $model->name = Yii::app()->user->title . ' ' . Yii::app()->user->first_name . ' ' . Yii::app()->user->last_name;
         $model->email = Yii::app()->user->email;
         if (Yii::app()->user->role_id != ROLE_REGISTER_MEMBER) {
             $model->email = Yii::app()->user->email_not_login;
         }
         $model->phone = Yii::app()->user->phone;
         $model->country_id = Yii::app()->user->country;
     }
     $this->dir = Yii::getPathOfAlias('application.components.views') . '/_agent_detail.php';
     $model->description = trim(strip_tags($box->content));
     if ($this->position == "bottom") {
         $this->render("enquiry_bottom", array('model' => $model, 'box' => $box, 'property_id' => $this->property_id, 'agent_id' => $this->agent_id, 'dir' => $this->dir, 'position' => 'bottom'));
     } else {
         $this->render("enquiry_right", array('model' => $model, 'box' => $box, 'property_id' => $this->property_id, 'agent_id' => $this->agent_id, 'dir' => $this->dir, 'position' => 'right'));
     }
 }
开发者ID:jasonhai,项目名称:onehome,代码行数:25,代码来源:EnquiryProperty.php

示例2: getListingCount

 public function getListingCount()
 {
     $criteria = new CDbCriteria();
     $criteria->compare('user_id', $this->id);
     $criteria->compare('status', STATUS_ACTIVE);
     $criteria->compare('status_listing', STATUS_LISTING_ACTIVE);
     return Listing::model()->count($criteria);
 }
开发者ID:jasonhai,项目名称:onehome,代码行数:8,代码来源:ProAgent.php

示例3: run

 public function run()
 {
     $listingInfo = Listing::model()->findByPk($this->listing_id);
     if ($listingInfo) {
         $this->listing_title = $listingInfo->property_name_or_address;
     }
     $model = $this->searchReleatedListing();
     $this->render("listing_releated_page_thank_you/index", array('model' => $model));
 }
开发者ID:jasonhai,项目名称:onehome,代码行数:9,代码来源:ListingReleatedOnPageThankYouWidget.php

示例4: actionSearch

 public function actionSearch($searchtext = '')
 {
     if ($searchtext == '') {
         $this->actionIndex(0);
         return;
     }
     $categories = array();
     $listings = Listing::model()->searchFrontendListings($searchtext);
     ViewsTrack::addCategoryView(0);
     $this->render('index', array('categories' => $categories, 'listings' => $listings));
 }
开发者ID:yasirgit,项目名称:hotmall,代码行数:11,代码来源:SiteController.php

示例5: actionCreate

 /**
  * Creates a new model.
  * If creation is successful, the browser will be redirected to the 'view' page.
  */
 public function actionCreate($id)
 {
     if (!empty($id) && !Yii::app()->user->isGuest) {
         $user_email = Yii::app()->user->name;
         $userModel = User::model()->findByAttributes(array('user_email' => $user_email));
         $listingId = $id;
         $listingModel = Listing::model()->findByPk($listingId);
         $model = new Booking();
         $model->booking_listing_id = $listingModel->listing_id;
         $model->booking_user_id = $userModel->user_id;
         $model->booking_amount = $listingModel->listing_price;
         if ($model->save()) {
             $this->redirect(array('view', 'id' => $model->booking_id));
         }
     } else {
         echo "Booking failed";
     }
 }
开发者ID:pmswamy,项目名称:training1demo,代码行数:22,代码来源:BookingController.php

示例6: CHttpException

     $model = ListingCompany::model()->findByPk($id);
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }
 public function actionFieldClick($id, $field)
 {
     $model = Listing::model()->findByPk($id);
     if (!$model || !in_array($field, array('owner_contact'))) {
         throw new CHttpException(403, 'Permission denied.');
     }
     $lc = ListingClick::model()->findByAttributes(array('listing_id' => $id, 'user_id' => Yii::app()->user->id, 'field' => $field));
     if (!$lc) {
         $lc = new ListingClick();
         $lc->listing_id = $id;
         $lc->user_id = Yii::app()->user->id;
         $lc->field = $field;
         $lc->save();
开发者ID:jasonhai,项目名称:onehome,代码行数:19,代码来源:CompanyController.php

示例7: actionSearch

 public function actionSearch()
 {
     $this->checkRequest();
     $q = $this->q;
     $this->checkRequiredParams($q, array('token', 'user_id', 'status', 'type', 'page'));
     $this->checkToken();
     //same as login session
     $criteria = new CDbCriteria();
     $criteria->compare('user_id', $q->user_id);
     $criteria->compare('status_listing', $q->status);
     $criteria->compare('listing_type', $q->type);
     $criteria->limit = 20;
     $criteria->order = 'property_name_or_address ASC';
     $models = Listing::model()->findAll($criteria);
     $items = array();
     foreach ($models as $model) {
         $items[] = array('property_name_or_address' => $model->property_name_or_address, 'tenure' => Listing::getViewDetailTenure($model));
     }
     $result = ApiModule::$defaultSuccessResponse;
     $result['list'] = $items;
     $result['message'] = Yii::t('systemmsg', 'Query success');
     //always need
     ApiModule::sendResponse($result);
 }
开发者ID:jasonhai,项目名称:onehome,代码行数:24,代码来源:ListingsController.php

示例8: actionTake_off

 public function actionTake_off($listing)
 {
     $model = Listing::model()->findByAttributes(array('id' => $listing, 'user_id' => $this->userID));
     if ($model) {
         $model->take_off = 1;
         $model->take_off_content = isset($_GET['takeOff']) ? strip_tags($_GET['takeOff']) : NULL;
         //            $model->status_listing = STATUS_LISTING_PAST;
         $model->status_listing = STATUS_LISTING_PENDING;
         $model->save();
     }
 }
开发者ID:jasonhai,项目名称:onehome,代码行数:11,代码来源:ListingController.php

示例9: getListingOrRenderError

 private function getListingOrRenderError($id)
 {
     $id = $this->checkCorrectness($id);
     if ($id != 0) {
         $listing = Listing::model()->getFrontendListing($id);
     } else {
         $listing = null;
     }
     if ($id == 0 || $listing == null) {
         $this->render('missing_listing');
         return null;
     }
     return $listing;
 }
开发者ID:yasirgit,项目名称:hotmall,代码行数:14,代码来源:ListingController.php

示例10: actionDeleteappeal

     $appeal = '';
     if (isset(Yii::app()->session['LOGGED_USER'])) {
         $userCurent = Yii::app()->session['LOGGED_USER'];
         if (isset($userCurent->role_id) && $userCurent->role_id <= ROLE_ADMIN) {
             $role_id = $userCurent->role_id;
         }
     }
     $appeal = new ProListingApeal();
     $appeal->listing_id = $model->id;
     $this->render('listing/appeal', array('model' => $model, 'role_id' => $role_id, 'appeal' => $appeal));
 }
 public function actionDeleteappeal($id)
 {
     $appeal = ProListingApeal::model()->findByPk($id);
     if ($appeal) {
         if ($appeal->delete()) {
             @unlink(YII_UPLOAD_DIR . '/listing/' . $appeal->listing_id . '/appeal/' . $appeal->file);
         }
     }
 }
 public function actionSeachmap()
 {
     $this->layout = false;
     $this->render('listing/map');
 }
 public function actionSeachmap2()
 {
     $this->layout = false;
     $this->render('listing/map2');
开发者ID:jasonhai,项目名称:onehome,代码行数:29,代码来源:AjaxController.php

示例11: getTotalWithUser

 public static function getTotalWithUser($userID)
 {
     $arrListing = CHtml::listData(Listing::model()->findAllByAttributes(array('user_id' => $userID)), 'id', 'id');
     if (count($arrListing) > 0) {
         $criteria = new CDbCriteria();
         $criteria->compare('property_id', $arrListing);
         $criteria->compare('status', ENQUIRY_PROPERTY_NEW);
         $total = ProEnquiryProperty::model()->count($criteria);
         return $total;
     }
     return 0;
 }
开发者ID:jasonhai,项目名称:onehome,代码行数:12,代码来源:ProEnquiryProperty.php

示例12: OverideModel

 public function OverideModel($model)
 {
     if (isset(Yii::app()->user->id)) {
         $cmsFormater = new CmsFormatter();
         $mUser = Users::model()->findByPk(Yii::app()->user->id);
         $model->fullname = $cmsFormater->formatFullNameRegisteredUsers($mUser);
         $model->nric = $mUser->nric_passportno_roc;
         $model->contact_no = $mUser->phone;
         $model->email = $mUser->email;
         if (Yii::app()->user->role_id == ROLE_LANDLORD || Yii::app()->user->role_id == ROLE_TENANT) {
             $model->contact_no = $mUser->contact_no;
             $model->email = $mUser->email_not_login;
         }
         if (Yii::app()->user->role_id == ROLE_AGENT) {
             $model->email = $mUser->email_not_login;
         }
     }
     $mTrans = ProTransactions::model()->findByPk($model->transaction_id);
     if (is_null($mTrans)) {
         return;
     }
     $mListing = Listing::model()->findByPk($mTrans->listing_id);
     if (is_null($mListing)) {
         return;
     }
     $model->property_name_or_address = $mListing->property_name_or_address;
     $model->unit_from = $mListing->unit_from;
     $model->unit_to = $mListing->unit_to;
     $model->postal_code = $mListing->postal_code;
     $model->location_id = $mListing->location_id;
     $model->property_type_id = $mListing->property_type_1;
     $model->tenure = $mListing->tenure;
     $model->floor_area = $mListing->floor_area;
     $model->of_bedroom_from = $mListing->of_bedroom;
     $model->of_bathrooms_from = $mListing->of_bathrooms;
 }
开发者ID:jasonhai,项目名称:onehome,代码行数:36,代码来源:LandlordController.php

示例13: loadModel

 /**
  * Returns the data model based on the primary key given in the GET variable.
  * If the data model is not found, an HTTP exception will be raised.
  * @param integer $id the ID of the model to be loaded
  * @return Listing the loaded model
  * @throws CHttpException
  */
 public function loadModel($id)
 {
     $model = Listing::model()->findByPk($id);
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }
开发者ID:pmswamy,项目名称:Training1,代码行数:15,代码来源:ListingController.php

示例14: getCurrentResourceAmount

 /**
  * function returns current number of resources (listings, etc.) per given type and advertiser 
  */
 public function getCurrentResourceAmount($resourceType, $advertiserId)
 {
     $criteria = new CDbCriteria();
     if ($resourceType == PlanResourceType::RTYPE_LISTINGS_PER_ADVERTISER) {
         if ($advertiserId == '') {
             return 0;
         }
         $criteria->compare('t.advertiser_id', $advertiserId);
         return Listing::model()->count($criteria);
     } else {
         if ($resourceType == PlanResourceType::RTYPE_FEATURED_LISTINGS_PER_ADVERTISER) {
             if ($advertiserId == '') {
                 return 0;
             }
             $criteria->compare('t.advertiser_id', $advertiserId);
             $criteria->compare('t.type', ListingType::TYPE_FEATURED);
             return Listing::model()->count($criteria);
         } else {
             if ($resourceType == PlanResourceType::RTYPE_PREMIUMAD_PER_ADVERTISER) {
                 if ($advertiserId == '') {
                     return 0;
                 }
                 $criteria->compare('t.advertiser_id', $advertiserId);
                 return PremiumAd::model()->count($criteria);
             } else {
                 if ($resourceType == PlanResourceType::RTYPE_LOCATIONS_PER_ACCOUNT) {
                     $criteria->compare('t.wlabel_id', Yii::app()->user->getWhiteLabelId());
                     return Location::model()->count($criteria);
                 }
             }
         }
     }
     return null;
 }
开发者ID:yasirgit,项目名称:hotmall,代码行数:37,代码来源:PlanRestriction.php

示例15: getUrlListing

 /**
  * @Author: ANH DUNG May 06, 2014
  * @Todo: get url page view detail listing at FE
  * @Param: $listing_id
  * @Return: string url dạng Yii::app()->createAbsoluteUrl('/')
  * MyFunctionCustom::getUrlListing($listing_id);
  */
 public static function getUrlListing($listing_id)
 {
     $model = Listing::model()->findByPk($listing_id);
     if ($model) {
         return Yii::app()->createAbsoluteUrl('site/listingdetail', array('slug' => $model->slug));
     }
     return "";
 }
开发者ID:jasonhai,项目名称:onehome,代码行数:15,代码来源:MyFunctionCustom.php


注:本文中的Listing::model方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。