Просмотр исходного кода

Merge branch 'zzd' of ssh://was.baoshi56.com:10022/var/git/bswas

LD 5 лет назад
Родитель
Сommit
156fcb2db0

+ 13 - 4
app/Http/Controllers/TestController.php

@@ -61,6 +61,8 @@ use App\OrderPackageCommodities;
 use App\OrderPackageCountingRecord;
 use App\OrderTracking;
 use App\Owner;
+use App\OwnerAreaReport;
+use App\OwnerBillReport;
 use App\OwnerFeeDetail;
 use App\OwnerFeeDetailLogistic;
 use App\OwnerPriceExpress;
@@ -164,10 +166,17 @@ class TestController extends Controller
 
     public function test()
     {
-        $w = Waybill::query()->first();
-        $w->owner = $w->owner->name;
-        $w = $w->withoutRelations();
-        dd($w);
+        $a = OwnerBillReport::query()->first();
+        $a->update(["storage_fee" => -700.0]);
+        $b = OwnerAreaReport::query()->first();
+        $b->update([
+              "user_owner_group_id" => "1",
+              "area_on_tray" => "1",
+              "area_on_half_tray" => "1",
+              "area_on_flat" => "1",
+              "accounting_area" => 5.6,
+        ]);
+        dd("ok");
         return view("test");
     }
 

+ 2 - 1
app/Services/OwnerAreaReportService.php

@@ -61,7 +61,7 @@ class OwnerAreaReportService
                     ->where("counting_month",'like',$area->counting_month."%")->first();
                 if ($report){
                     if (!$area->ownerStoragePriceModel)return false;
-                    $diff = $area->accounting_area - $values["accounting_area"];
+                    $diff = $area->accounting_area>0 ? $area->accounting_area - $values["accounting_area"] : $values["accounting_area"];
                     $diffAmount = app("OwnerStoragePriceModelService")->calculationAmount($area->ownerStoragePriceModel, $diff, $area->owner_id, $area->counting_month);
                     if ($diffAmount != 0){
                         $up = ["storage_fee"=>$report->storage_fee - $diffAmount];
@@ -75,6 +75,7 @@ class OwnerAreaReportService
             DB::commit();
             return true;
         }catch (\Exception $e){
+            dd($e->getMessage());
             DB::rollBack();
             return false;
         }

+ 1 - 1
resources/views/customer/project/create.blade.php

@@ -1837,7 +1837,7 @@
                     }
                 },
                 filterCustomer(e){
-                    let value = $(e.target).val();
+                    let value = e.target.value;
                     if (value===""){
                         this.filterCustomers=JSON.parse(JSON.stringify(this.customers));
                         return;