Changeset 2584992
- Timestamp:
- 08/18/2021 04:56:24 PM (5 years ago)
- Location:
- blaze-css/trunk
- Files:
-
- 3 edited
-
README.txt (modified) (1 diff)
-
lib/Common/Logger.php (modified) (2 diffs)
-
lib/Common/Model.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
blaze-css/trunk/README.txt
r2584989 r2584992 33 33 == Changelog == 34 34 35 = 1.0.1 = 36 * Fixed some PHP notices. 37 35 38 = 1.0 = 36 39 * First version. -
blaze-css/trunk/lib/Common/Logger.php
r2499500 r2584992 18 18 $this->plugin = $plugin; 19 19 $this->url = (object) parse_url($postData['url']); 20 if( !isset($this->url->query) ) 21 $this->url->query = null; 22 20 23 $this->pageQuery = $postData['log']; 21 24 } … … 62 65 { 63 66 $logs = (new Log)->select('*')->where(" 64 host = '{$this->url->host}'65 AND path = '{$this->url->path}'66 " )->get();67 host = %s 68 AND path = %s 69 ", [$this->url->host, $this->url->path])->get(); 67 70 68 71 if( !empty($logs) ) { -
blaze-css/trunk/lib/Common/Model.php
r2499500 r2584992 34 34 $where = ['id' => $this->getId()]; 35 35 36 // dd(37 // [38 // $this->getTable(), $data, $where, $format39 // ]40 // );41 36 $this->db->update( 42 37 $this->getTable(), $data, $where, $format … … 73 68 } 74 69 75 public function where( $where )70 public function where( $where, $values = [] ) 76 71 { 77 72 $this->query['where'] = $where; 73 $this->query['values'] = $values; 78 74 return $this; 79 75 } … … 86 82 WHERE {$this->query['where']} 87 83 SQL; 88 return $this->db->get_results( $this->db->prepare( $sql ) ); 84 85 return $this->db->get_results( 86 $this->db->prepare( $sql, $this->query['values'] ) 87 ); 89 88 } 90 89 … … 100 99 ); 101 100 102 $this->id = $row->id; 103 $this->attributes = $row; 101 if( $row ) { 102 $this->id = $row->id; 103 $this->attributes = $row; 104 } 105 104 106 return $this; 105 107 }
Note: See TracChangeset
for help on using the changeset viewer.