6 changed files with 573 additions and 450 deletions
@ -1,322 +1,322 @@ |
|||||
<?php |
<?php |
||||
|
|
||||
|
|
||||
require_once '../../workflow/lib/DB.php'; |
require_once '../../workflow/lib/DB.php'; |
||||
class MSCalculator |
class MSCalculator |
||||
{ |
{ |
||||
/** |
/** |
||||
* 計算报价 |
* 計算报价 |
||||
* |
* |
||||
* @param array $param |
* @param array $param |
||||
* @return void |
* @return void |
||||
*/ |
*/ |
||||
public function cal(array $param) |
public function cal(array $param) |
||||
{ |
{ |
||||
$elevator_type = $param['elevator_type']; |
$elevator_type = $param['elevator_type']; |
||||
$func = $elevator_type . "_price"; |
$func = $elevator_type . "_price"; |
||||
if (method_exists($this, $elevator_type . "_price")) { |
if (method_exists($this, $elevator_type . "_price")) { |
||||
|
|
||||
return call_user_func([$this, $func], $param); |
return call_user_func([$this, $func], $param); |
||||
} |
} |
||||
return self::error(); |
return self::error(); |
||||
} |
} |
||||
/** |
/** |
||||
* 客梯成本maintain_kind='A' |
* 客梯成本maintain_kind='A' |
||||
* 1.每月2次保養價格*1.25倍 |
* 1.每月2次保養價格*1.25倍 |
||||
* 2.全包價格按半包價+1500元/臺 |
* 2.全包價格按半包價+1500元/臺 |
||||
* 3.簽5年長約免費送M1係統的+2600元/臺" |
* 3.簽5年長約免費送M1係統的+2600元/臺" |
||||
* @return void |
* @return void |
||||
*/ |
*/ |
||||
public function A_price(array $item) |
public function A_price(array $item) |
||||
{ |
{ |
||||
$floors = $item['floors']; |
$floors = $item['floors']; |
||||
$maintain_times = $item['maintain_times']; |
$maintain_times = $item['maintain_times']; |
||||
|
|
||||
$sql_get_price = " |
$sql_get_price = " |
||||
select |
select |
||||
elevator_type, |
elevator_type, |
||||
base_price, |
base_price, |
||||
floors_price, |
floors_price, |
||||
min_floors, |
min_floors, |
||||
min_maintain_times, |
min_maintain_times, |
||||
maintain_months, |
maintain_months, |
||||
maintain_kind, |
maintain_kind, |
||||
maintain_period, |
maintain_period, |
||||
is_m1_bundle, |
is_m1_bundle, |
||||
all_inclusive_fee, |
all_inclusive_fee, |
||||
maintenance_fee_coefficient, |
maintenance_fee_coefficient, |
||||
m1_bundle_fee |
m1_bundle_fee |
||||
from maintain_standard_option where |
from maintain_standard_option where |
||||
elevator_type='" . $item['elevator_type'] . "' |
elevator_type='" . $item['elevator_type'] . "' |
||||
and " . $item['floors'] . " between min_floors and max_floors |
and " . $item['floors'] . " between min_floors and max_floors |
||||
and " . $item['speed'] . " between min_speed and max_speed |
and " . $item['speed'] . " between min_speed and max_speed |
||||
and " . $item['persons'] . " between min_persons and max_persons |
and " . $item['persons'] . " between min_persons and max_persons |
||||
and " . $item['maintain_times'] . " between min_maintain_times and max_maintain_times |
and " . $item['maintain_times'] . " between min_maintain_times and max_maintain_times |
||||
and maintain_months= " . $item['maintain_months'] . " |
and maintain_months= " . $item['maintain_months'] . " |
||||
and maintain_kind='" . $item['maintain_kind'] . "' |
and maintain_kind='" . $item['maintain_kind'] . "' |
||||
and is_m1_bundle='" . $item['is_m1_bundle'] . "' |
and is_m1_bundle='" . $item['is_m1_bundle'] . "' |
||||
"; |
"; |
||||
|
|
||||
list($row) = DB::result($sql_get_price); |
list($row) = DB::result($sql_get_price); |
||||
if (empty($row)) return self::error(); |
if (empty($row)) return self::error(); |
||||
#1基礎價格 |
#1基礎價格 |
||||
$floors = $item['floors'] - $row['min_floors']; |
$floors = $item['floors'] - $row['min_floors']; |
||||
$price1 = $row['base_price'] + ($floors) * $row['floors_price']; |
$price1 = $row['base_price'] + ($floors) * $row['floors_price']; |
||||
// echo $price1; |
// echo $price1; |
||||
#判斷是否全包 |
#判斷是否全包 |
||||
$price2 = $row['maintain_kind'] == 3 ? $price1 + $row['all_inclusive_fee'] : $price1; |
$price2 = $row['maintain_kind'] == 3 ? $price1 + $row['all_inclusive_fee'] : $price1; |
||||
// echo $price2; |
// echo $price2; |
||||
#判斷是否五年M1套餐 |
#判斷是否五年M1套餐 |
||||
$price3 = $row['is_m1_bundle'] == 'Y' ? $price2 + $row['m1_bundle_fee'] : $price2; |
$price3 = $row['is_m1_bundle'] == 'Y' ? $price2 + $row['m1_bundle_fee'] : $price2; |
||||
// echo $price3; |
// echo $price3; |
||||
if ($maintain_times - $row['min_maintain_times'] < 1) return self::success($price3); |
if ($maintain_times - $row['min_maintain_times'] < 1) return self::success($price3); |
||||
#判斷是否增加保養次數 用戶輸入的保養次數大於min_maintain_times |
#判斷是否增加保養次數 用戶輸入的保養次數大於min_maintain_times |
||||
$price4 = $price3; |
$price4 = $price3; |
||||
for ($i = 0; $i < $maintain_times - $row['min_maintain_times']; $i++) { |
for ($i = 0; $i < $maintain_times - $row['min_maintain_times']; $i++) { |
||||
|
|
||||
$price4 = $price4 + $price3 * $row['maintenance_fee_coefficient']; |
$price4 = $price4 + $price3 * $row['maintenance_fee_coefficient']; |
||||
} |
} |
||||
return self::success($price4); |
return self::success($price4); |
||||
} |
} |
||||
|
|
||||
/** |
/** |
||||
* 貨梯成本 |
* 貨梯成本 |
||||
* |
* |
||||
* @return void |
* @return void |
||||
*/ |
*/ |
||||
|
|
||||
public function B_price($item) |
public function B_price($item) |
||||
{ |
{ |
||||
|
|
||||
$floors = $item['floors']; |
$floors = $item['floors']; |
||||
$maintain_times = $item['maintain_times']; |
$maintain_times = $item['maintain_times']; |
||||
|
|
||||
$sql_get_price = " |
$sql_get_price = " |
||||
select |
select |
||||
elevator_type, |
elevator_type, |
||||
base_price, |
base_price, |
||||
floors_price, |
floors_price, |
||||
min_floors, |
min_floors, |
||||
min_maintain_times, |
min_maintain_times, |
||||
maintain_months, |
maintain_months, |
||||
maintain_kind, |
maintain_kind, |
||||
maintain_period, |
maintain_period, |
||||
is_m1_bundle, |
is_m1_bundle, |
||||
all_inclusive_fee, |
all_inclusive_fee, |
||||
maintenance_fee_coefficient, |
maintenance_fee_coefficient, |
||||
m1_bundle_fee |
m1_bundle_fee |
||||
from maintain_standard_option where |
from maintain_standard_option where |
||||
elevator_type='" . $item['elevator_type'] . "' |
elevator_type='" . $item['elevator_type'] . "' |
||||
and " . $item['floors'] . " between min_floors and max_floors |
and " . $item['floors'] . " between min_floors and max_floors |
||||
and " . $item['weight'] . " between min_weight and max_weight |
and " . $item['weight'] . " between min_weight and max_weight |
||||
and " . $item['maintain_times'] . " between min_maintain_times and max_maintain_times |
and " . $item['maintain_times'] . " between min_maintain_times and max_maintain_times |
||||
and maintain_months= " . $item['maintain_months'] . " |
and maintain_months= " . $item['maintain_months'] . " |
||||
and maintain_kind='" . $item['maintain_kind'] . "' |
and maintain_kind='" . $item['maintain_kind'] . "' |
||||
and is_m1_bundle='" . $item['is_m1_bundle'] . "' |
and is_m1_bundle='" . $item['is_m1_bundle'] . "' |
||||
"; |
"; |
||||
list($row) = DB::result($sql_get_price); |
list($row) = DB::result($sql_get_price); |
||||
if (empty($row)) return self::error(); |
if (empty($row)) return self::error(); |
||||
#1基礎價格 |
#1基礎價格 |
||||
$floors = $item['floors'] - $row['min_floors']; |
$floors = $item['floors'] - $row['min_floors']; |
||||
$price1 = $row['base_price'] + ($floors) * $row['floors_price']; |
$price1 = $row['base_price'] + ($floors) * $row['floors_price']; |
||||
// echo $price1; |
// echo $price1; |
||||
#判斷是否全包 |
#判斷是否全包 |
||||
$price2 = $row['maintain_kind'] == 3 ? $price1 + $row['all_inclusive_fee'] : $price1; |
$price2 = $row['maintain_kind'] == 3 ? $price1 + $row['all_inclusive_fee'] : $price1; |
||||
// echo $price2; |
// echo $price2; |
||||
#判斷是否五年M1套餐 |
#判斷是否五年M1套餐 |
||||
$price3 = $row['is_m1_bundle'] == 'Y' ? $price2 + $row['m1_bundle_fee'] : $price2; |
$price3 = $row['is_m1_bundle'] == 'Y' ? $price2 + $row['m1_bundle_fee'] : $price2; |
||||
// echo $price3; |
// echo $price3; |
||||
if ($maintain_times - $row['min_maintain_times'] < 1) return self::success($price3); |
if ($maintain_times - $row['min_maintain_times'] < 1) return self::success($price3); |
||||
#判斷是否增加保養次數 用戶輸入的保養次數大於min_maintain_times |
#判斷是否增加保養次數 用戶輸入的保養次數大於min_maintain_times |
||||
$price4 = $price3; |
$price4 = $price3; |
||||
for ($i = 0; $i < $maintain_times - $row['min_maintain_times']; $i++) { |
for ($i = 0; $i < $maintain_times - $row['min_maintain_times']; $i++) { |
||||
|
|
||||
$price4 = $price4 + $price3 * $row['maintenance_fee_coefficient']; |
$price4 = $price4 + $price3 * $row['maintenance_fee_coefficient']; |
||||
} |
} |
||||
return self::success($price4); |
return self::success($price4); |
||||
} |
} |
||||
/** |
/** |
||||
* 病床梯成本 |
* 病床梯成本 |
||||
* |
* |
||||
* @return void |
* @return void |
||||
*/ |
*/ |
||||
|
|
||||
public function C_price($item) |
public function C_price($item) |
||||
{ |
{ |
||||
|
|
||||
$floors = $item['floors']; |
$floors = $item['floors']; |
||||
$maintain_times = $item['maintain_times']; |
$maintain_times = $item['maintain_times']; |
||||
|
|
||||
$sql_get_price = " |
$sql_get_price = " |
||||
select |
select |
||||
elevator_type, |
elevator_type, |
||||
base_price, |
base_price, |
||||
floors_price, |
floors_price, |
||||
min_floors, |
min_floors, |
||||
min_maintain_times, |
min_maintain_times, |
||||
maintain_months, |
maintain_months, |
||||
maintain_kind, |
maintain_kind, |
||||
maintain_period, |
maintain_period, |
||||
is_m1_bundle, |
is_m1_bundle, |
||||
all_inclusive_fee, |
all_inclusive_fee, |
||||
maintenance_fee_coefficient, |
maintenance_fee_coefficient, |
||||
m1_bundle_fee |
m1_bundle_fee |
||||
from maintain_standard_option where |
from maintain_standard_option where |
||||
elevator_type='" . $item['elevator_type'] . "' |
elevator_type='" . $item['elevator_type'] . "' |
||||
and " . $item['floors'] . " between min_floors and max_floors |
and " . $item['floors'] . " between min_floors and max_floors |
||||
and " . $item['weight'] . " between min_weight and max_weight |
and " . $item['weight'] . " between min_weight and max_weight |
||||
and " . $item['maintain_times'] . " between min_maintain_times and max_maintain_times |
and " . $item['maintain_times'] . " between min_maintain_times and max_maintain_times |
||||
and maintain_months= " . $item['maintain_months'] . " |
and maintain_months= " . $item['maintain_months'] . " |
||||
and maintain_kind='" . $item['maintain_kind'] . "' |
and maintain_kind='" . $item['maintain_kind'] . "' |
||||
and is_m1_bundle='" . $item['is_m1_bundle'] . "' |
and is_m1_bundle='" . $item['is_m1_bundle'] . "' |
||||
"; |
"; |
||||
list($row) = DB::result($sql_get_price); |
list($row) = DB::result($sql_get_price); |
||||
if (empty($row)) return self::error(); |
if (empty($row)) return self::error(); |
||||
#1基礎價格 |
#1基礎價格 |
||||
$floors = $item['floors'] - $row['min_floors']; |
$floors = $item['floors'] - $row['min_floors']; |
||||
$price1 = $row['base_price'] + ($floors) * $row['floors_price']; |
$price1 = $row['base_price'] + ($floors) * $row['floors_price']; |
||||
// echo $price1; |
// echo $price1; |
||||
#判斷是否全包 |
#判斷是否全包 |
||||
$price2 = $row['maintain_kind'] == 3 ? $price1 + $row['all_inclusive_fee'] : $price1; |
$price2 = $row['maintain_kind'] == 3 ? $price1 + $row['all_inclusive_fee'] : $price1; |
||||
// echo $price2; |
// echo $price2; |
||||
#判斷是否五年M1套餐 |
#判斷是否五年M1套餐 |
||||
$price3 = $row['is_m1_bundle'] == 'Y' ? $price2 + $row['m1_bundle_fee'] : $price2; |
$price3 = $row['is_m1_bundle'] == 'Y' ? $price2 + $row['m1_bundle_fee'] : $price2; |
||||
// echo $price3; |
// echo $price3; |
||||
if ($maintain_times - $row['min_maintain_times'] < 1) return self::success($price3); |
if ($maintain_times - $row['min_maintain_times'] < 1) return self::success($price3); |
||||
#判斷是否增加保養次數 用戶輸入的保養次數大於min_maintain_times |
#判斷是否增加保養次數 用戶輸入的保養次數大於min_maintain_times |
||||
$price4 = $price3; |
$price4 = $price3; |
||||
for ($i = 0; $i < $maintain_times - $row['min_maintain_times']; $i++) { |
for ($i = 0; $i < $maintain_times - $row['min_maintain_times']; $i++) { |
||||
|
|
||||
$price4 = $price4 + $price3 * $row['maintenance_fee_coefficient']; |
$price4 = $price4 + $price3 * $row['maintenance_fee_coefficient']; |
||||
} |
} |
||||
return self::success($price4); |
return self::success($price4); |
||||
} |
} |
||||
|
|
||||
/** |
/** |
||||
* 無機房成本 |
* 無機房成本 |
||||
* |
* |
||||
* @return void |
* @return void |
||||
*/ |
*/ |
||||
|
|
||||
public function D_price($item) |
public function D_price($item) |
||||
{ |
{ |
||||
|
|
||||
|
|
||||
$floors = $item['floors']; |
$floors = $item['floors']; |
||||
$maintain_times = $item['maintain_times']; |
$maintain_times = $item['maintain_times']; |
||||
|
|
||||
$sql_get_price = " |
$sql_get_price = " |
||||
select |
select |
||||
elevator_type, |
elevator_type, |
||||
base_price, |
base_price, |
||||
floors_price, |
floors_price, |
||||
min_floors, |
min_floors, |
||||
min_maintain_times, |
min_maintain_times, |
||||
maintain_months, |
maintain_months, |
||||
maintain_kind, |
maintain_kind, |
||||
maintain_period, |
maintain_period, |
||||
is_m1_bundle, |
is_m1_bundle, |
||||
all_inclusive_fee, |
all_inclusive_fee, |
||||
maintenance_fee_coefficient, |
maintenance_fee_coefficient, |
||||
m1_bundle_fee |
m1_bundle_fee |
||||
from maintain_standard_option where |
from maintain_standard_option where |
||||
elevator_type='" . $item['elevator_type'] . "' |
elevator_type='" . $item['elevator_type'] . "' |
||||
and " . $item['floors'] . " between min_floors and max_floors |
and " . $item['floors'] . " between min_floors and max_floors |
||||
and " . $item['persons'] . " between min_persons and max_persons |
and " . $item['persons'] . " between min_persons and max_persons |
||||
and " . $item['maintain_times'] . " between min_maintain_times and max_maintain_times |
and " . $item['maintain_times'] . " between min_maintain_times and max_maintain_times |
||||
and maintain_months= " . $item['maintain_months'] . " |
and maintain_months= " . $item['maintain_months'] . " |
||||
and maintain_kind='" . $item['maintain_kind'] . "' |
and maintain_kind='" . $item['maintain_kind'] . "' |
||||
and is_m1_bundle='" . $item['is_m1_bundle'] . "' |
and is_m1_bundle='" . $item['is_m1_bundle'] . "' |
||||
"; |
"; |
||||
list($row) = DB::result($sql_get_price); |
list($row) = DB::result($sql_get_price); |
||||
if (empty($row)) return self::error(); |
if (empty($row)) return self::error(); |
||||
#1基礎價格 |
#1基礎價格 |
||||
$floors = $item['floors'] - $row['min_floors']; |
$floors = $item['floors'] - $row['min_floors']; |
||||
$price1 = $row['base_price'] + ($floors) * $row['floors_price']; |
$price1 = $row['base_price'] + ($floors) * $row['floors_price']; |
||||
// echo $price1; |
// echo $price1; |
||||
#判斷是否全包 |
#判斷是否全包 |
||||
$price2 = $row['maintain_kind'] == 3 ? $price1 + $row['all_inclusive_fee'] : $price1; |
$price2 = $row['maintain_kind'] == 3 ? $price1 + $row['all_inclusive_fee'] : $price1; |
||||
// echo $price2; |
// echo $price2; |
||||
#判斷是否五年M1套餐 |
#判斷是否五年M1套餐 |
||||
$price3 = $row['is_m1_bundle'] == 'Y' ? $price2 + $row['m1_bundle_fee'] : $price2; |
$price3 = $row['is_m1_bundle'] == 'Y' ? $price2 + $row['m1_bundle_fee'] : $price2; |
||||
// echo $price3; |
// echo $price3; |
||||
if ($maintain_times - $row['min_maintain_times'] < 1) return self::success($price3); |
if ($maintain_times - $row['min_maintain_times'] < 1) return self::success($price3); |
||||
#判斷是否增加保養次數 用戶輸入的保養次數大於min_maintain_times |
#判斷是否增加保養次數 用戶輸入的保養次數大於min_maintain_times |
||||
$price4 = $price3; |
$price4 = $price3; |
||||
for ($i = 0; $i < $maintain_times - $row['min_maintain_times']; $i++) { |
for ($i = 0; $i < $maintain_times - $row['min_maintain_times']; $i++) { |
||||
|
|
||||
$price4 = $price4 + $price3 * $row['maintenance_fee_coefficient']; |
$price4 = $price4 + $price3 * $row['maintenance_fee_coefficient']; |
||||
} |
} |
||||
return self::success($price4); |
return self::success($price4); |
||||
} |
} |
||||
/** |
/** |
||||
*家用梯成本 |
*家用梯成本 |
||||
* |
* |
||||
* @return void |
* @return void |
||||
*/ |
*/ |
||||
|
|
||||
public function E_price(array $item) |
public function E_price(array $item) |
||||
{ |
{ |
||||
|
|
||||
$floors = $item['floors']; |
$floors = $item['floors']; |
||||
$maintain_times = $item['maintain_times']; |
$maintain_times = $item['maintain_times']; |
||||
|
|
||||
$sql_get_price = " |
$sql_get_price = " |
||||
select |
select |
||||
elevator_type, |
elevator_type, |
||||
base_price, |
base_price, |
||||
floors_price, |
floors_price, |
||||
min_floors, |
min_floors, |
||||
min_maintain_times, |
min_maintain_times, |
||||
maintain_months, |
maintain_months, |
||||
maintain_kind, |
maintain_kind, |
||||
maintain_period, |
maintain_period, |
||||
is_m1_bundle, |
is_m1_bundle, |
||||
all_inclusive_fee, |
all_inclusive_fee, |
||||
maintenance_fee_coefficient, |
maintenance_fee_coefficient, |
||||
m1_bundle_fee |
m1_bundle_fee |
||||
from maintain_standard_option where |
from maintain_standard_option where |
||||
elevator_type='" . $item['elevator_type'] . "' |
elevator_type='" . $item['elevator_type'] . "' |
||||
and " . $item['floors'] . " between min_floors and max_floors |
and " . $item['floors'] . " between min_floors and max_floors |
||||
and " . $item['persons'] . " between min_persons and max_persons |
and " . $item['persons'] . " between min_persons and max_persons |
||||
and " . $item['maintain_times'] . " between min_maintain_times and max_maintain_times |
and " . $item['maintain_times'] . " between min_maintain_times and max_maintain_times |
||||
and maintain_period= " . $item['maintain_period'] . " |
and maintain_period= " . $item['maintain_period'] . " |
||||
and maintain_kind='" . $item['maintain_kind'] . "' |
and maintain_kind='" . $item['maintain_kind'] . "' |
||||
and is_m1_bundle='" . $item['is_m1_bundle'] . "' |
and is_m1_bundle='" . $item['is_m1_bundle'] . "' |
||||
"; |
"; |
||||
list($row) = DB::result($sql_get_price); |
list($row) = DB::result($sql_get_price); |
||||
if (empty($row)) return self::error(); |
if (empty($row)) return self::error(); |
||||
#1基礎價格 |
#1基礎價格 |
||||
$floors = $item['floors'] - $row['min_floors']; |
$floors = $item['floors'] - $row['min_floors']; |
||||
$price1 = $row['base_price'] + ($floors) * $row['floors_price']; |
$price1 = $row['base_price'] + ($floors) * $row['floors_price']; |
||||
// echo $price1; |
// echo $price1; |
||||
#判斷是否全包 |
#判斷是否全包 |
||||
$price2 = $row['maintain_kind'] == 3 ? $price1 + $row['all_inclusive_fee'] : $price1; |
$price2 = $row['maintain_kind'] == 3 ? $price1 + $row['all_inclusive_fee'] : $price1; |
||||
// echo $price2; |
// echo $price2; |
||||
#判斷是否五年M1套餐 |
#判斷是否五年M1套餐 |
||||
$price3 = $row['is_m1_bundle'] == 'Y' ? $price2 + $row['m1_bundle_fee'] : $price2; |
$price3 = $row['is_m1_bundle'] == 'Y' ? $price2 + $row['m1_bundle_fee'] : $price2; |
||||
// echo $price3; |
// echo $price3; |
||||
if ($maintain_times - $row['min_maintain_times'] < 1) return self::success($price3); |
if ($maintain_times - $row['min_maintain_times'] < 1) return self::success($price3); |
||||
#判斷是否增加保養次數 用戶輸入的保養次數大於min_maintain_times |
#判斷是否增加保養次數 用戶輸入的保養次數大於min_maintain_times |
||||
$price4 = $price3; |
$price4 = $price3; |
||||
for ($i = 0; $i < $maintain_times - $row['min_maintain_times']; $i++) { |
for ($i = 0; $i < $maintain_times - $row['min_maintain_times']; $i++) { |
||||
|
|
||||
$price4 = $price4 + $price3 * $row['maintenance_fee_coefficient']; |
$price4 = $price4 + $price3 * $row['maintenance_fee_coefficient']; |
||||
} |
} |
||||
return self::success($price4); |
return self::success($price4); |
||||
} |
} |
||||
public function error() |
public function error() |
||||
{ |
{ |
||||
return [ |
return [ |
||||
'status' => 'fail', |
'status' => 'fail', |
||||
'message' => '無此項目,請聯係業務部創建標準成本' |
'message' => '無此項目,請聯係業務部創建標準成本' |
||||
]; |
]; |
||||
} |
} |
||||
public function success($price) |
public function success($price) |
||||
{ |
{ |
||||
return [ |
return [ |
||||
'status' => 'ok', |
'status' => 'ok', |
||||
'price' => $price |
'price' => $price |
||||
]; |
]; |
||||
} |
} |
||||
} |
} |
||||
|
@ -1,84 +1,84 @@ |
|||||
<?php |
<?php |
||||
error_reporting(E_ALL); |
error_reporting(E_ALL); |
||||
ini_set('dispaly_errors', "On"); |
ini_set('dispaly_errors', "On"); |
||||
require_once './MSCalculator.php'; |
require_once './MSCalculator.php'; |
||||
|
|
||||
|
|
||||
/* //客梯 |
//客梯 |
||||
$param = [ |
$param = [ |
||||
|
|
||||
'elevator_type' => 'A', |
'elevator_type' => 'A', |
||||
'floors' => 7, |
'floors' => 7, |
||||
'speed' => 1, |
'speed' => 1, |
||||
'persons' => 6, |
'persons' => 6, |
||||
'weight' => 1000, |
'weight' => 1000, |
||||
'maintain_times' => 1, |
'maintain_times' => 1, |
||||
'maintain_months' => 12, |
'maintain_months' => 12, |
||||
'maintain_kind' => 2, |
'maintain_kind' => 2, |
||||
'maintain_period' => 1, //默认为1月1次, 2是为2月一次 |
'maintain_period' => 1, //默认为1月1次, 2是为2月一次 |
||||
'is_m1_bundle' => 'N', |
'is_m1_bundle' => 'N', |
||||
]; |
]; |
||||
*/ |
|
||||
/* //货梯 |
//货梯 |
||||
$param = [ |
$param = [ |
||||
|
|
||||
'elevator_type' => 'B', |
'elevator_type' => 'B', |
||||
'floors' => 7, |
'floors' => 7, |
||||
'speed' => 1, |
'speed' => 1, |
||||
'persons' => 6, |
'persons' => 6, |
||||
'weight' => 1000, |
'weight' => 1000, |
||||
'maintain_times' => 1, |
'maintain_times' => 1, |
||||
'maintain_months' => 12, |
'maintain_months' => 12, |
||||
'maintain_kind' => 2, |
'maintain_kind' => 2, |
||||
'maintain_period' => 1, //默认为1月1次, 2是为2月一次 |
'maintain_period' => 1, //默认为1月1次, 2是为2月一次 |
||||
'is_m1_bundle' => 'N', |
'is_m1_bundle' => 'N', |
||||
]; |
]; |
||||
*/ |
|
||||
|
|
||||
/*//病床梯 |
//病床梯 |
||||
$param = [ |
$param = [ |
||||
|
|
||||
'elevator_type' => 'C', |
'elevator_type' => 'C', |
||||
'floors' => 28, |
'floors' => 28, |
||||
'speed' => 1, |
'speed' => 1, |
||||
'persons' => 6, |
'persons' => 6, |
||||
'weight' => 1000, |
'weight' => 1000, |
||||
'maintain_times' => 2, //病床梯一月2次保养 |
'maintain_times' => 2, //病床梯一月2次保养 |
||||
'maintain_months' => 12, |
'maintain_months' => 12, |
||||
'maintain_kind' => 2, |
'maintain_kind' => 2, |
||||
'maintain_period' => 1, //默认为1月1次, 2是为2月一次 |
'maintain_period' => 1, //默认为1月1次, 2是为2月一次 |
||||
'is_m1_bundle' => 'N', |
'is_m1_bundle' => 'N', |
||||
];*/ |
]; |
||||
|
|
||||
/*//无机房 |
//无机房 |
||||
$param = [ |
$param = [ |
||||
'elevator_type' => 'D', |
'elevator_type' => 'D', |
||||
'floors' => 3, |
'floors' => 3, |
||||
'speed' => 1, |
'speed' => 1, |
||||
'persons' => 6, |
'persons' => 6, |
||||
'weight' => 1000, |
'weight' => 1000, |
||||
'maintain_times' => 1, //病床梯一月2次保养 |
'maintain_times' => 1, //病床梯一月2次保养 |
||||
'maintain_months' => 12, |
'maintain_months' => 12, |
||||
'maintain_kind' => 3, |
'maintain_kind' => 3, |
||||
'maintain_period' => 1, //默认为1月1次, 2是为2月一次 |
'maintain_period' => 1, //默认为1月1次, 2是为2月一次 |
||||
'is_m1_bundle' => 'N', |
'is_m1_bundle' => 'N', |
||||
]; |
]; |
||||
|
|
||||
*/ |
|
||||
//家用梯 |
//家用梯 |
||||
$param = [ |
$param = [ |
||||
'elevator_type' => 'E', |
'elevator_type' => 'E', |
||||
'floors' => 3, |
'floors' => 3, |
||||
'speed' => 1, |
'speed' => 1, |
||||
'persons' => 6, |
'persons' => 6, |
||||
'weight' => 1000, |
'weight' => 1000, |
||||
'maintain_times' => 1, //病床梯一月2次保养 |
'maintain_times' => 1, //病床梯一月2次保养 |
||||
'maintain_months' => 60, |
'maintain_months' => 60, |
||||
'maintain_kind' => 2, |
'maintain_kind' => 2, |
||||
'maintain_period' => 1, //默认为1月1次, 2是为2月一次 |
'maintain_period' => 1, //默认为1月1次, 2是为2月一次 |
||||
'is_m1_bundle' => 'Y', |
'is_m1_bundle' => 'Y', |
||||
]; |
]; |
||||
|
|
||||
$mic = new MSCalculator(); |
$mic = new MSCalculator(); |
||||
$price = $mic->cal($_GET); |
$price = $mic->cal($_GET); |
||||
echo json_encode($price); |
echo json_encode($price); |
||||
|
Loading…
Reference in new issue