Example #1
0
 public function getUserDataById($id)
 {
     $sql = "select * from user where id = ? limit 1";
     $id = WeFlex_Db::Quote($id, Zend_Db::INT_TYPE);
     $rtn = WeFlex_Db::Query($sql, $id);
     if (empty($rtn) || count($rtn) == 0) {
         return null;
     }
     return $rtn[0];
 }
Example #2
0
 private function _myReTokenCourse($id)
 {
     //customer don't wanna this
     return false;
     $user = TCVM_User_Factory::Factory()->getLoginedUser();
     if (!$user) {
         throw new Exception("sorry, you are not login");
     }
     $sql = "SELECT `order`.id\n\t\t\t\t\tFROM  `order` \n\t\t\t\t\tLEFT JOIN order_product ON `order`.id = order_product.order_id\n\t\t\t\t\tWHERE `order`.user_id = " . WeFlex_Db::QuoteInto("?", $user["id"]) . "\n\t\t\t\t\tAND order_product.product_id = " . WeFlex_Db::QuoteInto("?", $id) . " AND `order`.status = " . TCVM_Order_Imple::STATUS_SUCCESS;
     $rtn = WeFlex_Db::Query($sql);
     if (!empty($rtn)) {
         return true;
     } else {
         return false;
     }
 }