作者 sgj
1 个管道 的构建 通过 耗费 1 秒

change appidsecritp

... ... @@ -191,7 +191,8 @@ class AesController extends HomeBaseController{
* @return message:错误类型
* @return error:错误描述
*/
public function state($users_id,$name,$key,$type){
public function
state($users_id,$name,$key,$type){
$key=$this->ToArray($key);
if ($type==1){
//判断命令是否合法
... ...
... ... @@ -117,7 +117,9 @@ class OrderController extends HomeBaseController{
$cost=Db::name('cost')->where('id',1)->find();
$interval = Db::name('interval')->where('id',1)->find();
$is_free=Db::name('users')->where('id',$users_id)->find()['is_free'];
//一小时免费状态
$free=$cost['free'];
//获取整天的价格
$dayPrice=$this->getDayPrice();
... ... @@ -181,7 +183,7 @@ class OrderController extends HomeBaseController{
$YesterdayEndTime=$endTime-86400;
//昨天预设结束前使用,今天预设结束前停止
if(($new_start_time > (strtotime('00:00:00')-86400) && $new_start_time < $YesterdayEndTime) && ($new_end_time > strtotime('00:00:00') && $new_end_time < $endTime)){
echo 1;
$price+= ceil(($YesterdayEndTime-$new_start_time)/3600) * $interval['price']
+ceil(($YesterdayStateTime-$YesterdayEndTime)/3600) * $cost['cost']
+ceil(($new_end_time-$YesterdayStateTime)/3600) * $interval['price'];
... ... @@ -189,7 +191,7 @@ class OrderController extends HomeBaseController{
//昨天预设开始前使用,今天预设结束前停止
if(($new_start_time > $YesterdayEndTime && $new_start_time < $YesterdayStateTime) && ($new_end_time > strtotime('00:00:00') && $new_end_time < $endTime)){
//存在首小时免费
echo 1;
$price+= ceil(($YesterdayStateTime-$new_start_time)/3600) * $cost['cost']
+ceil(($new_end_time-$YesterdayStateTime)/3600) * $interval['price'];
if ($free==1 && $is_free==0){
... ... @@ -200,7 +202,7 @@ class OrderController extends HomeBaseController{
//昨天预设开始前使用,今天预设结束后停止
if(($new_start_time > $YesterdayEndTime && $new_start_time < $YesterdayStateTime) && ($new_end_time > $endTime && $new_end_time < $stateTime)){
//存在首小时免费
echo 1;
$price+= ceil(($YesterdayStateTime-$new_start_time)/3600) * $cost['cost']
+ceil(($endTime-$YesterdayStateTime)/3600) * $interval['price']
+ceil(($new_end_time-$endTime)/3600) * $cost['cost'];
... ... @@ -211,18 +213,18 @@ class OrderController extends HomeBaseController{
}
//昨天预设开始后使用,今天预设结束前停止
if(($new_start_time > $YesterdayStateTime && $new_start_time < strtotime('00:00:00')) && ($new_end_time > strtotime('00:00:00') && $new_end_time < $endTime)){
echo 1;
$price+= ceil(($new_end_time-$new_start_time)/3600) * $interval['price'];
}
//昨天预设开始后使用,今天预设结束后停止
if(($new_start_time > $YesterdayStateTime && $new_start_time < strtotime('00:00:00')) && ($new_end_time > $endTime && $new_end_time < $stateTime)){
echo 1;
$price+= ceil(($endTime-$new_start_time)/3600) * $interval['price']
+ceil(($new_end_time-$endTime)/3600) * $cost['cost'];
}
//昨天预设开始后使用,今天预设开始前停止
if(($new_start_time > $YesterdayStateTime && $new_start_time < strtotime('00:00:00')) && ($new_end_time > $stateTime && $new_end_time < ($new_start_time+86400))){
echo 1;
$price+= ceil(($endTime-$new_start_time)/3600) * $interval['price']
+ceil(($stateTime-$endTime)/3600) * $cost['cost']
+ceil(($new_end_time-$stateTime)/3600) * $interval['price'];
... ...