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


PHP AppController::report方法代码示例

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


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

示例1: report

 public function report($conditions = array(), $order = null, $direcion = 'ASC')
 {
     if (!empty($this->data['Service']['client_id'])) {
         $conditions[] = array('client_id' => $this->data['Service']['client_id']);
         $this->Service->Client->recursive = -1;
         $client = $this->Service->Client->findById($this->data['Service']['client_id'], array('client_name'));
         $this->set('client', $client);
     }
     if (!empty($this->data['Service']['service_state_id'])) {
         $conditions[] = array('service_state_id' => $this->data['Service']['service_state_id']);
         $this->Service->ServiceState->recursive = -1;
         $service_state = $this->Service->ServiceState->findById($this->data['Service']['service_state_id'], array('service_state_desc'));
         $this->set('service_state', $service_state);
     }
     if (!empty($this->data['Service']['service_type_id'])) {
         $conditions[] = array('service_type_id' => $this->data['Service']['service_type_id']);
         $this->Service->ServiceType->recursive = -1;
         $service_type = $this->Service->ServiceType->findById($this->data['Service']['service_type_id'], array('service_type_desc'));
         $this->set('service_type', $service_type);
     }
     /**
      * DATES
      */
     // approval
     if (!empty($this->data['Service']['approval_date_1'])) {
         $conditions[] = array('approval_date >= ' => $this->data['Service']['approval_date_1']);
     }
     if (!empty($this->data['Service']['approval_date_2'])) {
         $conditions[] = array('approval_date <= ' => $this->data['Service']['approval_date_2']);
     }
     // expiration
     if (!empty($this->data['Service']['expiration_date_1'])) {
         $conditions[] = array('expiration_date >= ' => $this->data['Service']['expiration_date_1']);
     }
     if (!empty($this->data['Service']['expiration_date_2'])) {
         $conditions[] = array('expiration_date <= ' => $this->data['Service']['expiration_date_2']);
     }
     // payment
     if (!empty($this->data['Service']['payment_date_1'])) {
         $conditions[] = array('payment_date >= ' => $this->data['Service']['payment_date_1']);
     }
     if (!empty($this->data['Service']['payment_date_2'])) {
         $conditions[] = array('payment_date <= ' => $this->data['Service']['payment_date_2']);
     }
     // begin
     if (!empty($this->data['Service']['begin_date_1'])) {
         $conditions[] = array('begin_date >= ' => $this->data['Service']['begin_date_1']);
     }
     if (!empty($this->data['Service']['begin_date_2'])) {
         $conditions[] = array('begin_date <= ' => $this->data['Service']['begin_date_2']);
     }
     // end
     if (!empty($this->data['Service']['end_date_1'])) {
         $conditions[] = array('end_date >= ' => $this->data['Service']['end_date_1']);
     }
     if (!empty($this->data['Service']['end_date_2'])) {
         $conditions[] = array('end_date <= ' => $this->data['Service']['end_date_2']);
     }
     /**
      * VALUES
      */
     // estimated
     if (!empty($this->data['Service']['estimated_value_1'])) {
         $conditions[] = array('estimated_value >= ' => $this->data['Service']['estimated_value_1']);
     }
     if (!empty($this->data['Service']['estimated_value_2'])) {
         $conditions[] = array('estimated_value <= ' => $this->data['Service']['estimated_value_2']);
     }
     // real
     if (!empty($this->data['Service']['real_value_1'])) {
         $conditions[] = array('real_value >= ' => $this->data['Service']['real_value_1']);
     }
     if (!empty($this->data['Service']['real_value_2'])) {
         $conditions[] = array('real_value <= ' => $this->data['Service']['real_value_2']);
     }
     // discount
     if (!empty($this->data['Service']['discount_value_1'])) {
         $conditions[] = array('discount_value >= ' => $this->data['Service']['discount_value_1']);
     }
     if (!empty($this->data['Service']['discount_value_2'])) {
         $conditions[] = array('discount_value <= ' => $this->data['Service']['discount_value_2']);
     }
     // paid
     if (!empty($this->data['Service']['paid_value_1'])) {
         $conditions[] = array('paid_value >= ' => $this->data['Service']['paid_value_1']);
     }
     if (!empty($this->data['Service']['paid_value_2'])) {
         $conditions[] = array('paid_value <= ' => $this->data['Service']['paid_value_2']);
     }
     parent::report($conditions, $order, $direcion);
 }
开发者ID:abhinand4858,项目名称:ProgrammedV,代码行数:91,代码来源:ServicesController.php


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