本文整理汇总了PHP中Core::query方法的典型用法代码示例。如果您正苦于以下问题:PHP Core::query方法的具体用法?PHP Core::query怎么用?PHP Core::query使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Core
的用法示例。
在下文中一共展示了Core::query方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getGoodsinfo
public function getGoodsinfo()
{
$goodsinfos = array();
$db = new Core();
$query = "SELECT g.*,\n gv.field as gvkey,\n gv.value as gvvalue,\n o.telphone as mobile,\n o.order_quantity as goods_number,\n o.goods_value as goods_value\n FROM " . DB_PREFIX . "goodslist g\n LEFT JOIN " . DB_PREFIX . "order o \n ON g.order_id=o.id\n LEFT JOIN " . DB_PREFIX . "goodsextensionvalue gv \n ON g.order_id=gv.id\n WHERE \n 1\n and o.order_id='" . $this->order_id . "'";
$mresult = $db->query($query);
if (!$mresult) {
$this->BundleGoods = $goodsinfos;
return;
}
foreach ($mresult as $result) {
$goods = json_decode(urldecode($result['extensions']), 1);
$goods['goods_number'] = $result['goods_number'];
$goods['goods_value'] = $result['goods_value'];
//$goods['mobile'] = $result['mobile'];
if ($result['gvkey'] == 'session') {
$goods['session'] = $result['gvvalue'];
}
$goodsinfos[$result['bundle_id']]['goods'][] = $goods;
}
//file_put_contents('./cache/mobile.txt',var_export($result,1));
$query = "SELECT *\n FROM " . DB_PREFIX . "order \n \n WHERE \n 1\n and order_id='" . $this->order_id . "'";
$re = $db->query($query, '');
$this->mobile = $re[0]['telphone'];
// = '18021806556';
$this->BundleGoods = $goodsinfos;
}
示例2: overdueproceess
public function overdueproceess()
{
$time = 2100;
//过期时间
$db = new Core();
/**
* 查询与订单号相关的商品,订单中相关信息如积分等
*/
$query = "SELECT \n \t g.*,\n \t o.order_id as new_order_id,\n \t o.pay_credits as pay_credits,\n \t o.user_id as user_id,\n \t\t o.integral_status as integral_status\n \t FROM " . DB_PREFIX . "goodslist g\n LEFT JOIN " . DB_PREFIX . "order o\n ON g.order_id=o.id\n WHERE o.pay_status = 1 \n and o.create_time<" . (time() - $time) . " limit 0,100";
$goodses = $db->query($query);
if (!$goodses) {
return;
}
$ids = array();
$newgoodses = array();
foreach ($goodses as $goods) {
$newgoodses[$goods['bundle_id']]['goods'][$goods['goods_id']]['id'] = $goods['goods_id'];
$newgoodses[$goods['bundle_id']]['goods'][$goods['goods_id']]['goods_number'] += $goods['goods_number'];
$newgoodses[$goods['bundle_id']]['goods'][$goods['goods_id']]['bundle_id'] = $goods['bundle_id'];
$ids[] = $goods['order_id'];
$credits[$goods['user_id']]['id'] = $goods['order_id'];
$credits[$goods['user_id']]['order_id'] = $goods['new_order_id'];
$credits[$goods['user_id']]['credit'] = $goods['pay_credits'];
$credits[$goods['user_id']]['integral_status'] = $goods['integral_status'];
//积分的状态
}
$this->BundleGoods = $newgoodses;
foreach ($newgoodses as $bundle_id => $bundlegoodses) {
$curl = $bundle_id . "curl";
$this->{$curl} = $this->create_curl_obj($bundle_id);
$this->init_curl($bundle_id);
//$Re_Minus_updateStores = $this -> opBundle('updateStore', array('operation' => 'plus'));
}
$Re_Minus_updateStores = $this->opBundle('updateStore', array('operation' => 'plus'));
$orderids = implode(",", $ids);
if (!$orderids) {
return false;
}
require_once CUR_CONF_PATH . 'lib/sms.class.php';
require_once ROOT_PATH . 'lib/class/members.class.php';
$members = new members();
foreach ($credits as $user => $v) {
if (!$v['credit']) {
continue;
}
$re = $members->return_credit($user, $v['credit'], $v['order_id'], 'payments', 'OrderUpdate', 'cancle', '订单:' . $v['order_id'] . '被系统取消:' . $v['title'], $v['integral_status'], '取消订单');
if (!$re['logid']) {
return false;
}
}
$query = "UPDATE " . DB_PREFIX . "order \n SET order_status=24,pay_status=3,is_completed=23\n WHERE pay_status=1 and id in(" . $orderids . ")";
$result = $db->query_update($query);
}
示例3: trim
*
* @category Ajax
* @package LeQG
* @author Damien Senger <hi@hiwelo.co>
* @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License 3.0
* @link http://leqg.info
*/
// On lance la création de la campagne
if (isset($_GET)) {
// On récupère les données
$user = User::ID();
// On crée la nouvelle mission en récupérant l'identifiant créé
$campagne = Campaign::create("email");
// On tâche de récupérer la liste des contacts concernés par l'envoi
$var = $_GET;
// On retraite les critères complexes
$var['criteres'] = trim($var['criteres'], ';');
// On charge les identifiants des fiches correspondantes
$contacts = People::listing($var, 0, false);
// On prépare la requête d'ajout des destinataires
$query = Core::query('campagne-destinataires');
// On enregistre les contacts concernés
foreach ($contacts as $contact) {
$query->bindParam(':campagne', $campagne, PDO::PARAM_INT);
$query->bindParam(':contact', $contact, PDO::PARAM_INT);
$query->execute();
}
echo $campagne;
} else {
http_response_code(403);
}
示例4: tasks
/**
* Tasks to come, by deadline
*
* @param integer $user User ID related, if asked
*
* @return array
*/
public static function tasks($user = null)
{
if (is_null($user)) {
$query = Core::query('tasks-all');
$query->execute();
} else {
$query = Core::query('tasks');
$query->bindValue(':user', $user, PDO::PARAM_INT);
$query->execute();
}
if ($query->rowCount()) {
return $query->fetchAll(PDO::FETCH_ASSOC);
} else {
return false;
}
}
示例5: all
/**
* List of all folders
*
* @param integer $status Status of asked folders (1 open 0 close)
*
* @return array
* @static
**/
public static function all($status = 1)
{
$query = Core::query('folder-all');
$query->bindValue(':status', $status, PDO::PARAM_INT);
$query->execute();
return $query->fetchAll(PDO::FETCH_ASSOC);
}
示例6: sending
/**
* Email sending method
*
* @param integer $campaign Campaign ID
* @param string $email Recipient's email
*
* @return void
* @static
**/
public static function sending(int $campaign, string $email)
{
// campaign data
$campaign = new Campaign($campaign);
// recipient data
$query = Core::query('contact-by-email');
$query->bindValue(':coord', $email);
$query->execute();
$data = $query->fetch(PDO::FETCH_NUM);
$person = new People($data[0]);
unset($data);
$mail = $campaign->get('mail');
$replace = array('mail-optout.php?test' => 'mail-optout.php?email=' . md5($email));
$mail = strtr($mail, $replace);
$to = array(array('email' => $email, 'name' => $person->display_name(), 'type' => 'to'));
$message = array('html' => $mail, 'subject' => $campaign->get('objet'), 'from_email' => Configuration::read('mail.sender.mail'), 'from_name' => Configuration::read('mail.sender.name'), 'headers' => array('Reply-To' => Configuration::read('mail.replyto')), 'to' => $to, 'track_opens' => true, 'auto_text' => true, 'subaccount' => Configuration::read('client'));
$async = true;
$mandrill = Configuration::read('mail');
$result = $mandrill->messages->send($message, $async);
// we parse mail sending result
$result = $result[0];
// we save result data
$query = Core::query('tracking-update');
$query->bindValue(':campaign', $campaign->get('id'), PDO::PARAM_INT);
$query->bindValue(':email', $result['email']);
$query->bindValue(':id', $result['_id']);
$query->bindValue(':status', $result['status']);
$query->bindValue(':reject', $result['reject_reason']);
$query->execute();
}
示例7: create
/**
* Create a new template
*
* @return integer
* @static
*/
public static function create()
{
$user = User::ID();
$query = Core::query('template-create');
$query->bindParam(':user', $user);
$query->execute();
return Configuration::read('db.link')->lastInsertId();
}
示例8: People
$query = $link->prepare($query);
$query->bindParam(':id', $_POST['adresse']);
$query->execute();
$adresse = $query->fetch(PDO::FETCH_ASSOC);
$adresse = $adresse['coordonnee_email'];
// On ouvre la fiche du contact concerné
$contact = new People($_POST['contact']);
// On charge le système de mail
$mail = Configuration::read('mail');
// On prépare le message
$message = array('html' => nl2br($_POST['message']), 'subject' => $_POST['objet'], 'from_email' => Configuration::read('mail.sender.mail'), 'from_name' => Configuration::read('mail.sender.name'), 'to' => array(array('email' => $adresse, 'name' => $contact->get('nom_complet'), 'type' => 'to')), 'headers' => array('Reply-To' => Configuration::read('mail.replyto')), 'track_opens' => true, 'auto_text' => true, 'subaccount' => Configuration::read('client'));
// mode asynchrone d'envoi du mail
$async = true;
// on lance l'envoi du mail
$result = $mail->messages->send($message, $async);
// On met à jour le tracking avec les informations retournées
$campaign = 0;
$query = Core::query('campaign-tracking');
$query->bindValue(':campaign', $campaign, PDO::PARAM_INT);
$query->bindValue(':id', $result[0]['_id']);
$query->bindValue(':email', $result[0]['email']);
$query->bindValue(':status', $result[0]['status']);
$query->execute();
$event = Event::create($contact->get('id'));
$event = new Event($event);
$event->update('historique_type', 'courriel');
$event->update('historique_objet', $_POST['objet']);
$event->update('historique_notes', $_GET['message']);
} else {
return false;
}
示例9: uniqid
$nomFichier = 'export-' . User::ID() . '-' . uniqid() . '.csv';
$file = fopen('exports/' . $nomFichier, 'w+');
$entete = ['nom', 'nom_usage', 'prenoms', 'sexe', 'date_naissance', 'age', 'adresse declaree', 'adresse electorale', 'bureau', 'ville', 'electeur', 'electeur_europeen', 'electeur_municipales', 'organisme', 'fonction', 'tags'];
fputcsv($file, $entete, ';', '"');
foreach ($contacts as $_contact) {
$contact = new People($_contact);
$address = $contact->postal_address();
$poll = Maps::pollData($contact->get('bureau'));
$birthdate = new DateTime($contact->get('date_naissance'));
$_fichier = array($contact->get('nom'), $contact->get('nom_usage'), $contact->get('prenoms'), $contact->get('sexe'), $birthdate->format('d/m/Y'), $contact->age(), $address['reel'], $address['officiel'], $poll['number'], $poll['city'], $contact->get('electeur'), $contact->get('electeur_europeen'), $contact->get('electeur_municipales'), $contact->get('organisme'), $contact->get('fonction'), implode(',', $contact->get('tags')));
fputcsv($file, $_fichier, ';', '"');
}
// On retraite le nom du fichier
$f = 'exports/' . $nomFichier;
if ($f) {
$email = file_get_contents('tpl/mail/export-reussi.tpl.html');
$objet = '[LeQG] Votre export est prêt à être téléchargé';
$email = strtr($email, array('{URL}' => 'http://' . Configuration::read('url') . $f));
} else {
$email = file_get_contents('tpl/mail/export-echec.tpl.html');
$objet = '[LeQG] Votre export a provoqué un erreur';
}
$query = Core::query('user-data', 'core');
$query->bindValue(':user', User::ID());
$query->execute();
$data = $query->fetch(PDO::FETCH_ASSOC);
$service = Configuration::read('mail');
$to = array(array('email' => $data['email'], 'name' => $data['firstname'] . ' ' . $data['lastname'], 'type' => 'to'));
$mail = array('html' => $email, 'subject' => $objet, 'from_email' => 'serveur@leqg.info', 'from_name' => 'LeQG.info', 'to' => $to, 'headers' => array('Reply-To' => 'tech@leqg.info'), 'track_opens' => true, 'auto_text' => true);
$async = true;
$service->messages->send($mail, $async);
示例10: ajoutRue
/**
* Add a street in this mission
*
* @param integer $rue street id
*
* @return boolean
*/
public function ajoutRue(int $rue)
{
// On effectue une recherche de tous les immeubles contenus
$query = Core::query('building-by-street');
$query->bindValue(':street', $rue, PDO::PARAM_INT);
$query->execute();
// S'il y a des immeubles
if ($query->rowCount()) {
// On récupère la liste des identifiants
$immeubles = $query->fetchAll(PDO::FETCH_NUM);
// Si la mission est un porte à porte,
// on cherche les électeurs concernés
if ($this->_data['mission_type'] == 'porte') {
// Pour chaque immeuble, on recherche tous les électeurs
foreach ($immeubles as $immeuble) {
$query = Core::query('people-by-building');
$query->bindValue(':building', $immeuble[0], PDO::PARAM_INT);
$query->execute();
$contacts = $query->fetchAll(PDO::FETCH_NUM);
// Pour chaque électeur, on créé une porte à frapper
foreach ($contacts as $contact) {
$query = Core::query('item-new');
$query->bindParam(':mission', $this->_data['mission_id'], PDO::PARAM_INT);
$query->bindParam(':rue', $rue, PDO::PARAM_INT);
$query->bindParam(':immeuble', $immeuble[0], PDO::PARAM_INT);
$query->bindParam(':contact', $contact[0], PDO::PARAM_INT);
$query->execute();
}
}
} else {
foreach ($immeubles as $immeuble) {
$query = Core::query('item-boitage-new');
$query->bindParam(':mission', $this->_data['mission_id'], PDO::PARAM_INT);
$query->bindParam(':rue', $rue, PDO::PARAM_INT);
$query->bindParam(':immeuble', $immeuble[0], PDO::PARAM_INT);
$query->execute();
}
}
} else {
return false;
}
}
示例11: addressNew
/**
* Create a new address for a contact
*
* @param integer $person Person ID
* @param integer $city City ID
* @param integer $zipcode Zipcode ID
* @param integer $street Street ID
* @param integer $building Building ID
* @param string $type Address type
*
* @return integer
* @static
*/
public static function addressNew(int $person, int $city, int $zipcode, int $street, int $building, $type = 'reel')
{
$query = Core::query('address-new');
$query->bindValue(':people', $person, PDO::PARAM_INT);
$query->bindValue(':type', $type);
$query->bindValue(':city', $city, PDO::PARAM_INT);
$query->bindValue(':zipcode', $zipcode, PDO::PARAM_INT);
$query->bindValue(':street', $street, PDO::PARAM_INT);
$query->bindValue(':building', $building, PDO::PARAM_INT);
$query->execute();
}
示例12: foreach
<?php
/**
* Sending email cron job
*
* PHP version 5
*
* @category Cron
* @package LeQG
* @author Damien Senger <hi@hiwelo.co>
* @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License 3.0
* @link http://leqg.info
*/
$query = Core::query('tracking-to-send');
$query->execute();
if ($query->rowCount()) {
$emails = $query->fetchAll(PDO::FETCH_ASSOC);
foreach ($emails as $email) {
Campaign::sending($email['campaign'], $email['email']);
}
}
示例13: Core
<?php
require './global.php';
require_once CUR_CONF_PATH . 'core/Core.class.php';
require_once CUR_CONF_PATH . 'lib/sms.class.php';
if (!isset($_REQUEST['out_trade_no'])) {
return false;
}
if (!$_REQUEST['out_trade_no']) {
return false;
}
$out_trade_no = $_REQUEST['out_trade_no'];
$db = new Core();
$query = "SELECT * FROM " . DB_PREFIX . "order \n WHERE \n pay_status=1 \n and order_id='" . $_REQUEST['out_trade_no'] . "'";
$query = "SELECT * FROM " . DB_PREFIX . "order \n WHERE \n order_id='" . $_REQUEST['out_trade_no'] . "'";
$result = $db->query($query, '');
if (!$result) {
return false;
}
/**
* 1.money 2.credits 3.money+credits
*/
$paymethod = $result[0]['paymethod'];
$payprocess = $result[0]['payprocess'];
$payprocess |= 2;
if ($payprocess == $paymethod) {
$params['order_status'] = 25;
//支付完成
$params['pay_status'] = 2;
//支付完成
$params['integral_status'] = (int) $_REQUEST['integral_status'];
示例14:
<?php
require_once 'includes.php';
$query = Core::query('campaign-data-md5');
$query->bindValue(':campaign', $_SERVER['QUERY_STRING']);
$query->execute();
$data = $query->fetch(PDO::FETCH_ASSOC);
?>
<!doctype html>
<html lang="fr">
<head>
<meta charset="utf-8">
<title><?php
echo $data['objet'];
?>
</title>
</head>
<body style="padding: 0; margin: 0;">
<?php
echo $data['mail'];
?>
</body>
</html>
示例15: ucfirst
<ul class="formulaire">
<li>
<label for="rechercheCodePostalDebut" class="small">Code postal de démarrage</label>
<span class="form-icon decalage search"><input type="text" name="rechercheCodePostalDebut" id="rechercheCodePostalDebut" placeholder="Code postal de début de la séquence recherchée"></span>
</li>
<li>
<label for="rechercheCodePostalFin" class="small">Code postal final</label>
<span class="form-icon decalage search"><input type="text" name="rechercheCodePostalFin" id="rechercheCodePostalFin" placeholder="Code postal de fin de la séquence recherchée"></span>
</li>
<li>
<label for="rechercheCodePostalPays" class="small">Pays concerné</label>
<span class="form-icon search">
<label class="sbox" for="rechercheCodePostalPays">
<select name="rechercheCodePostalPays" id="rechercheCodePostalPays">
<?php
$query = Core::query('country-approuved');
$query->execute();
$countries = $query->fetchAll(PDO::FETCH_ASSOC);
foreach ($countries as $country) {
?>
<option value="<?php
echo $country['id'];
?>
"><?php
echo ucfirst(strtolower($country['country']));
?>
</option>
<?php
}
?>
</select>