1.根据分销商等级去计算 折扣价格
/www/wwwroot/pumeiren.xxx.com/app/services/order StoreOrderComputedServices.php
Log::error('****************-'.json_encode($cartInfo)); //打印购买的信息
Log::error('****************-'.json_encode($userInfo)); //打印当前用户的信息
Log::error('+++++++-'.$cartInfo[0]['productInfo']['id']);//打印第一个id
if($cartInfo[0]['productInfo']['id']>12 ){ //判断id,由于 分销商等级也是购买,分销商等级不打折,所以先排除一下。 switch ($userInfo['agent_level']) { case 1: $payPrice =$payPrice*0.35; break; case 2: $payPrice =$payPrice*0.30; break; case 3: $payPrice =$payPrice*0.30; break; case 4: $payPrice =$payPrice*0.26; break; case 5: $payPrice =$payPrice*0.21; break; case 6: $payPrice =$payPrice*0.17; break; case 7: $payPrice =$payPrice*0.17; break; case 8: $payPrice =$payPrice*0.21; break; default: // 执行代码块 n break; } }