本文整理汇总了PHP中app::get方法的典型用法代码示例。如果您正苦于以下问题:PHP app::get方法的具体用法?PHP app::get怎么用?PHP app::get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app
的用法示例。
在下文中一共展示了app::get方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: send
/**
* send
* 必有方法,发送时调用.
*
* config参数为getOptions取得的所有项的配置结果
*
* @param mixed $target ['email']
* @param mixed $title
* @param mixed $config
*/
public function send($target, $title, $content, $config)
{
logger::debug(__CLASS__ . var_export(func_get_args(), 1));
$new_msg = array('member_id' => $target['member_id'], 'target' => $target['email'], 'subject' => $title, 'content' => $content, 'createtime' => time(), 'msg_type' => 'email', 'status' => 'sent');
app::get('b2c')->model('member_msg')->save($new_msg);
if (!($email_to = $target['email'])) {
return false;
}
if ($config['sendway'] == 'mail') {
$this->email = vmc::singleton('desktop_email_email');
}
$this->email->Sender = $this->Sender = $config['usermail'];
$this->email->Subject = $this->Subject = $this->email->inlineCode($title);
$From = $this->email->inlineCode(app::get('site')->getConf('site_name')) . '<' . $config['usermail'] . '>';
$header = array('Return-path' => '<' . $config['usermail'] . '>', 'Date' => date('r'), 'From' => $From, 'MIME-Version' => '1.0', 'Subject' => $this->Subject, 'To' => $email_to, 'Content-Type' => 'text/html; charset=UTF-8; format=flowed', 'Content-Transfer-Encoding' => 'base64');
$body = chunk_split(base64_encode($content));
$header = $this->email->buildHeader($header);
$config['sendway'] = $config['sendway'] ? $config['sendway'] : 'smtp';
switch ($config['sendway']) {
case 'sendmail':
$result = $this->email->SendmailSend($email_to, $header, $body);
break;
case 'mail':
$result = $this->email->MailSend($email_to, $header, $body);
break;
case 'smtp':
$result = $this->email->SmtpSend($email_to, $header, $body, $config);
break;
default:
$result = false;
break;
}
return $result;
}
示例2: _views
/**
* 退款单view 列表
* @param null
* @return null
*/
public function _views()
{
$mdl_refunds = $this->app->model('refunds');
$sub_menu = array(0 => array('label' => app::get('b2c')->_('退款中'), 'optional' => false, 'filter' => array('status' => array('progress'), 'disabled' => 'false')), 1 => array('label' => app::get('b2c')->_('失败'), 'optional' => false, 'filter' => array('status' => array('failed'), 'disabled' => 'false')), 2 => array('label' => app::get('b2c')->_('成功'), 'optional' => false, 'filter' => array('status' => array('succ'), 'disabled' => 'false')), 3 => array('label' => app::get('b2c')->_('全部'), 'optional' => false, 'filter' => array('disabled' => 'false')));
if (isset($_GET['optional_view'])) {
$sub_menu[$_GET['optional_view']]['optional'] = false;
}
foreach ($sub_menu as $k => $v) {
if ($v['optional'] == false) {
$show_menu[$k] = $v;
if (is_array($v['filter'])) {
$v['filter'] = array_merge(array(), $v['filter']);
} else {
$v['filter'] = array();
}
$show_menu[$k]['filter'] = $v['filter'] ? $v['filter'] : null;
if ($k == $_GET['view']) {
$show_menu[$k]['newcount'] = true;
$show_menu[$k]['addon'] = $mdl_refunds->count($v['filter']);
}
$show_menu[$k]['href'] = 'index.php?app=ectools&ctl=admin_refund&act=index&view=' . $k . (isset($_GET['optional_view']) ? '&optional_view=' . $_GET['optional_view'] . '&view_from=dashboard' : '');
} elseif ($_GET['view_from'] == 'dashboard' && $k == $_GET['view']) {
$show_menu[$k] = $v;
}
}
return $show_menu;
}
示例3: detail
/**
* 结算明细
* @return
*/
public function detail()
{
$this->contentHeaderTitle = app::get('topshop')->_('企业结算明细');
$filter['shop_id'] = $this->shopId;
$postSend = input::get();
if ($postSend['timearea']) {
$pagedata['timearea'] = $postSend['timearea'];
$timeArray = explode('-', $postSend['timearea']);
$filter['settlement_time|than'] = strtotime($timeArray[0]);
$filter['settlement_time|lthan'] = strtotime($timeArray[1]);
} else {
$filter['settlement_time|than'] = time() - 3600 * 24 * 7;
$filter['settlement_time|lthan'] = time();
$pagedata['timearea'] = date('Y/m/d', time() - 3600 * 24 * 7) . '-' . date('Y/m/d', time());
}
if ($postSend['settlement_type']) {
$filter['settlement_type'] = $postSend['settlement_type'];
$pagedata['settlement_type'] = $postSend['settlement_type'];
}
//处理翻页数据
$pagedata['page'] = $page = $postSend['page'] ? $postSend['page'] : 1;
$pagedata['limits'] = $pageLimit = 10;
$objMdlSettleDetail = app::get('sysclearing')->model('settlement_detail');
$pagedata['settlement_detail_list'] = $objMdlSettleDetail->getList('*', $filter, ($page - 1) * $pageLimit, $pageLimit, 'settlement_time desc');
$count = $objMdlSettleDetail->count($filter);
$postSend['token'] = time();
if ($count > 0) {
$total = ceil($count / $pageLimit);
}
$pagedata['pagers'] = array('link' => url::action('topshop_ctl_clearing_settlement@detail', $postSend), 'current' => $page, 'total' => $total, 'token' => $postSend['token']);
return $this->page('topshop/clearing/settlement_detail.html', $pagedata);
}
示例4: getPaymentId
public function getPaymentId($filter)
{
$tids = $filter['tid'];
if ($filter['tid'] && is_array($filter['tid'])) {
$tids = implode(',', $filter['tid']);
}
$tradeParams = array('user_id' => $filter['user_id'], 'tid' => $tids, 'fields' => 'tid,payment,user_id,status');
//获取需要支付的订单并检测其有效性
$tradeList = app::get('topc')->rpcCall('trade.get.list', $tradeParams);
$count = $tradeList['count'];
$tradeList = $tradeList['list'];
$countid = count($filter['tid']);
if ($countid != $count) {
throw new \LogicException(app::get('topc')->_("支付失败,提交的订单数据有误"));
return false;
}
foreach ($tradeList as $key => $value) {
if ($value['status'] != "WAIT_BUYER_PAY") {
throw new \LogicException(app::get('topc')->_($value['tid'] . " 订单已被支付,请重新选择要支付订单"));
return false;
}
$payment['money'] += $value['payment'];
$payment['user_id'] = $value['user_id'];
}
$payment['tids'] = $tids;
try {
$paymentId = app::get('topc')->rpcCall('payment.bill.create', $payment);
} catch (Exception $e) {
throw $e;
}
return $paymentId;
}
示例5: clear_by_app
function clear_by_app($app_id)
{
if (!$app_id) {
return false;
}
app::get('desktop')->model('menus')->delete(array('app_id' => $app_id, 'menu_type' => $this->content_typename()));
}
示例6: get_encrypted
/**
* 获取加密类型后的密文
* @param string $source_str 加密明文
* @return string 返回加密密文
*/
public function get_encrypted($source_str, $account_type, $userdata = null)
{
if (!$userdata) {
return md5($source_str);
}
if ($userdata['createtime']) {
return $this->extends_md5($source_str, $userdata['login_name'], $userdata['createtime']);
} else {
if ($account_type == 'member') {
$pam_members_model = app::get('pam')->model('members');
$pam_filter = array('login_account' => $userdata['login_name']);
$rows = $pam_members_model->getList('*', $pam_filter, 0, 1);
// 商家 2015/8/31
} else {
if ($account_type == 'seller') {
$pam_model = app::get('pam')->model('seller');
$pam_filter = array('login_account' => $userdata['login_name']);
$rows = $pam_model->getList('*', $pam_filter, 0, 1);
} else {
$pam_account_model = app::get('pam')->model('account');
$pam_filter = array('login_name' => $userdata['login_name'], 'account_type' => $account_type, 'disabled' => 'false');
$rows = $pam_account_model->getList('*', $pam_filter, 0, 1);
}
}
if ($rows[0]) {
if (substr($rows[0]['login_password'], 0, 1) !== 's') {
return md5($source_str);
} else {
return $this->extends_md5($source_str, $userdata['login_name'], $rows[0]['createtime']);
}
} else {
return false;
}
}
}
示例7: update
public function update($params)
{
$db = app::get('sysaftersales')->database();
$db->beginTransaction();
try {
$data['money'] = $params['money'];
$data['cur_money'] = $params['cur_money'];
$filter['payment_id'] = $params['payment_id'];
$objMdlPayment = app::get('ectools')->model('payments');
$objMdlPayBill = app::get('ectools')->model('trade_paybill');
$result = $objMdlPayment->update($data, $filter);
if (!$result) {
throw new Exception('更新支付单失败');
}
$trade_own_money = json_decode($params['trade_own_money'], true);
foreach ($trade_own_money as $key => $val) {
$billdata['payment'] = $val;
$billdata['modified_time'] = time();
$billfilter['tid'] = $key;
$billfilter['payment_id'] = $params['payment_id'];
$result = $objMdlPayBill->update($billdata, $billfilter);
if (!$result) {
throw new Exception('更新支付单失败');
}
}
$db->commit();
} catch (Exception $e) {
$db->rollback();
throw $e;
}
return true;
}
示例8: getList
public function getList($params)
{
$catIds = explode(',', $params['cat_id']);
$row = "cat_id,parent_id,cat_path,level,cat_name,child_count";
if ($params['fields']) {
$row = $params['fields'];
$row = str_append($row, 'level,parent_id');
}
$db = app::get('syscategory')->database();
$data = array();
foreach ($catIds as $catId) {
$cat = $db->executeQuery('SELECT ' . $row . ' FROM syscategory_cat WHERE cat_id=' . $catId . ' or cat_path LIKE "%,' . $catId . ',%"');
foreach ($cat as $value) {
if ($value['level'] == '1') {
$data[$value['cat_id']] = $value;
} elseif ($value['level'] == '2') {
$lv2[$value['parent_id']][$value['cat_id']] = $value;
} elseif ($value['level'] == '3') {
$lv3[$value['parent_id']][$value['cat_id']] = $value;
}
}
}
if (!$data) {
throw new \LogicException('参数cat_id必须为一级类目id');
}
foreach ($data as $catId => $val) {
foreach ($lv2[$catId] as $k => $v) {
$lv2[$catId][$k]['lv3'] = $lv3[$k];
}
$data[$catId]['lv2'] = $lv2[$catId];
}
return $data;
}
示例9: get_last_modify
public static function get_last_modify()
{
if (!isset(self::$__last_modified)) {
self::$__last_modified = app::get('wap')->getConf('widgets_css_last_modify');
}
return self::$__last_modified;
}
示例10: callback
public function callback(&$recv)
{
$objMath = kernel::single('ectools_math');
$money = $objMath->number_multiple(array($recv['orderAmount'], 0.01));
$merid = $this->getConf('mer_id', substr(__CLASS__, 0, strrpos(__CLASS__, '_')));
$mer_key = $this->getConf('mer_key', substr(__CLASS__, 0, strrpos(__CLASS__, '_')));
$sign = $recv['signature'];
$sign_method = $recv['signMethod'];
$arrs = array("version" => $recv['version'], "charset" => $recv['charset'], "transType" => $recv['transType'], "respCode" => $recv['respCode'], "respMsg" => $recv['respMsg'], "merAbbr" => $recv['merAbbr'], "merId" => $recv['merId'], "orderNumber" => $recv['orderNumber'], "traceNumber" => $recv['traceNumber'], "traceTime" => $recv['traceTime'], "qid" => $recv['qid'], "orderAmount" => $recv['orderAmount'], "orderCurrency" => $recv['orderCurrency'], "respTime" => $recv['respTime'], "settleCurrency" => $recv['settleCurrency'], "settleDate" => $recv['settleDate'], "settleAmount" => $recv['settleAmount'], "exchangeDate" => $recv['exchangeDate'], "exchangeRate" => $recv['exchangeRate'], "cupReserved" => $recv['cupReserved']);
$chkvalue = $this->sign($arrs, $sign_method, $mer_key);
$ret['payment_id'] = $arrs['orderNumber'];
$ret['account'] = $arrs['merId'];
$ret['bank'] = app::get('ectools')->_('银联');
$ret['pay_account'] = app::get('ectools')->_('付款帐号');
$ret['currency'] = 'CNY';
$ret['money'] = $money;
$ret['paycost'] = '0.000';
$ret['cur_money'] = $money;
$ret['tradeno'] = $recv['traceNumber'];
// $ret['t_payed'] = strtotime($recv['settleDate']) ? strtotime($recv['settleDate']) : time();
$ret['t_payed'] = time();
$ret['pay_app_id'] = 'unionpay';
$ret['pay_type'] = 'online';
$ret['memo'] = 'unionpay';
if ($sign == $chkvalue && $recv['respCode'] == 00) {
$ret['status'] = 'succ';
} else {
$ret['status'] = 'failed';
}
return $ret;
}
示例11: getData
/**
* 获取单笔交易数据
*
* @param array $params 接口传入参数
* @return array
*/
public function getData($params, $oauth)
{
if (isset($oauth['shop_id'])) {
$filter['shop_id'] = $oauth['shop_id'];
} else {
if ($params['oauth']['account_id'] && $params['oauth']['auth_type'] == "member") {
$filter['user_id'] = $params['oauth']['account_id'];
} elseif ($params['oauth']['account_id'] && $params['oauth']['auth_type'] == "shop") {
$sellerId = $params['oauth']['account_id'];
$filter['shop_id'] = app::get('systrade')->rpcCall('shop.get.loginId', array('seller_id' => $this->sellerId), 'seller');
}
}
if ($params['oid']) {
$params['oid'] = explode(',', $params['oid']);
}
$tradeInfo = kernel::single('systrade_getTradeData')->getTradeInfo($params['fields'], $params['tid'], $params['oid'], $filter);
if ($tradeInfo['dlytmpl_id']) {
$dlytmpl = app::get('systrade')->rpcCall('logistics.dlytmpl.get', ['template_id' => $tradeInfo['dlytmpl_id'], 'fields' => 'corp_id,name']);
$corptmpl = app::get('systrade')->rpcCall('logistics.dlycorp.get', ['corp_id' => $dlytmpl['corp_id'], 'fields' => 'corp_code,corp_name']);
$tradeInfo['dlytmpl_name'] = $dlytmpl['name'];
$tradeInfo['corptmpl_name'] = $corptmpl['corp_name'];
$tradeInfo['corptmpl_code'] = $corptmpl['corp_code'];
}
//这里判断货到付款
//现在判断货到付款在订单里没有字段标示,所以采用两个字段相结合,就是支付为线下支付且订单状态是待支付的时候,就判断为货到付款
if ($tradeInfo['pay_type'] == "offline" && $tradeInfo['type'] == "WAIT_SELLER_SEND_GOODS") {
$tradeInfo['is_cod'] = "true";
} else {
$tradeInfo['is_cod'] = "false";
}
$tradeInfo = $this->__paramsToString($tradeInfo);
return $tradeInfo;
}
示例12: _process
function _process($all_settings)
{
$setting = new base_setting($this->app);
$setlib = $setting->source();
$typemap = array(SET_T_STR => 'text', SET_T_INT => 'number', SET_T_ENUM => 'select', SET_T_BOOL => 'bool', SET_T_TXT => 'text', SET_T_FILE => 'file', SET_T_IMAGE => 'image', SET_T_DIGITS => 'number');
$tabs = array_keys($all_settings);
$html = $this->ui->form_start(array('tabs' => $tabs, 'method' => 'POST'));
foreach ($tabs as $tab => $tab_name) {
foreach ($all_settings[$tab_name] as $set) {
$current_set = $this->app->getConf($set);
if ($_POST['set'] && array_key_exists($set, $_POST['set'])) {
if ($current_set != $_POST['set'][$set]) {
$current_set = $_POST['set'][$set];
$this->app->setConf($set, $_POST['set'][$set]);
}
}
$input_type = $typemap[$setlib[$set]['type']];
$form_input = array('title' => $setlib[$set]['desc'], 'type' => $input_type, 'name' => "set[" . $set . "]", 'tab' => $tab, 'value' => $current_set, 'options' => $setlib[$set]['options']);
if ($input_type == 'image') {
$form_input = array_merge($form_input, array('width' => $setlib[$set]['width'], 'height' => $setlib[$set]['height']));
}
$html .= $this->ui->form_input($form_input);
}
}
return $html .= $this->ui->form_end(1, app::get('ectools')->_('保存设置'));
}
示例13: generate
/**
* 订单完成\归档.
*
* @param $sdf array 订单ID\操作者ID\操作者名称
*
* @return bool - 成功与否
*/
public function generate($sdf, &$msg = '')
{
$mdl_order = app::get('b2c')->model('orders');
$order_sdf = $mdl_order->dump($sdf['order_id']);
//订单作废前验证
foreach (vmc::servicelist('b2c.order.end.finish') as $service) {
if (!$service->exec($order_sdf, $msg)) {
return false;
}
}
$order_sdf['status'] = 'finish';
// 更新退款日志结果
if ($mdl_order->save($order_sdf)) {
//订单日志记录
vmc::singleton('b2c_order_log')->set_operator(array('ident' => $sdf['op_id'] ? $sdf['op_id'] : $order_sdf['member_id'], 'model' => $sdf['op_id'] ? 'shopadmin' : 'members', 'name' => $sdf['op_name'] ? $sdf['op_name'] : '会员'))->set_order_id($order_sdf['order_id'])->success('finish', '订单已完成归档!', $order_sdf);
} else {
$msg = '完成\\归档失败!';
return false;
}
//订单作废时同步扩展服务
foreach (vmc::servicelist('b2c.order.end.finish') as $service) {
if (!$service->exec($order_sdf, $msg)) {
//记录日志,不中断
logger::error($sdf['order_id'] . '完成归档时出错!' . $msg);
}
}
return true;
}
示例14: get_view
function get_view($ctl, $member_id = 0)
{
$payment_cfg = app::get('ectools')->model('payment_cfgs');
$payments = array();
$rePayment = $payment_cfg->getList('*', array('status' => 'true', 'is_frontend' => true));
if (!$member_id) {
$arr_members = $ctl->get_current_member();
$member_id = $arr_members['member_id'];
}
if ($rePayment) {
foreach ($rePayment as $key => $payment) {
/*$payment_app = $payment_cfg->model($payment['app_id']);
if($payment_app->is_ready()){
$payment['name'] = $payment_app->display_name;
$payment['extra'] = $payment_app->extend();
$payment['intro'] = $payment_app->intro();
$payments[] = $payment;
}*/
if (!$member_id) {
if (trim($payment['app_id']) == 'deposit') {
unset($rePayment[$key]);
continue;
}
}
$payments[] = $payment;
}
/*
foreach($payments as $k=>$v){
$class_name = $v['app_class'];
$app = new $class_name();
}*/
$ctl->pagedata['payments'] =& $payments;
return $ctl->fetch("site/common/paymethod.html");
}
}
示例15: bool
static function bool(&$rows, $options = null)
{
$aBool = array(0 => app::get('base')->_('否'), 1 => app::get('base')->_('是'));
foreach ($rows as $i => $v) {
$rows[$i] = $aBool[$v];
}
}