diff --git a/.gitignore b/.gitignore index 104c9a4..b40b2ea 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ /images/ /temp/* data/config.php - +.vscode/ diff --git a/back/room.php b/back/room.php index 8004b9c..7ef08a6 100755 --- a/back/room.php +++ b/back/room.php @@ -266,12 +266,12 @@ elseif ($_REQUEST['act'] == 'insert' || $_REQUEST['act'] == 'update') @unlink('../' . $row['image1']); } } - $original_img = $image->upload_image($_FILES['image1']); // 原始图片 - if ($original_img === false) - { - sys_msg($image->error_msg(), 1, array(), false); - } - $image1 = $original_img; // 商品图片 + $original_img = $image->upload_image($_FILES['image1']); // 原始图片 + if ($original_img === false) + { + sys_msg($image->error_msg(), 1, array(), false); + } + $image1 = $original_img; // 商品图片 } @@ -664,12 +664,11 @@ elseif ($_REQUEST['act'] == 'toggle_enable') /*------------------------------------------------------ */ elseif ($_REQUEST['act'] == 'edit_sort_order') { - check_authz_json('room_manage'); - + // check_authz_json('room_manage'); $room_id = intval($_POST['id']); $sort_order = intval($_POST['val']); - if ($exc->edit("sort_order = '$sort_order', last_update=" .gmtime(), $room_id)) + if ($exc->edit("sort_order = '$sort_order', ustamp=" .time(), $room_id)) { clear_cache_files(); make_json_result($sort_order); @@ -1594,8 +1593,8 @@ function room_list($id) { $filter['keyword'] = json_str_iconv($filter['keyword']); } - $filter['sort_by'] = empty($_REQUEST['sort_by']) ? 'id' : trim($_REQUEST['sort_by']); - $filter['sort_order'] = empty($_REQUEST['sort_order']) ? 'DESC' : trim($_REQUEST['sort_order']); + $filter['sort_by'] = empty($_REQUEST['sort_by']) ? 'sort_order' : trim($_REQUEST['sort_by']); + $filter['sort_order'] = empty($_REQUEST['sort_order']) ? 'ASC' : trim($_REQUEST['sort_order']); /* 关键字 */ if (!empty($filter['keyword'])) diff --git a/back/templates/room_list.htm b/back/templates/room_list.htm index bf639aa..1b53adb 100755 --- a/back/templates/room_list.htm +++ b/back/templates/room_list.htm @@ -18,7 +18,7 @@ 名稱{$sort_cname} 是否上架{$sort_is_on_sale} - + {$lang.sort_order}{$sort_sort_order} {$lang.handler} {foreach from=$room_list item=room} @@ -26,7 +26,7 @@  {$room.id} {$room.name|escape:html} - + {$room.sort_order} diff --git a/room.php b/room.php index b6c7530..4e2e711 100755 --- a/room.php +++ b/room.php @@ -23,7 +23,7 @@ if ($_REQUEST['act'] == 'list') // assign_dynamic('room'); $sql = 'SELECT * ' . ' FROM ' . $GLOBALS['ecs']->table('hs_room') . - ' WHERE enable=1 and hs_id= '.$site_id; + ' WHERE enable=1 and hs_id= '.$site_id.' order by sort_order asc'; $rooms = $GLOBALS['db']->getAll($sql); $site_name=$GLOBALS['db']->getOne("SELECT cname FROM ".$GLOBALS['ecs']->table('hs_web')." WHERE hs_id=".$site_id);