You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

64 lines
1.8 KiB

<?php
class MICalculator
{
private $fields = [
'elevator_type' => ['label' => '梯种'],
'floors' => ['label' => '层数'],
'speed' => ['label' => '速度'],
'persons' => ['label' => '人乘'],
'weight' => ['label' => '载重'],
'maintain_months' => ['label' => '保养月数'],
'maintain_times' => ['label' => '保养次数'],
'maintain_kind' => ['label' => '保养方式'],
'is_m1_bundle' => ['label' => '免费加装M1系统'],
'base_price' => ['label' => '基准价格'],
'floors_price' => ['label' => '每层加价'],
'm1_bundle_fee' => ['label' => 'M1每月附加费']
];
/**
* 计算MI
*
* @param array $param
* @return void
*/
public function cal(array $param)
{
$sql_get_price = "
select* from maintain_mi_option where
elevator_type=''
and $floors between min_floors and max_floors
and $speed between min_speed and max_speed
and $persons between min_persons and max_persons
and $weight between min_weight and max_weight
and $maintain_times between max_maintain_times and min_maintain_times
and maintain_months= $maintain_months,
and maintain_kind=$maintain_kind,
and is_m1_bundle=$is_m1_bundle
";
$price = $base_price + $floors * $floors_price;
}
/**
* 客梯报价
*
* @return void
*/
public function a_price()
{
}
/**
* 货梯报价
*
* @return void
*/
public function error()
{
return [
'status' => 'fail',
'message' => '无此项目,请联系业务部创建MI'
];
}
}