zilong 4 年之前
父節點
當前提交
3f7fc1669b
共有 2 個文件被更改,包括 7 次插入1 次删除
  1. 3 0
      app/Http/Controllers/Api/V1/VaccineController.php
  2. 4 1
      app/Models/ServicePack.php

+ 3 - 0
app/Http/Controllers/Api/V1/VaccineController.php

xqd
@@ -37,6 +37,9 @@ class VaccineController extends AuthController
                 $builder->orderBy('price', 'desc');
             }
         }
+        else {
+            $builder->orderBy('stock', 'desc');
+        }
 
         $data = $builder->paginate();
 

+ 4 - 1
app/Models/ServicePack.php

xqd xqd
@@ -29,6 +29,7 @@ class ServicePack extends BaseModel
 
         return $data;
     }
+    
     public function systemconfig(){
         return $this->hasOne(SystemConfig::class,'id','agreement_id');
     }
@@ -42,7 +43,9 @@ class ServicePack extends BaseModel
 
         return $data;
     }
-    public function insuranceagreement(){
+
+    public function insuranceagreement()
+    {
         return $this->hasOne(InsuranceAgreement::class,'id','agreement_id');
     }
 }