• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP app类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中app的典型用法代码示例。如果您正苦于以下问题:PHP app类的具体用法?PHP app怎么用?PHP app使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了app类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
 }
开发者ID:yindonghai,项目名称:msk.com,代码行数:44,代码来源:email.php


示例2: tujuanDes

function tujuanDes($destkota, $stat = 'provinsi', $tambah)
{
    global $app;
    $dbu = new db();
    $appx = new app();
    $urlx = new url();
    if ($stat == "destinasi") {
        while ($desty = $dbu->fetch($destkota)) {
            $destinasi = $desty[nama];
            $desty[thumb] = $appx->cekFile("/destinasi/thumb/", $desty[thumb], 'default.jpg');
            $desty[thumb] = $app[data_www] . "/destinasi/thumb/" . $desty[thumb];
            $outnya .= '<li>
							<div class="img_box">
								<img src="' . $desty[thumb] . '">
							</div>
							<div class="text">
								<h1>' . $destinasi . '</h1>
								<p>' . $dbu->lookup('deskripsi', $app[table][destinasi_bahasa], "id_reff ='" . $desty[id_reff] . "' AND id_bahasa='" . $_SESSION[bhs] . "'") . '</p>									
							</div>
							<a href="' . $app[www] . "/" . $dbu->lookup('nama', 'action', "action='21' and id_bahasa='" . $_SESSION[bhs] . "'") . "/" . $urlx->shortLink($destinasi) . "/" . '"><div class="explore">EXPLORE MORE</div></a>
						</li>';
        }
    } elseif ($stat == "provinsi") {
        while ($desty = $dbu->fetch($destkota)) {
            $destinasi = $desty[nama];
            $desty[thumb] = $appx->cekFile("/destinasi/thumb/", $desty[thumb], 'default.jpg');
            $desty[thumb] = $app[data_www] . "/destinasi/thumb/" . $desty[thumb];
            $outnya .= '<li>
							<div class="img_box">

								<img src="' . $desty[thumb] . '">
							</div>
							<div class="text">
								<h1>' . $destinasi . '</h1>
								<p>' . $dbu->lookup('deskripsi', $app[table][destinasi_bahasa], "id_reff ='" . $desty[id_reff] . "' AND id_bahasa='" . $_SESSION[bhs] . "'") . '</p>									
							</div>
							<a href="' . $app[www] . "/" . $dbu->lookup('nama', 'action', "action='21' and id_bahasa='" . $_SESSION[bhs] . "'") . "/" . $urlx->shortLink($destinasi) . "/" . '"><div class="explore">EXPLORE MORE</div></a>
						</li>';
        }
    } else {
        //echo "sedel";exit;
        while ($dkota = $dbu->fetch($destkota)) {
            $dkota[thumb] = $appx->cekFile("/kota/thumb/", $dkota[thumb], 'default.jpg');
            $dkota[thumb] = $app[data_www] . "/kota/thumb/" . $dkota[thumb];
            //echo "asdasdas".$dkota[thumb];
            $outnya .= '<li>
							<div class="img_box">
								<img src="' . $dkota[thumb] . '">
							</div>
							<div class="text">
								<h1>' . $dkota[nama] . '</h1>
								<p>' . $dbu->lookup('deskripsi', $app[table][kota_bahasa], "id_kota ='" . $dkota[id] . "' AND id_bahasa='" . $_SESSION[bhs] . "'") . '</p>									
							</div>
							<a href="' . $app[www] . "/" . $dbu->lookup('nama', 'action', "action='2' and id_bahasa='" . $_SESSION[bhs] . "'") . "/id_" . $urlx->shortLink($dkota[nama]) . "_" . $urlx->shortLink($tambah) . "/" . '"><div class="explore">EXPLORE MORE</div></a>
						</li>';
        }
    }
    return $outnya;
}
开发者ID:salomay,项目名称:refreshin,代码行数:59,代码来源:coretan_destinasi.php


示例3: makeModel

 /**
  * Return Model by each class
  *
  * @return Model
  */
 private function makeModel()
 {
     $this->model = $this->app->make($this->model());
     if (!$this->model instanceof Model) {
         throw new Exception("Class " . $this->model . " must be an instance of Illuminate\\Database\\Eloquent\\Model");
     }
     return $this->model;
 }
开发者ID:pagelab-io,项目名称:ServerMail,代码行数:13,代码来源:BaseRepository.php


示例4: feedCheckIn

    function feedCheckIn($dfeed, $sBahasa, $member)
    {
        global $app;
        $appx = new app();
        $dbu = new db();
        $urlx = new url();
        $fcek_in = "";
        $icon = $app[css_www] . "/images/ic_cat_2.png";
        $avatar = $appx->cekFile('/pengguna/avatar/', $member[avatar], 'default.jpg');
        $avatar = $app[data_www] . '/pengguna/avatar/' . $avatar;
        $linkAva = $app["www"] . "/" . $dbu->lookup('nama', 'action', "action='8' and id_bahasa ='" . $sBahasa . "'") . "/" . $urlx->shortLink($member[username]) . "/";
        $fcek_in = '<div class="con_newsfeed add_fix">
					<div class="line_newsfeed">
						<div class="circle_pict circle_pict_nf"><a href="' . $linkAva . '"><img src="' . $avatar . '"></a></div>
						<div class="bar"></div>
						<div class="ic_cat"><a href="#"><img src="' . $icon . '"></a></div>
					</div>';
        $dipost = $appx->time_delta('now', $dfeed[tgl_post], 0, 2, true);
        if ($_SESSION[member][id] != "") {
            $bolehKomen = '<li>
							<div class="circle_pict circle_pict_nf"><a href="' . $linkAva . '"><img src="' . $avatar . '"></a></div>
							<textarea id="cekin" placeholder="Write your comment..."></textarea>
						</li>';
        }
        $sql = "SELECT a.nama , b.nama as kota , c.nama as provinsi, d.nama as negara FROM " . $app[table][destinasi_bahasa] . " as a LEFT JOIN " . $app[table][destinasi] . " as e ON (a.id_reff = e.id_reff)  LEFT JOIN " . $app[table][kota] . " as b ON(e.id_kota = b.id) LEFT JOIN " . $app[table][provinsi] . " as c ON(b.id_provinsi = c.id) LEFT JOIN " . $app[table][negara] . " as d ON(c.id_negara = d.id) LEFT JOIN " . $app[table][cekin] . " as f ON(e.id = f.id_destinasi ) LEFT JOIN " . $app[table][pengguna_feed] . " as g ON(f.id = g.id_tabel) WHERE g.id ='" . $dfeed[id] . "' AND a.id_bahasa ='" . $sBahasa . "'";
        $lokasi = $dbu->get_recordmix($sql);
        $cekin_di = '<span>Check in at <a href="#"><i>' . $lokasi[nama] . '(' . $lokasi[kota] . '), ' . $lokasi[provinsi] . ', ' . $lokasi[negara] . '</i></a></span>';
        $fcek_in .= '<div class="box_con_newsfeed">
						<h1>' . $member[nama] . '</h1>
						<span>' . $dipost . '</span>
						<div class="frame_post">
							' . $cekin_di . '
							<div class="box_comment">
								<ul class="add_fix" id="list_cekin" rel="cekin_' . $dfeed[id_tabel] . '">
									' . $bolehKomen;
        #komen cekin---------------------------
        $sql = "SELECT a.nama , a.avatar, a.username, b.id, b.komen, b.tgl_post as tgl_komen FROM " . $app[table][pengguna] . " as a LEFT JOIN " . $app[table][cekin_komen] . " as b ON(b.id_user = a.id) WHERE b.id_cekin = '" . $dfeed[id_tabel] . "'";
        $dbu->query($sql, $rkomen, $nkomen);
        if ($nkomen > 0) {
            while ($dkomen = $dbu->fetch($rkomen)) {
                $dkomen[avatar] = $appx->cekFile("/pengguna/avatar/", $dkomen[avatar]);
                $other_avatar = $app[data_www] . '/pengguna/avatar/' . $dkomen[avatar];
                $other_linkAva = $app["www"] . "/" . $dbu->lookup('nama', 'action', "action='8' and id_bahasa ='" . $sBahasa . "'") . "/" . $urlx->shortLink($dkomen[username]) . "/";
                $fcek_in .= '<li>		
							<div class="circle_pict circle_pict_nf"><a href="' . $other_linkAva . '"><img src="' . $other_avatar . '"></a></div>
							<div class="text_box_c">
								<h1>' . $dkomen[nama] . '</h1>
								<p>' . $dkomen[komen] . '</p>
							</div>					
						</li>';
            }
        }
        $fcek_in .= '</ul></div></div></div></div>';
        return $fcek_in;
    }
开发者ID:salomay,项目名称:refreshin,代码行数:55,代码来源:feed.php


示例5: setupAppFramework

function setupAppFramework()
{
    /* initialize the SMT Facebook appliation class, NO Facebook library */
    require_once PATH_FACEBOOK . "/classes/app.class.php";
    global $app, $db, $session;
    $app = new app(NULL, true);
    $app->loadFacebookLibrary();
    // caution: do not assign globals by reference
    $db = $app->db;
    $session = $app->session;
    return $app;
}
开发者ID:smbale,项目名称:open-social-media-toolkit,代码行数:12,代码来源:verify.php


示例6: run

 public function run()
 {
     $ev = $this->make('ev');
     include '../lib/config.inc.php';
     header('P3P: CP=CAO PSA OUR');
     header('Content-Type: text/html; charset=' . HE);
     ini_set('date.timezone', 'Asia/Shanghai');
     date_default_timezone_set("Etc/GMT-8");
     error_reporting(0);
     $app = new app($this);
     $app->run();
 }
开发者ID:qhdyym,项目名称:PHPEMS,代码行数:12,代码来源:api.cls.php


示例7: deliver_featured

 public function deliver_featured()
 {
     // send feature notifications
     global $init;
     require_once PATH_FACEBOOK . "/classes/app.class.php";
     $app = new app(NULL, true);
     $facebook =& $app->loadFacebookLibrary();
     require_once PATH_CORE . '/classes/subscriptions.class.php';
     $subObj = new SubscriptionsManager($db);
     $subObj->loadFacebook($facebook);
     $subObj->deliverFeatures();
     set_flash(array('notice' => "Feature notifications sent."));
     redirect(url_for($this->name, 'index'));
 }
开发者ID:smbale,项目名称:open-social-media-toolkit,代码行数:14,代码来源:stories_controller.php


示例8: AppCentre_GetCheckQueryString

function AppCentre_GetCheckQueryString(){
	global $zbp;
	$check= '';
	$app=new app;			
	if($app->LoadInfoByXml('theme', $zbp->theme)==true){
		$check.=$app->id . ':' .$app->modified . ';';
	}
	foreach (explode('|',$zbp->option['ZC_USING_PLUGIN_LIST']) as  $id) {
		$app=new app;
		if($app->LoadInfoByXml('plugin', $id)==true){
			$check.=$app->id . ':' .$app->modified . ';';
		}
	}
	return $check;
}
开发者ID:kevin2010,项目名称:zblogphp,代码行数:15,代码来源:function.php


示例9: column_tag

 public function column_tag(&$colList, $list)
 {
     //todo  如果list为空则 retunn
     if (!$list) {
         return;
     }
     $idColumnKey = $list[0]['idColumn'];
     $appId = $list[0]['app_id'];
     $tagType = $list[0]['tag_type'];
     $list = utils::array_change_key($list, $idColumnKey);
     // 获取所有当前finder主键列表
     $relatedIds = array_keys(utils::array_change_key($list, $idColumnKey));
     $filter = array('rel_id' => $relatedIds, 'tag_type' => $tagType, 'app_id' => $appId);
     // 获取tag列表
     $tagRows = app::get('desktop')->model('tag_rel')->getList('tag_id, rel_id', $filter);
     /*-----start------>*/
     $tagIds = array_keys(utils::array_change_key($tagRows, 'tag_id'));
     if ($tagIds) {
         $tagList = app::get('desktop')->model('tag')->getList('*', array('tag_id' => $tagIds));
         $tagList = utils::array_change_key($tagList, 'tag_id');
     }
     /*<----end-------->*/
     foreach ($tagRows as $row) {
         $relatedRows[$row['rel_id']][] = $tagList[$row['tag_id']];
     }
     $i = 0;
     foreach ($relatedIds as $id) {
         $colList[$i] = $this->getColumnTagHtml($relatedRows[$id]);
         $i++;
     }
 }
开发者ID:453111208,项目名称:bbc,代码行数:31,代码来源:tagcols.php


示例10: 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);
 }
开发者ID:453111208,项目名称:bbc,代码行数:36,代码来源:settlement.php


示例11: 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;
 }
开发者ID:453111208,项目名称:bbc,代码行数:32,代码来源:payment.php


示例12: 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()));
 }
开发者ID:453111208,项目名称:bbc,代码行数:7,代码来源:widgets.php


示例13: 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;
         }
     }
 }
开发者ID:yindonghai,项目名称:msk.com,代码行数:40,代码来源:default.php


示例14: 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;
 }
开发者ID:453111208,项目名称:bbc,代码行数:32,代码来源:paymentMoney.php


示例15: theme_widget_main_slide

/**
 * ShopEx licence
 *
 * @copyright  Copyright (c) 2005-2010 ShopEx Technologies Inc. (http://www.shopex.cn)
 * @license  http://ecos.shopex.cn/ ShopEx License
 */

function theme_widget_main_slide(&$setting,&$render){
    $setting['allimg']="";
    $setting['allurl']="";
    if($system->theme){
        $theme_dir = kernel::get_themes_host_url().'/'.$smarty->theme;
    }else{
        $theme_dir = kernel::get_themes_host_url().'/'.app::get('site')->getConf('current_theme');
    }
    if(!$setting['pic']){
        foreach($setting['img'] as $value){
            $setting['allimg'].=$rvalue."|";
            $setting['allurl'].=urlencode($value["url"])."|";
        }
    }else{
        foreach($setting['pic'] as $key=>$value){
            if($value['link']){
                if($value["url"]){
                    $value["linktarget"]=$value["url"];
                }
                $setting['allimg'].=$rvalue."|";
                $setting['allurl'].=urlencode($value["linktarget"])."|";
                $setting['pic'][$key]['link'] = str_replace('%THEME%',$theme_dir,$value['link']);
            }
        }
    }
    return $setting;
}
开发者ID:noikiy,项目名称:Ecstore-to-odoo,代码行数:34,代码来源:theme_widget_main_slide.php


示例16: 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;
 }
开发者ID:453111208,项目名称:bbc,代码行数:33,代码来源:get.php


示例17: getCouponCode

 public function getCouponCode($coupon_id, $user_id)
 {
     $objMdlUserCoupon = app::get('sysuser')->model('user_coupon');
     $couponNum = $objMdlUserCoupon->count(array('coupon_id' => $coupon_id, 'user_id' => $user_id));
     $oldQuantity = $couponNum ? $couponNum : 0;
     $userInfo = kernel::single('sysuser_passport')->memInfo($user_id);
     $apiData = array('gen_quantity' => 1, 'old_quantity' => $oldQuantity, 'coupon_id' => $coupon_id, 'grade_id' => $userInfo['grade_id']);
     $db = app::get('sysuser')->database();
     $transaction_status = $db->beginTransaction();
     try {
         if ($couponInfo = app::get('sysuser')->rpcCall('promotion.coupon.gencode', $apiData)) {
             $userCoupon['coupon_id'] = $coupon_id;
             $userCoupon['coupon_code'] = $couponInfo['coupon_code'];
             $userCoupon['user_id'] = $user_id;
             $userCoupon['obtain_desc'] = '免费领取';
             $userCoupon['shop_id'] = $couponInfo['shop_id'];
             $userCoupon['obtain_time'] = time();
             $userCoupon['used_platform'] = $couponInfo['used_platform'];
             if (!app::get('sysuser')->model('user_coupon')->save($userCoupon)) {
                 throw new \LogicException('优惠券保存失败');
             }
             $db->commit($transaction_status);
             return $couponInfo;
         } else {
             throw new \LogicException('生成优惠券号码失败');
         }
     } catch (Exception $e) {
         $db->rollback();
         throw $e;
     }
     return true;
 }
开发者ID:453111208,项目名称:bbc,代码行数:32,代码来源:coupon.php


示例18: __run

 private function __run($shopItemData, $shopId, $itemId)
 {
     pamAccount::setAuthType('sysshop');
     pamAccount::setSession($shopId, 'test');
     $objMdlItemDesc = app::get('sysitem')->model('item_desc');
     $itemInfoDesc = $objMdlItemDesc->getRow("*", array('item_id' => $itemId));
     $update = [];
     if ($itemInfoDesc['pc_desc']) {
         $pcDesc = $this->__replaceHost($itemInfoDesc['pc_desc']);
         //$pcDesc = $this->__replaceHref($this->__replaceImage($itemInfoDesc['pc_desc']));
         if ($pcDesc != stripslashes($itemInfoDesc['pc_desc'])) {
             $update['pc_desc'] = $pcDesc;
         }
     }
     if ($itemInfoDesc['wap_desc']) {
         $wapDesc = $this->__replaceHost($itemInfoDesc['wap_desc']);
         //$wapDesc = $this->__replaceHref($this->__replaceImage($itemInfoDesc['wap_desc']));
         if ($wapDesc != stripslashes($itemInfoDesc['wap_desc'])) {
             $update['wap_desc'] = $wapDesc;
         }
     }
     if ($update) {
         $objMdlItemDesc->update($update, array('item_id' => $itemId));
     }
     return true;
 }
开发者ID:453111208,项目名称:bbc,代码行数:26,代码来源:replaceItemDescImage.php


示例19: command_sync_user

 public function command_sync_user()
 {
     //kernel::console_output = false;
     $http = kernel::single('base_httpclient');
     $response = $http->get(app::get('suitclient')->getConf('syncuser'));
     if ($response) {
         $server_users = json_decode($response);
         $model = app::get('pam')->model('account');
         $result = $model->getList('login_name', array('account_type' => 'shopadmin'));
         $client_user = array();
         foreach ($result as $value) {
             $client_user[] = $value['login_name'];
         }
         $model2 = app::get('desktop')->model('users');
         foreach ($server_users as $server_user) {
             if (!in_array($server_user, $client_user)) {
                 $user = array('name' => $server_user, 'status' => 1, 'super' => 0, 'disabled' => false, 'pam_account' => array('login_name' => $server_user, 'login_password' => md5(time() . rand()), 'account_type' => 'shopadmin'), 'roles' => array(array('role_id' => 1)));
                 $model2->save($user);
             }
         }
         kernel::log('同步成功');
         kernel::log('ok.');
         //不加 "ok."则会弹提示信息并不能自动关闭@lujy
     } else {
         kernel::log('同步失败或套件里没有用户');
         kernel::log('ok.');
     }
     exit;
 }
开发者ID:syjzwjj,项目名称:quyeba,代码行数:29,代码来源:sync.php


示例20: saveInfo

 /**
  * 资讯保存
  **/
 public function saveInfo()
 {
     $userId = userAuth::id();
     //$postData =utils::_filter_input(input::get());
     $postData = input::get();
     $postData['user_id'] = $userId;
     $postData['modified'] = time();
     $postData['pubtime'] = time();
     $postData['ifpub'] = 0;
     $postData["platform"] = 'pc';
     $userName = app::get('sysuser')->model('account');
     $infoName = $userName->getList(login_account, array('user_id' => $userId));
     $postData['source'] = $infoName[0]['login_account'];
     $postData["article_logo"] = $postData["article_logo"][0];
     try {
         $userMdlAddr = app::get('sysinfo')->model('article');
         $userMdlAddr->save($postData);
     } catch (Exception $e) {
         $msg = $e->getMessage();
         return $this->splash('error', null, $msg);
     } catch (\LogicException $e) {
         $msg = $e->getMessage();
         return $this->splash('error', null, $msg);
     }
     $url = url::action('topc_ctl_member_info@publishInfo');
     $msg = app::get('topc')->_('添加成功');
     return $this->splash('success', $url, $msg);
 }
开发者ID:453111208,项目名称:bbc,代码行数:31,代码来源:info.php



注:本文中的app类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP appCommonFrm类代码示例发布时间:2022-05-23
下一篇:
PHP api_Utils类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap