* adjust code for ajaxGetSonModules.

This commit is contained in:
wangyidong
2016-03-14 14:56:20 +08:00
parent d0a31b775e
commit e843e0004d
+1 -2
View File
@@ -332,10 +332,9 @@ class tree extends control
*/
public function ajaxGetSonModules($moduleID, $rootID = 0, $type = 'story')
{
if($moduleID) die(json_encode($this->dao->select('id,name')->from(TABLE_MODULE)->where('parent')->eq($moduleID)->andWhere('type')->eq($type)->fetchPairs('id', 'name')));
$modules = $this->dao->select('id, name')->from(TABLE_MODULE)
->where('root')->eq($rootID)
->andWhere('parent')->eq('0')
->andWhere('parent')->eq((int)$moduleID)
->andWhere('type')->eq($type)
->fetchPairs();
die(json_encode($modules));