当前位置: 首页>>代码示例>>PHP>>正文


PHP logic函数代码示例

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


在下文中一共展示了logic函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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('widget.~@config.listener.enabled') && 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


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