songxingwei 3 years ago
parent
commit
e3464a941b
1 changed files with 8 additions and 1 deletions
  1. 8 1
      application/common/model/User.php

+ 8 - 1
application/common/model/User.php

@@ -1536,7 +1536,14 @@ class User Extends Model
             if (time()>$end_time){
                 $poor_minutes = floor((time()-$end_time)%86400/60);
                 //获取加班费每分钟多钱
-                $overtime_pay = sprintf("%.2f", (($order['price'] * 0.1)/60) * $poor_minutes);  //四舍五入保留两位小数
+                $user_overtime_pay = self::where('id',$user_id)->value('overtime_pay');
+                if ($user_overtime_pay>0){
+                    $price = $user_overtime_pay;
+                }else{
+                    $price = $order['price'] * 0.1;
+                }
+
+                $overtime_pay = sprintf("%.2f", ($price/60) * $poor_minutes);  //四舍五入保留两位小数
                 $order->overtime_pay = $overtime_pay;
                 $order->overtime_pay_order_no = Common::getNewOrderId($order['designer_id']);
                 $order->overtime_pay_status = 1;