Example #1
0
 protected function _initParams(RM_Total_Object $object)
 {
     $params = array();
     $params['table_name'] = $object->tableName();
     $params['detail_level'] = $object->detailLevel()->getTableSuffix();
     $params['detail_level_id'] = $object->detailLevel()->getFieldNameWithId();
     $params['period'] = $object->period()->getTableSuffix();
     $params['category'] = $object->category()->categoryId();
     $params['datail_level_unique'] = $object->detailLevel()->uniqSequence();
     $params['datail_level_unique_names'] = $object->detailLevel()->uniqSequence(TRUE);
     $sumVariabes = $variables = array();
     foreach (M('ReportValue')->getCountableValuesList()->filter('disabled is null') as $item) {
         $sum = 'sum(' . $item->getVarname() . ')';
         $variables[] = $item->getVarname();
         $sumVariabes[] = $item->noAggregate() ? 'if(' . $object->detailLevel()->getFieldNameWithId() . '=0, NULL , ' . $sum . ')' : $sum;
     }
     if (!count($variables)) {
         $res = M('Base')->error('no_variable_choosed');
         throw new RM_Base_Exception_Result($res);
     }
     $params['param_names'] = join(',', $variables);
     $params['sum_params'] = join(',', $sumVariabes);
     return $params;
 }
Example #2
0
 public function getRowCaption($row)
 {
     return $this->_object->getRowCaption($row);
 }
Example #3
0
 /**
  *	Description...
  *
  *	@return void
  **/
 public function collectLostImage(RM_Total_Object $object)
 {
     $request = $object->getAllImages();
     foreach ($object->values() as $item) {
         if ($item->image_id) {
             $request->filter('id!=?', $item->image_id);
         }
     }
     return $request;
 }