本文整理汇总了PHP中Db::getRow方法的典型用法代码示例。如果您正苦于以下问题:PHP Db::getRow方法的具体用法?PHP Db::getRow怎么用?PHP Db::getRow使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Db
的用法示例。
在下文中一共展示了Db::getRow方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: UpdateRouteAssignment
function UpdateRouteAssignment()
{
$arrRouteAssignment = array('varRouteId' => $_POST['txtRouteId'], 'varRouteAssignment' => $_POST['txtRouteAssignment']);
Db::execute('UPDATE routes SET assignment = :varRouteAssignment WHERE rtcode = :varRouteId', $arrRouteAssignment);
$varResult = Db::getRow('SELECT * FROM routes WHERE rtcode = ?', $arrRouteAssignment['varRouteId']);
echo 'Update Completed. Route assigned to ' . $varResult['assignment'];
}
示例2: processPayment
/**
* Process payment
* @return boolean
*/
private function processPayment()
{
$this->payment_processor = new Services_Paymill_PaymentProcessor(Configuration::get('PIGMBH_PAYMILL_PRIVATEKEY'), 'https://api.paymill.com/v2/');
$this->payment_processor->setAmount((int) round($this->context->cart->getOrderTotal(true, Cart::BOTH) * 100));
$this->payment_processor->setToken($this->token);
$this->payment_processor->setCurrency(Tools::strtolower($this->iso_currency));
$this->payment_processor->setName($this->context->customer->lastname . ', ' . $this->context->customer->firstname);
$this->payment_processor->setEmail($this->context->customer->email);
$this->payment_processor->setDescription('');
$this->payment_processor->setLogger($this);
$this->payment_processor->setSource(Configuration::get('PIGMBH_PAYMILL_VERSION') . '_prestashop_' . _PS_VERSION_);
if ($this->payment == 'creditcard') {
$sql = 'SELECT `clientId`,`paymentId` FROM `' . _DB_PREFIX_ . 'pigmbh_paymill_creditcard_userdata` WHERE `userId`=' . (int) $this->context->customer->id;
} elseif ($this->payment == 'debit') {
$sql = 'SELECT `clientId`,`paymentId` FROM `' . _DB_PREFIX_ . 'pigmbh_paymill_directdebit_userdata` WHERE `userId`=' . (int) $this->context->customer->id;
}
$user_data = $this->db->getRow($sql);
$this->payment_processor->setClientId(!empty($user_data['clientId']) ? $user_data['clientId'] : null);
if ($this->token === 'dummyToken') {
$this->payment_processor->setPaymentId(!empty($user_data['paymentId']) ? $user_data['paymentId'] : null);
}
$capture_now = true;
if ($this->payment == 'creditcard') {
$capture_now = Configuration::get('PIGMBH_PAYMILL_CAPTURE') !== 'on';
}
$result = $this->payment_processor->processPayment($capture_now);
$this->log('Payment processing resulted in', $result ? 'Success' : 'Fail');
return $result;
}
示例3: findOne
/**
* Returns one object from collection
*
* @return mixed|null
*/
public function findOne()
{
if (!$this->hasStatement('select')) {
$this->select('*');
}
$this->limit(1);
$result = null;
$sql = $this->compile();
$tbl = $this->getStatement('table');
$cache_key = OrmCache::genKey($sql, $this->values_accum);
if (($result_cached = OrmCache::getCachedQuery($cache_key)) !== false && $this->use_cache) {
return $result_cached;
}
if (($result_cached = OrmCache::getFromInternalCache($cache_key)) !== false) {
return $result_cached;
}
if ($row = Db::getRow($sql, $this->values_accum)) {
$result = Orm::collection($this->entity_name)->create($row);
}
if ($this->use_cache) {
OrmCache::cacheQuery($cache_key, $tbl['sql'], $result);
return $result;
}
OrmCache::storeInternal($cache_key, $tbl['sql'], $result);
return $result;
}
示例4: getOneFavorites
/**
* 取单个收藏的内容
*
* @param array $condition 查询条件
* @param string $field 查询字段
* @return array 数组类型的返回结果
*/
public function getOneFavorites($condition,$field='*'){
$param = array();
$param['table'] = 'favorites';
$param['field'] = array_keys($condition);
$param['value'] = array_values($condition);
return Db::getRow($param,$field);
}
示例5: getCommentRow
/**
* 获取评论详细
*
* @param $condition 查询条件
* @param $field 查询字段
*/
public function getCommentRow($condition,$field='*'){
$param = array();
$param['table'] = 'sns_comment';
$param['field'] = array_keys($condition);
$param['value'] = array_values($condition);
return Db::getRow($param,$field);
}
示例6: getSharestoreInfo
/**
* 查询分享店铺详细
*
* @param $condition 查询条件
* @param $field 查询字段
*/
public function getSharestoreInfo($condition,$field='*'){
$param = array();
$param['table'] = 'sns_sharestore';
$param['field'] = array_keys($condition);
$param['value'] = array_values($condition);
return Db::getRow($param,$field);
}
示例7: getProject
function getProject($projectId)
{
if (is_numeric($projectId)) {
return Db::getRow('SELECT * FROM projects WHERE id = ?', $projectId);
}
return false;
}
示例8: postAuth
/**
* @url POST
*/
function postAuth($email, $password)
{
//validate email and password
$statement = 'SELECT userId, hash, role, nickname, notificationCount, avatarId, status FROM user where email = :email';
$bind = array('email' => $email);
$user = \Db::getRow($statement, $bind);
\TTOMail::createAndSendAdmin('A user is logging in', json_encode($bind));
if (password_verify($password, $user['hash'])) {
//generate token
$token = md5(uniqid(mt_rand(), true));
//update token to db
$statement = 'UPDATE user SET token = :token WHERE userId = :userId';
$bind = array('token' => $token, 'userId' => $user['userId']);
\Db::execute($statement, $bind);
//then return token
$response = new \stdClass();
$response->userId = $user['userId'];
$response->token = $token;
$response->role = $user['role'];
$response->nickname = $user['nickname'];
$response->notificationCount = $user['notificationCount'];
$response->avatarId = $user['avatarId'];
$response->status = $user['status'];
return $response;
} else {
throw new RestException(401, 'Invalid email or password !!!');
}
}
示例9: getRowByCondition
/**
* 读取支付方式信息by Condition
*
* @param
* @return array 数组格式的返回结果
*/
public function getRowByCondition($conditionfield,$conditionvalue){
$param = array();
$param['table'] = 'payment';
$param['field'] = $conditionfield;
$param['value'] = $conditionvalue;
$result = Db::getRow($param);
return $result;
}
示例10: getProductName
/**
* @param Db $db
* @param unknown_type $id_product
*/
public function getProductName($db, $id_product)
{
$res = $db->getRow("SELECT name FROM ps_product_lang WHERE id_product = " . $id_product);
if (!$res) {
return "";
}
return $res['name'];
}
示例11: getoneOrderGoods
public function getoneOrderGoods($rec_id)
{
$param = array();
$param['table'] = 'order_goods';
$param['field'] = 'rec_id';
$param['value'] = intval($rec_id);
return Db::getRow($param);
}
示例12: getOneByCode
/**
* 根据标识码查询一条
*
* @param unknown_type $id
*/
public function getOneByCode($code){
$param = array(
'table' => 'document',
'field' => 'doc_code',
'value' => $code
);
return Db::getRow($param);
}
示例13: getoneComplainGoods
public function getoneComplainGoods($complain_goods_id)
{
$param = array();
$param['table'] = 'complain_goods';
$param['field'] = 'complain_goods_id';
$param['value'] = intval($complain_goods_id);
return Db::getRow($param);
}
示例14: getRow
/**
* 读取记录
*
* @param
* @return array 数组格式的返回结果
*/
public function getRow($theme_id)
{
$param = array();
$param['table'] = 'store_theme';
$param['field'] = 'theme_id';
$param['value'] = $theme_id;
$result = Db::getRow($param);
return $result;
}
示例15: getRow
/**
* 读取记录
*
* @param
* @return array 数组格式的返回结果
*/
public function getRow($log_id)
{
$param = array();
$param['table'] = 'refund_log';
$param['field'] = 'log_id';
$param['value'] = $log_id;
$result = Db::getRow($param);
return $result;
}