本文整理汇总了PHP中DateUtil::buildDays方法的典型用法代码示例。如果您正苦于以下问题:PHP DateUtil::buildDays方法的具体用法?PHP DateUtil::buildDays怎么用?PHP DateUtil::buildDays使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DateUtil
的用法示例。
在下文中一共展示了DateUtil::buildDays方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: index
public function index($projectId)
{
$project = (new ProjectModel())->readOne($projectId + 0);
if (!$project) {
$this->message('项目不存在!');
}
$shops = (new ShopModel())->getAllShops();
$beauticians = (new BeauticianModel())->getAllBeauticians();
$days = DateUtil::buildDays();
$this->view('offline/appointment', array('beauticians' => $beauticians, 'shops' => $shops, 'days' => $days, 'project' => $project));
}
示例2: index
/**
* 展示预约页面
* 选择美容师与预约时间
* 此处要验证授权
*
* @param $shopId 店铺ID
*/
public function index($shopId)
{
$weixinUtil = new WeixinUtil();
// 验证是否已授权
$weixinUtil->authorize("appointment/index/{$shopId}");
// 获得预约项目
$projectId = (new CartUtil())->cart();
$projectId += 0;
if (!$projectId) {
$this->message('预约项目不存在!');
}
$openId = $weixinUtil->getOpenId();
if ((new ProjectPropertyModel())->projectOnlyForNewUser($projectId, $openId)) {
$this->message('此美容项目只针对新用户!');
}
//是否已经选择了店铺,并且店铺是有效的
$shops = (new ShopModel())->getAllShops();
if (is_numeric($shopId) && array_key_exists($shopId, $shops)) {
// 获得项目信息
$project = (new ProjectModel())->readOne($projectId);
if (!$project) {
$this->message('预约项目不存在!');
}
// 跳转到 选择 美容师
$beauticians = (new BeauticianModel())->getAllBeauticians();
$lastOrder = (new OrderModel())->getLastOrder($openId);
$days = DateUtil::buildDays();
$coupons = array();
if ($project['can_use_coupon']) {
// 查询优惠券
$coupons = (new CustomerCouponModel())->getCustomerNotUseCouponList($openId);
}
$this->load->view('frontend/appointment/beautician', array('beauticians' => $beauticians, 'project' => $project, 'shopId' => $shopId, 'days' => $days, 'lastOrder' => $lastOrder, 'coupons' => $coupons));
} else {
// 跳转到选择店铺
$returnUrl = urlencode(UrlUtil::createUrl('appointment/index'));
ResponseUtil::redirect(UrlUtil::createUrl("shop/index?returnUrl={$returnUrl}"));
}
}