protected function ajaxExecute(MUser $me, MShop $shop) { $cid = MRequest::post('cid'); $ps = (int) MRequest::post('ps'); $pn = (int) MRequest::post('pn'); $ps = max(0, $ps); if (!$pn) { $pn = 20; } try { $itemlist = $shop->getShopItems($cid, $ps, $pn); $foundrows = $shop->totalCount(); } catch (Exception $e) { return MJsonRespond::respondFail('获取商品列表失败'); } return MJsonRespond::respondSuccess('成功', array('itemlist' => $itemlist, 'total' => $foundrows)); }