作者 耿培杰

修改购物车接口

... ... @@ -203,10 +203,7 @@ function wpjam_array_push($array, $data=null, $key=false){
}
}
if (!function_exists('cal_days_in_month'))
{
function cal_days_in_month($calendar, $month, $year)
{
return date('t', mktime(0, 0, 0, $month, 1, $year));
}
function days_in_month($month, $year) {
// calculate number of days in a month
return $month == 2 ? ($year % 4 ? 28 : ($year % 100 ? 29 : ($year % 400 ? 28 : 29))) : (($month - 1) % 7 % 2 ? 30 : 31);
}
\ No newline at end of file
... ...
... ... @@ -212,7 +212,7 @@ class Member extends Api
$betweenTime = ['1970-1-1', date('Y-m-d')];
if ($date) {
$dateArr = explode('-', $date);
$lastDay = cal_days_in_month(CAL_GREGORIAN, $dateArr[1], $dateArr[0]);
$lastDay = days_in_month( $dateArr[1], $dateArr[0]);
$lastDate = $dateArr[0] . '-' . $dateArr[1] . '-' . $lastDay;
$betweenTime = [$date, $lastDate];
}
... ...