Browse Source

Fixes for errors arisen when combining the branches Runs and Users.

Iñigo Valentin 6 năm trước cách đây
mục cha
commit
6d3a2c8613
2 tập tin đã thay đổi với 8 bổ sung8 xóa
  1. 7 7
      application/entity/Run.php
  2. 1 1
      install_data/setup.sql

+ 7 - 7
application/entity/Run.php

@@ -99,7 +99,7 @@
         public $sd= [];
 
         /**
-         * List of [{@see K_Unit}, quantity] of dropped summon pieces.
+         * List of [{@see K_Unit}, amount] of dropped summon pieces.
          */
         public $unit_piece = [];
 
@@ -194,14 +194,14 @@
             $s = "
                 SELECT
                   item,
-                  quantity
+                  amount
                 FROM run_drop_item
                 WHERE run = $this->id;
             ";
             $q = $this->db->query($s);
             while ($r = $q->fetchArray(SQLITE3_ASSOC)){
                 $i = new Inventory($this->db, $r["item"]);
-                $i->amount =  $r["quantity"];
+                $i->amount =  $r["amount"];
                 array_push($this->item, $i);
             }
             $s = "
@@ -225,7 +225,7 @@
             $s = "
                 SELECT
                   unit,
-                  quantity
+                  amount
                 FROM run_drop_unit_pieces
                 WHERE run = $this->id;
             ";
@@ -233,19 +233,19 @@
             while ($r = $q->fetchArray(SQLITE3_ASSOC)){
                 $i = [
                     "unit" => new K_Unit($this->db, $r["unit"]),
-                    "quantity" => $r["quantity"]
+                    "amount" => $r["amount"]
                 ];
                 array_push($this->unit_piece, $i);
             }
             $s = "
-                SELECT quantity
+                SELECT amount
                 FROM run_drop_shapeshifting
                 WHERE run = $this->id;
             ";
             $q = $this->db->query($s);
             $r = $q->fetchArray(SQLITE3_ASSOC);
             if ($r){
-                $this->shapeshifting = $r["quantity"];
+                $this->shapeshifting = $r["amount"];
             }
             $s = "
                 SELECT

+ 1 - 1
install_data/setup.sql

@@ -445,7 +445,7 @@ CREATE TABLE IF NOT EXISTS run_drop_rune_craft(
 CREATE TABLE IF NOT EXISTS run_drop_item(
     run INT NOT NULL REFERENCES run(id),
     item INT NOT NULL REFERENCES k_inventory(id),
-    quantity INT NOT NULL CHECK(quantity > 0),
+    amount INT NOT NULL CHECK(amount > 0),
     PRIMARY KEY (run, item)
 );
 CREATE TABLE IF NOT EXISTS run_drop_unit(