本文整理汇总了PHP中LogRecord函数的典型用法代码示例。如果您正苦于以下问题:PHP LogRecord函数的具体用法?PHP LogRecord怎么用?PHP LogRecord使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了LogRecord函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: send_msg_to_user
/**
* @param $param
*/
public function send_msg_to_user($param)
{
if (!isset($param['appid']) || !isset($param['appsecret']) || !isset($param['text']) || !isset($param['openid'])) {
LogRecord("发送微信消息参数错误", __FILE__ . __LINE__);
return;
}
//TODO: 发送消息插件
$config = $this->getConfig();
$appid = $param['appid'];
$appsecret = $param['appsecret'];
$text = $param['text'];
$openid = $param['openid'];
$this->wxapi = new WeixinApi($appid, $appsecret);
for ($i = 0; $i < $config['cnt']; $i++) {
$this->sendMsg($openid, $text);
}
$entity = array('msg_title' => '', 'msg_desc' => $text, 'send_time' => time(), 'to_user' => $openid, 'from' => $appid, 'phone' => '', 'email' => '', 'status' => 1);
$model = D('MsgSendHis');
if ($model->create($entity)) {
$result = $model->add();
if ($result === false) {
LogRecord($model->getDbError(), __FILE__ . __LINE__);
} else {
}
} else {
}
}
示例2: WeixinInnerProcess
/**
* 关键词
* keyword => _plugin_promotion
* data => array('fans'=>粉丝信息)
* wxaccount => 公众号信息
* @param $param
*/
public function WeixinInnerProcess(&$param)
{
addWeixinLog($param, "插件二维码参数!");
//固定,只处理这个关键词
if ($param['keyword'] === "_plugin_promotion") {
} else {
return;
}
addWeixinLog("插件二维码处理", "WeixinInnerProcess");
$data = $param['data'];
$this->config = $this->getConfig();
$this->config['codeprefix'] = "UID_";
if (empty($data['fans'])) {
LogRecord("fans参数为empty", "[PromotioncodePlugin]" . __LINE__);
$param['result'] = array("缺失粉丝信息-二维码推广插件[调用失败]", "text");
return;
}
if (empty($data['wxaccount'])) {
LogRecord("wxaccount参数为empty", "[PromotioncodePlugin]" . __LINE__);
$param['result'] = array("缺失公众号信息-二维码推广插件[调用失败]", "text");
return;
}
$result = $this->process($data['wxaccount']['appid'], $data['wxaccount']['appsecret'], $data['fans']);
addWeixinLog($result, "二维码插件处理结果");
if ($result['status']) {
$param['result'] = array($result['info'], "image");
} else {
$param['result'] = array($result['info'], "text");
}
}
示例3: index
public function index()
{
//get.startdatetime
$startdatetime = I('startdatetime', date('Y/m/d H:i', time() - 24 * 3600), 'urldecode');
$enddatetime = I('enddatetime', date('Y/m/d H:i', time()), 'urldecode');
//分页时带参数get参数
$params = array('startdatetime' => $startdatetime, 'enddatetime' => $enddatetime);
$startdatetime = strtotime($startdatetime);
$enddatetime = strtotime($enddatetime);
if ($startdatetime === FALSE || $enddatetime === FALSE) {
LogRecord('INFO:' . $result['info'], '[FILE] ' . __FILE__ . ' [LINE] ' . __LINE__);
$this->error(L('ERR_DATE_INVALID'));
}
$map = array();
$map['timestamp'] = array(array('EGT', $startdatetime), array('elt', $enddatetime), 'and');
$page = array('curpage' => I('get.p', 0), 'size' => C('LIST_ROWS'));
$order = " timestamp desc ";
//
$result = apiCall('Admin/Log/query', array($map, $page, $order, $params));
//
if ($result['status']) {
$this->assign('startdatetime', $startdatetime);
$this->assign('enddatetime', $enddatetime);
$this->assign('show', $result['info']['show']);
$this->assign('list', $result['info']['list']);
$this->display();
} else {
LogRecord('INFO:' . $result['info'], '[FILE] ' . __FILE__ . ' [LINE] ' . __LINE__);
$this->error(L('UNKNOWN_ERR'));
}
}
示例4: index
public function index()
{
$result = apiCall(DatatreeApi::QUERY_NO_PAGING, array(array("parentid" => getDatatree('BANNERS_TYPE')), "", "id"));
if (!$result['status']) {
$this->error($result['info']);
}
$result = $result['info'];
$banners_pos = array();
foreach ($result as $vo) {
array_push($banners_pos, $vo['id']);
}
if (count($banners_pos) > 0) {
$map = array();
$map = array('uid' => UID);
$map['position'] = array("in", $banners_pos);
$page = array('curpage' => I('get.p', 0), 'size' => C('LIST_ROWS'));
$order = " createtime desc ";
//
$result = apiCall(BannersApi::QUERY_WITH_POSITION, array($map, $page, $order, $params));
} else {
$result = array('status' => true, 'info' => array('show' => '', 'list' => ''));
}
//
if ($result['status']) {
$this->assign('show', $result['info']['show']);
$this->assign('list', $result['info']['list']);
$this->display();
} else {
LogRecord('INFO:' . $result['info'], '[FILE] ' . __FILE__ . ' [LINE] ' . __LINE__);
$this->error(L('UNKNOWN_ERR'));
}
}
示例5: index
public function index()
{
$cate_id = I('cate_id', -1);
$map = array('cate_id' => $cate_id);
$name = I('name', '');
$params = array('cate_id' => $cate_id);
$page = array('curpage' => I('get.p', 0), 'size' => C('LIST_ROWS'));
$order = " id asc ";
$result = apiCall(CategoryApi::GET_INFO, array(array("id" => $cate_id)));
if (!$result['status']) {
$this->error($result['info']);
}
$cate_vo = $result['info'];
//
$result = apiCall(CategoryPropApi::QUERY, array($map, $page, $order, $params));
//
if ($result['status']) {
$this->assign('cate_id', $cate_id);
$this->assign('cate_vo', $cate_vo);
$this->assign('show', $result['info']['show']);
$this->assign('list', $result['info']['list']);
$this->display();
} else {
LogRecord('INFO:' . $result['info'], '[FILE] ' . __FILE__ . ' [LINE] ' . __LINE__);
$this->error(L('UNKNOWN_ERR'));
}
}
示例6: problem
public function problem()
{
$post = I('post.');
addWeixinLog($post, '[微信告警接口]');
LogRecord(serialize($post), '[微信告警接口]');
echo "";
}
示例7: add
public function add()
{
if (IS_GET) {
$map = array('parentid' => 27);
$result = apiCall(DatatreeApi::QUERY_NO_PAGING, array($map));
$this->assign('accountType', $result['info']);
$this->theme($this->themeType)->display();
} else {
if (IS_AJAX) {
$map = array('uid' => $this->userinfo['uid'], 'money' => I('money'), 'accountType' => I('accountType'), 'accountName' => I('accountName'), 'bankBranch' => I('bankBranch'), 'cashAccount' => I('cashAccount'), 'reason' => '提现');
$result = apiCall(WalletApi::MINUS, array($map));
if ($result['status']) {
$this->success('操作成功', U('Shop/Index/index'));
} else {
LogRecord($result['info'], __FILE__ . __LINE__);
$this->error($result['info']);
}
}
}
/*$map=array(
'uid'=>$this->userinfo['uid'],
'money'=>50,
'accountType'=>28,
'accountName'=>'张铭',
'bankBranch'=>'1235',
'cashAccount'=>'3212356465464',
'reason'=>'提现'
);
apiCall(WalletApi::MINUS,array($map));*/
}
示例8: index
public function index()
{
$name = I("name", '');
//get.startdatetime
// $startdatetime = I('startdatetime',date('Y/m/d H:i',time()-24*3600),'urldecode');
// $enddatetime = I('enddatetime',date('Y/m/d H:i',time()+24*3600),'urldecode');
//分页时带参数get参数
$params = array('name' => $name);
$map = array();
$map['post_author'] = UID;
$map['name'] = array('like', '%' . $name . '%');
$page = array('curpage' => I('get.p', 0), 'size' => C('LIST_ROWS'));
$order = " post_modified desc ";
//
$result = apiCall('Admin/Post/query', array($map, $page, $order, $params));
//
if ($result['status']) {
$this->assign('name', $name);
$this->assign('show', $result['info']['show']);
$this->assign('list', $result['info']['list']);
$this->display();
} else {
LogRecord('INFO:' . $result['info'], '[FILE] ' . __FILE__ . ' [LINE] ' . __LINE__);
$this->error(L('UNKNOWN_ERR'));
}
}
示例9: add
public function add()
{
if (IS_GET) {
cookie("__forward__", $_SERVER['HTTP_REFERER']);
$map = array();
$map['wxuserid'] = $this->userinfo['id'];
$map['default'] = 1;
$result = apiCall(AddressApi::GET_INFO, array($map));
if (!$result['status']) {
$this->error($result['info']);
}
if (is_array($result['info'])) {
//获取城市,区域信息
$city = apiCall(CityApi::GET_LIST_BY_PROVINCE_ID, array($result['info']['province']));
if (!$city['status']) {
LogRecord($city['info'], __FILE__ . __LINE__);
}
$this->assign("city", $city['info']);
$area = apiCall(AreaApi::GET_LIST_BY_CITY_ID, array($result['info']['city']));
if (!$area['status']) {
LogRecord($city['info'], __FILE__ . __LINE__);
}
$this->assign("area", $area['info']);
}
//dump($result['info']);
$this->assign("address", $result['info']);
$result = apiCall(ProvinceApi::QUERY_NO_PAGING, array());
if (!$result['status']) {
$this->error($result['info']);
}
$this->assign("provinces", $result['info']);
$this->assign("back_url", cookie("__forward__"));
$this->theme($this->themeType)->display();
} else {
$id = I('post.id', 0, 'intval');
$province = I('post.province', '');
$city = I('post.city', '');
$area = I('post.area', '');
$detail = I('post.detail', '');
$mobile = I('post.mobile', '');
$postcode = I('post.postcode', '');
$contactname = I('post.name', '');
$entity = array('wxno' => '', 'country' => '中国', 'province' => $province, 'city' => $city, 'area' => $area, 'detailinfo' => $detail, 'mobile' => $mobile, 'default' => 1, 'contactname' => $contactname, 'zip_code' => $postcode);
if (empty($id)) {
//新增
$entity['wxuserid'] = $this->userinfo['id'];
$result = apiCall(AddressApi::ADD, array($entity));
} else {
//保存
$result = apiCall(AddressApi::SAVE_BY_ID, array($id, $entity));
}
if (!$result['status']) {
$this->error($result['info']);
}
$this->success("操作成功!~", cookie("__forward__") . '?fromsession=1');
}
}
示例10: config_set
/**
* 配置部分内容
*/
public function config_set($group)
{
$map = array('group' => $group);
$result = apiCall('Ucenter/Config/queryNoPaging', array($map));
if ($result['status']) {
$this->assign("list", $result['info']);
echo $this->fetch("Widget/config_set");
} else {
LogRecord($result['info'], "[INFO]:" . __FILE__ . " [LINE]" . __LINE__);
echo L('ERR_SYSTEM_BUSY');
}
}
示例11: save
/**
* 更新保存
*/
public function save($title, $url, $type, $newEntity)
{
if (substr_count('/', $url) == 2) {
$url = 'Ucenter/' . $url;
}
$map = array('module' => 'ucenter', 'title' => $title, 'name' => $url, 'status' => 1, 'type' => $type);
$result = apiCall("Ucenter/AuthRule/save", array($map, $newEntity));
if (!$result['status']) {
LogRecord('INFO:' . $result['info'], '[FILE] ' . __FILE__ . ' [LINE] ' . __LINE__);
return false;
} else {
return true;
}
}
示例12: orderQuery_old
public function orderQuery_old()
{
$out_trade_no = I('get.orderid', '');
if (empty($out_trade_no)) {
$out_trade_no = I('post.orderid', '');
}
//退款的订单号
if (empty($out_trade_no)) {
$out_trade_no = " ";
$this->error("订单号无效!");
} else {
if (!$this->check($out_trade_no)) {
$this->error("订单号无效!");
}
$appid = "";
$appsecrect = "";
$config = C("WXPAY_CONFIG");
//使用订单查询接口
$orderQuery = new OrderQueryApi($config);
//设置必填参数
//appid已填,商户无需重复填写
//mch_id已填,商户无需重复填写
//noncestr已填,商户无需重复填写
//sign已填,商户无需重复填写
$orderQuery->setParameter("out_trade_no", "{$out_trade_no}");
//商户订单号
//非必填参数,商户可根据实际情况选填
//$orderQuery->setParameter("sub_mch_id","XXXX");//子商户号
//$orderQuery->setParameter("transaction_id","XXXX");//微信订单号
//获取订单查询结果
$orderQueryResult = $orderQuery->getResult();
//商户根据实际情况设置相应的处理流程,此处仅作举例
if ($orderQueryResult["return_code"] == "FAIL") {
LogRecord("[通信出错]", $orderQueryResult['return_msg']);
// $this->error("通信出错:" . $orderQueryResult['return_msg'] );
$this->assign("error", "通信出错:" . $orderQueryResult['return_msg']);
} elseif ($orderQueryResult["result_code"] == "FAIL") {
$this->assign("error", $orderQueryResult['err_code_des']);
// echo "错误代码描述:" . $orderQueryResult['err_code_des'] . "<br>";
} else {
// dump(self::$WXPAY_TRADE_STATE);
$orderQueryResult['trade_state'] = self::$WXPAY_TRADE_STATE[$orderQueryResult['trade_state']];
$orderQueryResult['time_end'] = date('Y-m-d H:i:s', strtotime($orderQueryResult['time_end']));
$this->assign("orderQueryResult", $orderQueryResult);
}
$this->assign("out_trade_no", $out_trade_no);
$this->display();
}
}
示例13: writeMenuList
public function writeMenuList()
{
$groupid = I('post.groupid', -1);
$menulist = I('post.menulist', '');
if ($menulist == ",") {
$menulist = "";
}
$result = apiCall('Ucenter/AuthGroup/writeMenuList', array($groupid, $menulist));
if ($result['status']) {
$this->success("操作成功~页面将自动跳转");
} else {
LogRecord($result['info'], __FILE__ . __LINE__);
$this->error($result['info']);
}
}
示例14: delFromGroup
/**
* 将指定用户从指定用户组移除
*/
public function delFromGroup()
{
$groupid = I('groupid', -1);
$uid = I('uid', -1);
if ($groupid === -1 || $uid === -1) {
$this->error("参数错误!");
}
$map = array('uid' => $uid, "group_id" => $groupid);
$result = apiCall("Admin/AuthGroupAccess/delete", array($map));
if ($result['status']) {
$this->success("操作成功~", U('Admin/AuthManage/user'));
} else {
LogRecord($result['info'], __FILE__ . __LINE__);
$this->error($result['info']);
}
}
示例15: index
public function index()
{
$map = array();
$map = array('uid' => UID, 'position' => $this->position);
$page = array('curpage' => I('get.p', 0), 'size' => C('LIST_ROWS'));
$order = " createtime desc ";
//
$result = apiCall('Admin/Banners/query', array($map, $page, $order, $params));
//
if ($result['status']) {
$this->assign('show', $result['info']['show']);
$this->assign('list', $result['info']['list']);
$this->display();
} else {
LogRecord('INFO:' . $result['info'], '[FILE] ' . __FILE__ . ' [LINE] ' . __LINE__);
$this->error(L('UNKNOWN_ERR'));
}
}