fix support group bug and dblayer bug
This commit is contained in:
parent
d574bfc186
commit
6d0943df79
3 changed files with 4 additions and 4 deletions
|
@ -223,7 +223,7 @@ class DBLayer {
|
|||
*/
|
||||
public function insert($tb_name, $data, $datafunc = array()) {
|
||||
$this->useDb();
|
||||
$field_options = implode(',', array_merge(array_keys($data), array_keys($datafunc)));
|
||||
$field_options = '`'.implode('`,`', array_merge(array_keys($data), array_keys($datafunc))).'`';
|
||||
$field_values = implode(',', array_merge(array(':' . implode(',:', array_keys($data))), array_values($datafunc)));
|
||||
try {
|
||||
$sth = $this->PDO->prepare("INSERT INTO $tb_name ($field_options) VALUE ($field_values)");
|
||||
|
|
|
@ -54,7 +54,7 @@ class In_Support_Group{
|
|||
*/
|
||||
public function create() {
|
||||
$dbl = new DBLayer("lib");
|
||||
$dbl->insert("`in_support_group`", Array('User' => $this->user, 'Group' => $this->group);
|
||||
$dbl->insert("`in_support_group`", Array('User' => $this->user, 'Group' => $this->group));
|
||||
}
|
||||
|
||||
|
||||
|
@ -64,7 +64,7 @@ class In_Support_Group{
|
|||
*/
|
||||
public function delete() {
|
||||
$dbl = new DBLayer("lib");
|
||||
$dbl->delete("`in_support_group`", array('user_id' => $this->getUser() ,'group_id' => $this->getGroup(), "`User` = :user_id and `Group` = :group_id");
|
||||
$dbl->delete("`in_support_group`", array('user_id' => $this->getUser() ,'group_id' => $this->getGroup()), "`User` = :user_id and `Group` = :group_id");
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -337,7 +337,7 @@ class Support_Group{
|
|||
*/
|
||||
public function delete(){
|
||||
$dbl = new DBLayer("lib");
|
||||
$dbl->delete("`support_group`", Array('id' => $this->getSGroupId(), "`SGroupId` = :id"));
|
||||
$dbl->delete("`support_group`", Array('id' => $this->getSGroupId()), "`SGroupId` = :id");
|
||||
}
|
||||
|
||||
////////////////////////////////////////////Getters////////////////////////////////////////////////////
|
||||
|
|
Loading…
Reference in a new issue