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

PHP logic函数代码示例

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

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



在下文中一共展示了logic函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: Ajax

 function Ajax()
 {
     $fid = get('fid', 'txt');
     $wd = get('wd', 'txt');
     $result = logic('isearcher')->Search($fid, $wd);
     exit(jsonEncode($result));
 }
开发者ID:pf5512,项目名称:phpstudy,代码行数:7,代码来源:search.mod.php


示例2: del_image

	public function del_image() {
		$this->CheckAdminPrivs('seller');
		$seller_id = get('seller_id', 'int');
		$id = get('id', 'int');
		if($seller_id > 0 && $id > 0) {
			$s = logic('seller')->GetOne($seller_id);
			if($s) {
				if ($s['imgs'] == '')
				{
										logic('upload')->Delete($id);
				}
				else
				{
					$imgs = explode(',', $s['imgs']);
					foreach ($imgs as $i => $iid)
					{
						if ($iid == $id)
						{
							logic('upload')->Delete($id);
							unset($imgs[$i]);
						}
					}
					$new = implode(',', $imgs);
					dbc(DBCMax)->update('seller')->data(array('imgs'=>$new))->where(array('id'=>$seller_id))->done();
				}
			}
		}
		exit('ok');
	}
开发者ID:pf5512,项目名称:phpstudy,代码行数:29,代码来源:seller.mod.php


示例3: log

	public function log($orderid) {
		$orderid = (is_numeric($orderid) ? $orderid : 0);
		if(empty($orderid)) {
			return 'payfrom.log.orderid.empty';
		}
		$paylog = logic('pay')->GetLog($orderid, 0, " `status` IN ('TRADE_FINISHED') ", true);
		if(false == $paylog) {
			return 'payfrom.log.paylog.empty';
		}
		if(false == in_array($paylog['status'], array('TRADE_FINISHED'))) {
			return 'payfrom.log.paylog_status.error';
		}
		$order = logic('order')->GetOne($orderid);
		if(fasle == $order) {
			return 'payfrom.log.orderid.error';
		}
		$money = $paylog['money'];
		$uid = $order['userid'];
		$pid = $order['paytype'];
		$payment = logic('pay')->GetOne($pid);
		$pcode = $payment['code'];
		$pname = $payment['name'];
		if(false == in_array($pcode, array('alipay', 'alipaymobile'))) {
			return 'payfrom.log.payment_code.error';
		}
		$payid = ($_POST['buyer_id'] ? $_POST['buyer_id'] : $_GET['buyer_id']);
		$payfrom = ($_POST['buyer_email'] ? $_POST['buyer_email'] : $_GET['buyer_email']);
		if(empty($payid) || empty($payfrom)) {
			return 'payfrom.log.payid.empty';
		}

		if($payfrom != $paylog['payfrom']) {
			dbc(DBCMax)->update('paylog')->data(array('payfrom'=>$payfrom))->where(array('id'=>$paylog['id']))->done();
		}

		$where = array(
				'uid' => $uid,
				'pid' => $pid,
				'payid' => $payid,
			);
		$info = dbc(DBCMax)->select('payfrom')->where($where)->limit(1)->done();
		$data = array_merge($where, array(
				'pcode' => $pcode,
				'pname' => $pname,
				'payfrom' => $payfrom,
				'paynum' => max(0, (int) $info['paynum']) + 1,
				'paysum' => max(0, (float) $info['paysum']) + $money,
				'pay' => serialize(array_merge($where, array('paylog_id' => $paylog['id'], 'paylog_money' => $money, 'paylog_trade_no' => $paylog['trade_no'], 'paylog_status' => $paylog['status'], ))),
				'time' => time(),
			));
		if(false == $info) {
			$payfromid = dbc(DBCMax)->insert('payfrom')->data($data)->done();
		} else {
			$payfromid = $info['id'];
			if($data['pay'] != $info['pay']) {
				dbc(DBCMax)->update('payfrom')->data($data)->where(array('id' => $payfromid))->done();
			}
		}
		return $payfromid;
	}
开发者ID:pf5512,项目名称:phpstudy,代码行数:60,代码来源:payfrom.logic.php


示例4: view

	public function view()
	{
		$id = get('id', 'int');
		$article = logic('article')->get_one($id);
		$this->Title = $article['title'];
		include handler('template')->file('article_view');
	}
开发者ID:pf5512,项目名称:phpstudy,代码行数:7,代码来源:article.mod.php


示例5: GetList

	 public function GetList($where = '1')
	 {
	 	$sql = dbc(DBCMax)->select('fund_order')->where($where)->order('createtime.desc')->sql();
	 	logic('isearcher')->Linker($sql);
	 	$sql = page_moyo($sql);
	 	return dbc(DBCMax)->query($sql)->done();
	 }
开发者ID:pf5512,项目名称:phpstudy,代码行数:7,代码来源:fund.logic.php


示例6: save

	public function save($product_id, $tag_ids) {
		$count = 0;
		$product_id = (int) $product_id;
		if($product_id > 0) {
			$tag_ids = (array) $tag_ids;
			foreach($tag_ids as $tag_id) {
				$tag_id = (int) $tag_id;
				if($tag_id > 0 && false != ($tr = logic('tag')->get_one($tag_id)) && false == self::get_one($product_id, $tag_id)) {
					if($tr['enable']) {
						$count = $count + 1;
					}
					if($count > 6) {
						$tr['enable'] = 0;
					}
					dbc(DBCMax)->insert('product_tag')->data(array(
						'product_id' => $product_id,
						'tag_id' => $tag_id,
						'order' => $tr['order'],
						'enable' => $tr['enable'],
						'expire' => $tr['expire'],
						'expire_time' => $tr['expire_time'],
					))->done();
				}
			}
		}
	}
开发者ID:pf5512,项目名称:phpstudy,代码行数:26,代码来源:product_tag.logic.php


示例7: Main

	function Main()
	{
		$pid = get('pid');
		$pid || $pid = post('pid');
		$pid || exit($this->Ends());
		preg_match('/^[a-z0-9]+$/i', $pid) || exit($this->Ends());
		
		$payment = logic('pay')->GetOne($pid);
		$payment || exit($this->Ends());
		$status = logic('pay')->Verify($payment);
		$status || exit($this->Ends());
		$trade = logic('pay')->TradeData($payment);
		$trade || exit($this->Ends());
				if ($payment['code'] == 'alipay' || $payment['code'] == 'tenpay')
		{
			if (ini('payment.lp.enabled'))
			{
				if (MEMBER_ID)
				{
										header('Location: '.rewrite('index.php?mod=buy&code=order&op=process&sign='.$trade['sign']));
					exit;
				}
			}
		}
		$parserAPI = logic('callback')->Parser($trade);
		$parserAPI->MasterIframe($this);
		preg_match('/^[a-z_]+$/i', $status) || exit($this->Ends());
		$code = 'Parse_'.$status;
		method_exists($parserAPI, $code) || exit($this->Ends());
		$parserAPI->$code($payment);
	}
开发者ID:pf5512,项目名称:phpstudy,代码行数:31,代码来源:callback.mod.php


示例8: load

	function load( $area = '' )
	{
		if ($area == '')
		{
			$area = str_replace('.', '_', mocod());
		}
		$pox = 'widget.'.$area.'.blocks';
		$list = ini($pox);
		if ( false === $list )
		{
			if (substr($area, 0, 5) == 'html_')
			{
								$html = logic('html')->query(substr($area, 5));
				ini('widget.'.$area, array('name' => $html['title'], 'blocks' => array()));
			}
			else
			{
				ini('[email protected]') && ini($pox, array());
			}
			return;
		}
		echo '<!'.'-- widget @ [ '.$area.' ] --'.'>';
		foreach ( $list as $name => $one )
		{
			if (isset($one['enabled']) && $one['enabled'])
			{
				handler('template')->load('@widget/' . $name);
			}
		}
	}
开发者ID:pf5512,项目名称:phpstudy,代码行数:30,代码来源:widget.ui.php


示例9: delete

	function delete()
	{
		$product_id = get('product_id', 'int');
		$tag_id = get('tag_id', 'int');

		logic('product_tag')->delete($product_id, $tag_id);
	}
开发者ID:pf5512,项目名称:phpstudy,代码行数:7,代码来源:tag.mod.php


示例10: del

	function del()
	{
		$this->CheckAdminPrivs('htmlset');
		$flag = get('flag');
		logic('html')->delete($flag);
		$this->Messager('页面已经删除!', '?mod=html&code=front');
	}
开发者ID:pf5512,项目名称:phpstudy,代码行数:7,代码来源:html.mod.php


示例11: send_sms

	public function send_sms()
	{
		$uid = get('uid', 'int');
		$content = get('content', 'txt');
		if (trim($content) == '') $this->ajax_response('err', '请输入短信内容!');
		logic('push')->addi('sms', user($uid)->get('phone'), array('content'=>$content));
		$this->ajax_response('ok', '短信发送完成!');
	}
开发者ID:pf5512,项目名称:phpstudy,代码行数:8,代码来源:ucard.load.php


示例12: left

 public function left()
 {
     // 菜单显示自定义方式
     $mid = I('get.mid', 1);
     $menulist = logic('Menu')->getAccessibleLeftMenu($mid);
     $this->assign('menulist', $menulist);
     $this->display();
 }
开发者ID:WALES7CH,项目名称:TP-Admin,代码行数:8,代码来源:IndexController.class.php


示例13: SendMsg

 private function SendMsg($qq, $msg)
 {
     $result = $this->api->command('buddy.send', array(
         'uid' => $qq,
         'message' => $msg
     ));
     logic('push')->log('qqrobot', 'xiaoc', $qq, array('content'=>$msg), $result);
     return $result;
 }
开发者ID:pf5512,项目名称:phpstudy,代码行数:9,代码来源:qqrobot.php


示例14: Upload_single

    function Upload_single()
    {
        $this->CheckAdminPrivs('delivery','ajax');
		if(strlen(get('no','txt')) > 8){
			logic('delivery')->Invoice(get('oid', 'number'), get('no', 'txt')) && exit('ok');
		}else{
			exit('error');
		}
    }
开发者ID:pf5512,项目名称:phpstudy,代码行数:9,代码来源:delivery.mod.php


示例15: Ajax_Vfcode

	function Ajax_Vfcode()
	{
		$phone = get('phone', 'number');
		if (strlen($phone) != 11) exit('无效的手机号码!');
		$vcode = get('vcode', 'number');
		if (strlen($vcode) != 5) exit('无效的验证码!');
		$r = logic('prize')->Vfcode($phone, $vcode);
		exit($r === true ? 'ok' : $r);
	}
开发者ID:pf5512,项目名称:phpstudy,代码行数:9,代码来源:prize.mod.php


示例16: cart_listOp

 /**
  * 购物车列表
  */
 public function cart_listOp()
 {
     $model_cart = Model('cart');
     $logic_buy_1 = logic('buy_1');
     $del_ids = $_POST['del_ids'];
     //购物车列表
     $cart_list = $model_cart->listCart('db', array('buyer_id' => $this->member_info['member_id']));
     // 购物车列表 [得到最新商品属性及促销信息]
     $cart_list = $logic_buy_1->getGoodsCartList($cart_list, $jjgObj, true);
     //购物车商品以店铺ID分组显示,并计算商品小计,店铺小计与总价由JS计算得出
     $store_cart_list = array();
     $total_price = 0;
     $total_save = 0;
     foreach ($cart_list as $cart) {
         $cart['goods_image_url'] = cthumb($cart['goods_image'], $cart['store_id']);
         $cart['goods_total'] = $cart['goods_price'] * $cart['goods_num'];
         if (in_array($cart['cart_id'], $del_ids)) {
             $cart['is_selected'] = 0;
         } else {
             $cart['is_selected'] = 1;
             $total_price += $cart['goods_total'];
             $total_save += ($cart['goods_marketprice'] - $cart['goods_price']) * $cart['goods_num'];
             $store_cart_list[$cart['store_id']]['cart_count'] += $cart['goods_num'];
             $store_cart_list[$cart['store_id']]['cart_price'] += $cart['goods_total'];
         }
         $store_cart_list[$cart['store_id']]['store_id'] = $cart['store_id'];
         $store_cart_list[$cart['store_id']]['store_name'] = $cart['store_name'];
         $store_cart_list[$cart['store_id']]['cart_list'][] = $cart;
     }
     // 店铺优惠券
     //        $condition = array();
     //        $condition['voucher_t_gettype'] = 3;
     //        $condition['voucher_t_state'] = 1;
     //        $condition['voucher_t_end_date'] = array('gt', time());
     //        $condition['voucher_t_mgradelimit'] = array('elt', $this->member_info['level']);
     //        $condition['voucher_t_store_id'] = array('in', array_keys($store_cart_list));
     //        $voucher_template = Model('voucher')->getVoucherTemplateList($condition);
     //        $voucher_template = array_under_reset($voucher_template, 'voucher_t_store_id', 2);
     //        Tpl::output('voucher_template', $voucher_template);
     //取得店铺级活动 - 可用的满即送活动
     $mansong_rule_list = $logic_buy_1->getMansongRuleList(array_keys($store_cart_list));
     //取得哪些店铺有满免运费活动
     $free_freight_list = $logic_buy_1->getFreeFreightActiveList(array_keys($store_cart_list));
     $is_selected = 1;
     foreach ($store_cart_list as $k => $v) {
         $store_cart_list[$k]['mansong'] = $mansong_rule_list[$k]['desc'];
         $store_cart_list[$k]['free_freight'] = $free_freight_list[$k];
         $store_cart_list[$k]['is_selected'] = 1;
         foreach ($v['cart_list'] as $kk => $vv) {
             if ($vv['is_selected'] == 0) {
                 $store_cart_list[$k]['is_selected'] = 0;
                 $is_selected = 0;
             }
         }
     }
     output_data(array('store_cart_list' => $store_cart_list, 'total_price' => $total_price, 'total_save' => $total_save, 'is_selected' => $is_selected));
 }
开发者ID:sdjncjc,项目名称:meizhan,代码行数:60,代码来源:mz_member_cart.php


示例17: delete

 public function delete()
 {
     $post_type = I('get.post_type', '');
     $taxonomy_name = I('get.taxonomy_name');
     if (logic('taxonomy')->deleteTaxonomy($post_type, $taxonomy_name) !== false) {
         $this->success('操作成功!');
     } else {
         $this->error(logic('taxonomy')->getErrorMessage());
     }
 }
开发者ID:WALES7CH,项目名称:TP-Admin,代码行数:10,代码来源:TaxonomyController.class.php


示例18: __construct

	public function __construct()
	{
		$alipay = logic('pay')->SrcOne('alipay');
		$cfg = unserialize($alipay['config']);
		$this->config = array(
			'partner' => $cfg['partner'],
			'key' => $cfg['key'],
			'ssl' => $cfg['ssl']
		);
	}
开发者ID:pf5512,项目名称:phpstudy,代码行数:10,代码来源:alipay.php


示例19: ajax_view

	public function ajax_view()
	{
		$this->CheckAdminPrivs('comments','ajax');
		$id = get('id', 'int');
		$comment = logic('comment')->source_get_one($id);
		if($comment['img']){
			$comment['content'] .= "<br><img src='".imager($comment['img'], IMG_Normal)."'>";
		}
		exit($comment['content']);
	}
开发者ID:pf5512,项目名称:phpstudy,代码行数:10,代码来源:comment.mod.php


示例20: found

	public function found($type, $detail = null)
	{
				if (!logic('misc')->siteInstalled())
		{
			return 'SITE_NOT_INSTALLED';
		}
				if ($type == 'mysql')
		{
			$this->mysqlErrorCNT ++ ;
			if ($this->mysqlErrorCNT >= $this->mysqlErrorMax)
			{
				$this->mysqlErrorCNT = 0;
				return 'TOO_MANY_ERROR';
			}
		}
		$nameMAP = array(
			'mysql' => '数据库执行错误',
			'error.msockopen' => 'msockopen函数报错',
			'file.missing' => '系统缺失某些文件,执行中断',
			'missing.gzopen' => '服务器不支持gzopen函数,文件解压失败',
			'denied.io' => '文件读写失败,请检查权限',
			'missing.object' => '系统无法解析对象,执行中断',
			'queue' => '任务队列执行出错'
		);
		if ($detail == null)
		{
			$lastError = function_exists('error_get_last') ? error_get_last() : array();
			if ($lastError['message'])
			{
				$detail = $lastError['message'];
			}
			else
			{
				$detail = '';
			}
		}
		$wName = isset($nameMAP[$type]) ? $nameMAP[$type] : ('未知错误类型:'.$type);
		$btString = '';
		$btAll = function_exists('debug_backtrace') ? debug_backtrace() : false;
		if ($btAll)
		{
			$btLength = count($btAll);
			$btLength > 7 && $btLength = 7;
			$btIII = 0;
			for ($btI = $btLength; $btI > 0; $btI--)
			{
				$btOne = $btAll[$btI-1];
				$btIII ++;
				$btString .= $btIII.'. FILE:'.basename($btOne['file']).' - LINE:'.$btOne['line'].' - FUNC:'.$btOne['function'].'<br/>';
			}
			$btString = '<div class="btString">'.$btString.'</div>';
		}
		$this->zlogCreate($type, $wName, $detail.$btString);
	}
开发者ID:pf5512,项目名称:phpstudy,代码行数:54,代码来源:error.apiz.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP login函数代码示例发布时间:2022-05-15
下一篇:
PHP logging函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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