您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 
 
 
 

50 行
1.1 KiB

  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: wangxj
  5. * Date: 2017/7/31
  6. * Time: 13:26
  7. */
  8. namespace common\components;
  9. use kartik\grid\DataColumn;
  10. use yii\db\ActiveQuery;
  11. /**
  12. * Class zDataColumn
  13. *
  14. * @property bool|array $pagerButtons
  15. * @property ActiveQuery $query
  16. */
  17. class zDataColumn extends DataColumn
  18. {
  19. public $query;
  20. protected function getPageSummaryCellContent()
  21. {
  22. $this->filterWidgetOptions;
  23. if ($this->pageSummary === true || $this->pageSummary instanceof \Closure) {
  24. if($this->attribute != null){
  25. $query = $this->query;
  26. $query->orderBy(false);
  27. $summary = $this->query->sum($this->attribute);
  28. }
  29. else
  30. $summary = $this->calculateSummary();
  31. return ($this->pageSummary === true) ? $summary : call_user_func(
  32. $this->pageSummary,
  33. $summary,
  34. $this->_rows,
  35. $this
  36. );
  37. }
  38. if ($this->pageSummary !== false) {
  39. return $this->pageSummary;
  40. }
  41. return null;
  42. }
  43. }