本文整理汇总了PHP中M::find方法的典型用法代码示例。如果您正苦于以下问题:PHP M::find方法的具体用法?PHP M::find怎么用?PHP M::find使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类M
的用法示例。
在下文中一共展示了M::find方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: writeinto
function writeinto($info)
{
$infoarr = json_decode($info, true);
$flag = new M('flag');
$count = $flag->find("openid='" . $infoarr['openid'] . "'", '*', 'count');
$sqlarr = array("nickname" => bin2hex($infoarr['nickname']), "avatar" => $infoarr['headimgurl'], "fakeid" => randStr(), "sex" => $infoarr['sex'], "fromtype" => 'weixin', "datetime" => time(), "flag" => "2");
if (isset($infoarr['shadyphone'])) {
$shady = new M('cj_shady');
$shadyarr = $shady->find("phone=" . $infoarr['shadyphone']);
if (empty($shadyarr)) {
$addarr = array('phone' => $infoarr['shadyphone'], 'shady' => $shadyarr['grade']);
$sqlarr = array_merge($sqlarr, $addarr);
}
}
if ($count) {
$savve = $flag->update("openid='" . $infoarr['openid'] . "'", $sqlarr);
}
if ($savve) {
echo "ok";
}
}
示例2: M
} else {
$_SESSION['views'] = false;
echo "<script>window.location='../wall/login.php?url=" . $_SERVER['PHP_SELF'] . "';</script>";
}
?>
<!DOCTYPE HTML>
<html>
<head>
<?php
require 'db.php';
$plugsc = new M('plugs');
$voteplug = $plugsc->find('name="shake"');
?>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title><?php
echo $xuanzezu[5];
?>
</title>
<script src="./mobile/shake/jquery.js"></script>
<script type="text/javascript" src="../files/js/semantic.min.js"></script>
<script src="mobile/shake/jquery-ui.min.js"></script>
示例3: while
while ($row1 = mysql_fetch_array($data)) {
$row1['nickname'] = pack('H*', $row1['nickname']);
$row1 = emoji_unified_to_html(emoji_softbank_to_unified($row1));
$arr[] = array('id' => $row1['id'], 'avatar' => $row1['avatar'], 'nickname' => $row1['nickname'], 'from' => $row1['fromtype']);
}
echo json_encode($arr);
} else {
if ($action == "ok") {
//标识中奖号码
$id = $_POST['id'];
$sql = "update weixin_flag set status=1,cjstatu=0 where id={$id}";
$query = mysql_query($sql);
if ($xuanzezu[10]) {
$query2 = mysql_query("select * from weixin_flag where id = {$id}");
$row2 = mysql_fetch_array($query2);
$contant = '恭喜恭喜!您已中奖,请按照主持人的提示,到指定地点领取您的奖品!您的获奖验证码是:【' . $row2['fakeid'] . '】';
if ($row2['fromtype'] == 'weibo') {
$weibo_configs = new M('weibo_config');
$weibo_config = $weibo_configs->find();
include "../../weibo/sendmessage.php";
send($weibo_config['access_token'], $contant, $row2['openid']);
}
if ($row2['fromtype'] == 'weixin') {
include "../../weixin/sendmessage.php";
sendmassage($row2['openid'], $contant);
}
}
echo '1';
}
}
}
示例4: M
$vote = 1;
}
if (file_exists("../wall/qdq_plug/qdq_html.php")) {
$qdq = 1;
}
if (file_exists("../wall/ddp_plug/ddp_html.php")) {
$ddp = 1;
}
if (file_exists("../api/weixin.php")) {
$weixin_configc = new M('weixin_config');
$weixin_config = $weixin_configc->find();
$weixin_switch = 1;
}
if (file_exists("../api/weibo.php")) {
$weibo_configc = new M('weibo_config');
$weibo_config = $weibo_configc->find();
$weibo_switch = 1;
}
?>
<!DOCTYPE html>
<html>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<head>
<title>
微信墙后台管理系统
</title>
<script>
var web_root= "<?php
echo Web_ROOT;
?>
示例5: cj_verify
function cj_verify()
{
$cid = $_GET['cid'];
//file_get_contents(Web_ROOT . "/weixin/dianplu.php?action=cj&type=wins&tofakeid={$cid}");
$flags = new M('flag');
$flag = $flags->find('fakeid=' . $cid);
$contant = '恭喜恭喜!此条为验证消息,您的获奖验证码是:【' . $cid . '】';
if ($flag['fromtype'] == 'weibo') {
$weibo_configs = new M('weibo_config');
$weibo_config = $weibo_configs->find();
include "../weibo/sendmessage.php";
send($weibo_config['access_token'], $contant, $flag['openid']);
}
if ($flag['fromtype'] == 'weixin') {
include "../weixin/sendmessage.php";
sendmassage($flag['openid'], $contant);
}
echo "<script>alert('验证信息已经发送,请勿频繁发送!');location.href='cj.php';</script>";
}
示例6: dirname
<?php
@header("Content-type: text/html; charset=utf-8");
include dirname(__FILE__) . '/../files/db.class.php';
$wall_config = new M('wall_config');
$xuanzezu = $wall_config->find('1', '*', '', 'row');
$conf = $wall_config->find();
$link = M::$wlink;
define("Web_ROOT", $xuanzezu[31]);
示例7: run
/**
* 分析消息类型,并分发给对应的函数
*
* @return void
*/
public function run()
{
$wall_config = new M('wall_config');
$conf = $wall_config->find();
if (!$conf[Wechat::$fromtype . '_switch']) {
$this->responseText('对不起,管理员没有开启该平台下的互动墙!');
die;
}
$xuanzezu = $wall_config->find('1', '*', '', 'row');
$this->xuanzezu = $xuanzezu;
define("Web_ROOT", $xuanzezu[31]);
$typecon = new M(Wechat::$fromtype . '_config');
$tp = $typecon->find();
$this->type_config = $tp;
$this->weixin_name = $tp['nickname'];
$from = $this->getRequest('fromusername');
$check = $this->sqlselect('flag', $from, "row");
$this->check = $check;
if ($xuanzezu[18] && $this->getRequest('content') != $xuanzezu[19] && !$check[2]) {
//直接回复第三方返回的xml
exit($this->sendxml($GLOBALS['HTTP_RAW_POST_DATA'], $xuanzezu[20], $xuanzezu[21]));
} else {
if (!$check[2]) {
$this->responseNews($this->resetflag($tp['nickname'], $from));
}
switch ($this->getRequest('msgtype')) {
case 'event':
switch ($this->getRequest('event')) {
case 'FOLLOW':
$this->onSubscribe();
break;
case 'subscribe':
$this->onSubscribe();
break;
case 'unsubscribe':
$this->onUnsubscribe();
break;
case 'SCAN':
$this->onScan();
break;
case 'LOCATION':
$this->onEventLocation();
break;
case 'click':
$this->onClick();
break;
case 'CLICK':
$this->onClick();
break;
}
break;
case 'text':
$this->onText();
break;
case 'image':
$this->onImage();
break;
case 'location':
$this->onLocation();
break;
case 'link':
$this->onLink();
break;
case 'voice':
$this->onVoice();
break;
default:
$this->onUnknown();
break;
}
}
}