本文整理汇总了PHP中Fn::to_weekno方法的典型用法代码示例。如果您正苦于以下问题:PHP Fn::to_weekno方法的具体用法?PHP Fn::to_weekno怎么用?PHP Fn::to_weekno使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Fn
的用法示例。
在下文中一共展示了Fn::to_weekno方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: daily
/**
* action 'daily'
*
* @param Request $request
* @param Response $response
*/
public function daily(Request $request, Response $response)
{
$this->v->set_tplname('mod_pay_daily');
$this->v->assign('nav_second', 'daily');
if ($request->is_hashreq()) {
$searchinfo = ['start_date' => '', 'end_date' => ''];
$searchinfo['start_date'] = $request->get('sdate', '');
$searchinfo['end_date'] = $request->get('edate', '');
if (strlen($searchinfo['start_date']) != 10) {
//format: 'YYYY-MM-DD'
$searchinfo['start_date'] = '';
}
if (strlen($searchinfo['end_date']) != 10) {
//format: 'YYYY-MM-DD'
$searchinfo['end_date'] = '';
}
if (!empty($searchinfo['start_date']) && !empty($searchinfo['end_date']) && $searchinfo['start_date'] > $searchinfo['end_date']) {
//交换
$t = $searchinfo['start_date'];
$searchinfo['start_date'] = $searchinfo['end_date'];
$searchinfo['end_date'] = $t;
}
$searchstr = 'sdate=' . $searchinfo['start_date'] . '&edate=' . $searchinfo['end_date'];
$this->v->assign('searchinfo', $searchinfo);
$this->v->assign('searchstr', $searchstr);
//BEGIN list order
$orderinfo = $this->v->set_listorder('datetime', 'desc');
$extraurl = $searchstr . '&';
$extraurl .= $orderinfo[2];
$this->v->assign('extraurl', $extraurl);
$this->v->assign('qparturl', '#/pay/daily');
//END list order
// 查数据之前先更新数据
Pay_Model::updateDailyPay();
// Record List
$limit = 30;
$recordList = Pay_Model::getDailyPayList($orderinfo[0], $orderinfo[1], $limit, $searchinfo, $statinfo);
$recordNum = count($recordList);
$totalNum = $GLOBALS['pager_totalrecord_arr'][0];
// 获取最大单日充值数
$maxpay = Pay_Model::getMaxDayPay();
if ($recordNum) {
foreach ($recordList as &$it) {
$it['amount_len'] = 0;
$it['weekno'] = Fn::to_weekno(date('w', strtotime($it['datetime'] . DAY_BEGIN)));
//$it['weekno'] = date('w',strtotime($it['datetime'].DAY_BEGIN));
if ($maxpay) {
$it['amount_len'] = round($it['amount'] * 100 * 3 / $maxpay);
}
}
//$statinfo['totalpay_len'] = round($statinfo['total_pay']*100*2/$maxpay);
}
$this->v->assign('recordList', $recordList)->assign('recordNum', $recordNum)->assign('totalNum', $totalNum)->assign('statinfo', $statinfo)->assign('today', date('Y-m-d'));
}
$response->send($this->v);
}