zilong 4 years ago
parent
commit
3f7fc1669b
2 changed files with 7 additions and 1 deletions
  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');
     }
 }