本文整理匯總了PHP中Price::total方法的典型用法代碼示例。如果您正苦於以下問題:PHP Price::total方法的具體用法?PHP Price::total怎麽用?PHP Price::total使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Price
的用法示例。
在下文中一共展示了Price::total方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: exit
<?php
!defined('IN_PTF') && exit('ILLEGAL EXECUTION');
/**
* @author ryan <cumt.xiaochi@gmail.com>
*/
switch ($target) {
case 'gold_price':
$time_start = _get('time_start');
$time_end = _get('time_end');
$type = _get('type');
$material_types = $config['material_type_map'];
$p = _get('p') ?: 1;
$per_page = 50;
$total = Price::total($type);
$paging = new Paginate($per_page, $total);
$paging->setCurPage($p);
$prices = Price::history(array('type' => $type, 'limit' => $per_page, 'offset' => $paging->offset()));
break;
case 'sale':
$divide = _get('divide') ?: 'day';
// day or month
$format_map = array('day' => 'Y年m月d日', 'month' => 'Y年m月');
$data = Statistics::saleRecord(compact('divide'));
$date = new DateTime();
$format = $format_map[$divide];
$date->sub(DateInterval::createFromDateString("1 {$divide}"));
$end = $date->format($format);
$date->sub(DateInterval::createFromDateString("59 {$divide}"));
$start = $date->format($format);
break;