Exemple #1
0
 function getList(Request $request, &$cond = [])
 {
     $count_per_page = $this->count_per_page->is_exists() ? max(1, $this->count_per_page->value()) : 10;
     $cond['limit'] = [($request['REQUEST']['page'] - 1) * $count_per_page, $count_per_page];
     $result = parent::getList($request, $cond);
     if (count($result) < $count_per_page) {
         $count = $request['REQUEST']['page'];
     } else {
         $count = ceil(Data::find(Data::unionCond(['calc' => 'count'], $cond)) / $count_per_page);
     }
     $request->mix(['REQUEST' => ['page_count' => $count]]);
     return $result;
 }
Exemple #2
0
 function show($v, Request $request)
 {
     return parent::show($v, $request);
 }
Exemple #3
0
 function show($v, Request $request)
 {
     $v['object'] = $request['REQUEST']['object'];
     $v['title'] = $this->title->inner()->value();
     $v['result'] = $this->_result;
     if ($this->_result == self::FORM_RESULT_ERROR) {
         $v['message'] = 'Ошибки при проверки формы';
         //$this->message_error->inner()->value();
     } else {
         if ($this->_result == self::FORM_RESULT_OK) {
             $v['message'] = 'Успешное сохранение';
             //$this->message_ok->inner()->value();
         }
     }
     /** @var Entity $obj */
     //        $obj = $request['REQUEST']['object'];
     //        if ($obj->is_exists()){
     //            $v['object'] = $obj->uri();
     //        }else{
     //            $v['object'] = array();
     //            if ($p = $obj->proto()) $v['object']['proto'] = $p;
     //            if ($p = $obj->parent()) $v['object']['parent'] = $p;
     //            $v['object'] = F::toJSON($v['object'], false);
     //        }
     return parent::show($v, $request);
 }