zilong преди 4 години
родител
ревизия
3c3fc76156
променени са 1 файла, в които са добавени 1 реда и са изтрити 16 реда
  1. 1 16
      app/Models/Order.php

+ 1 - 16
app/Models/Order.php

xqd xqd
@@ -10,7 +10,7 @@ namespace App\Models;
 
 class Order extends BaseModel
 {
-    protected $appends = ['is_evaluate', 'order_duration', 'consult_duration', 'callback_phone'];
+    protected $appends = ['is_evaluate', 'consult_duration', 'callback_phone'];
 
     CONST UNPAID = 1, NOTACCEPT = 2, ISING = 3, FINISHED = 4,CANCELED=5,ISOUT=6; //订单状态(1.未支付 2.进行中 3.已完成 4.已取消)
     public static  $_order_status = [
@@ -159,21 +159,6 @@ class Order extends BaseModel
         return $is_evaluate;
     }
 
-    public function getOrderDurationAttribute()
-    {
-        if (!empty($this->outtime) && !empty($this->receiving_time)) {
-            $diff = $this->outtime - $this->receiving_time;
-            $hour = round($diff/3600);
-            if ($hour == 0) {
-                return round($diff/60).'分钟';
-            }
-
-            return $hour.'小时';
-        }
-
-        return '';
-    }
-
     //取消订单,建议是在事务里面去调用
     public static function orderCancel($order_id)
     {