Esempio n. 1
0
 function searchBoughtAction()
 {
     $request = $this->getRequest();
     if ('POST' == $request->getMethod()) {
         $ssotoken = $this->post()->get("ssotoken");
         $key = $this->post()->get("key");
     } else {
         $ssotoken = $this->get("ssotoken");
         $key = $this->get("key");
     }
     if (!$ssotoken || !$key) {
         $this->displayJsonUdo(Common_Error::ERROR_PARAM);
     }
     //获取用户id
     $userModel = new UserModel();
     $uid = $userModel->getUserId($ssotoken);
     if (is_array($uid)) {
         $this->displayJsonUdo(Common_Error::INVALID_TOKEN, "", $uid['msg']);
     }
     $accountModel = new AccountModel();
     $bought = $accountModel->searchBought($uid, $key);
     if (!$bought) {
         $this->displayJsonUdo(Common_Error::ERROR_SUCCESS, $bought, "该条件下没有搜索结果哦~~");
     } else {
         $this->displayJsonUdo(Common_Error::ERROR_SUCCESS, $bought);
     }
 }