mirror of
https://gitee.com/koogua/course-tencent-cloud.git
synced 2025-08-07 15:01:38 +08:00
纠正单词评选错误
This commit is contained in:
parent
7322d1fc0d
commit
e3e5d20a7c
@ -11,7 +11,7 @@ trait PageTrait
|
||||
protected function insertPages(array $rows)
|
||||
{
|
||||
foreach ($rows as $key => $row) {
|
||||
$exists = $this->pageExits($row['alias']);
|
||||
$exists = $this->pageExists($row['alias']);
|
||||
if ($exists) unset($rows[$key]);
|
||||
}
|
||||
|
||||
@ -20,7 +20,7 @@ trait PageTrait
|
||||
$this->table('kg_page')->insert($rows)->save();
|
||||
}
|
||||
|
||||
protected function pageExits($alias)
|
||||
protected function pageExists($alias)
|
||||
{
|
||||
$row = $this->getQueryBuilder()
|
||||
->select('*')
|
||||
@ -28,7 +28,7 @@ trait PageTrait
|
||||
->where(['alias' => $alias])
|
||||
->execute()->fetch();
|
||||
|
||||
return $row ? true : false;
|
||||
return (bool)$row;
|
||||
}
|
||||
|
||||
}
|
@ -11,7 +11,7 @@ trait SettingTrait
|
||||
protected function insertSettings(array $rows)
|
||||
{
|
||||
foreach ($rows as $key => $row) {
|
||||
$exists = $this->settingExits($row['section'], $row['item_key']);
|
||||
$exists = $this->settingExists($row['section'], $row['item_key']);
|
||||
if ($exists) unset($rows[$key]);
|
||||
}
|
||||
|
||||
@ -20,7 +20,7 @@ trait SettingTrait
|
||||
$this->table('kg_setting')->insert($rows)->save();
|
||||
}
|
||||
|
||||
protected function settingExits($section, $itemKey)
|
||||
protected function settingExists($section, $itemKey)
|
||||
{
|
||||
$row = $this->getQueryBuilder()
|
||||
->select('*')
|
||||
@ -28,7 +28,7 @@ trait SettingTrait
|
||||
->where(['section' => $section, 'item_key' => $itemKey])
|
||||
->execute()->fetch();
|
||||
|
||||
return $row ? true : false;
|
||||
return (bool)$row;
|
||||
}
|
||||
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user