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


PHP m函数代码示例

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


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

示例1: onofflineAjax

 /**
 	上线下线更新
 */
 public function onofflineAjax()
 {
     $uid = (int) $this->request('uid');
     $online = (int) $this->request('online');
     m('admin')->update("`imonline`='{$online}',`imlastdt`='{$this->now}'", $uid);
     echo 'success';
 }
开发者ID:fatfox21,项目名称:rockoademo,代码行数:10,代码来源:apiAction.php

示例2: __async_delete

 /** Delete file controller */
 public function __async_delete()
 {
     /** @var \samsonphp\fs\FileService $fsModule */
     $fsModule = $this->system->module('fs');
     /** @var \samsoncms\input\Field $field */
     $this->createField(new dbQuery(), $_GET['e'], $_GET['f'], $_GET['i']);
     // Build uploaded file path
     $file = $this->field->value();
     // Delete thumbnails
     if (class_exists('\\samson\\scale\\ScaleController', false) && $this->isImage($fsModule->extension($file))) {
         /** @var string $path Path to file */
         $path = '';
         // Get file path
         preg_match('/.*\\//', $file, $path);
         $path = $path[0];
         // Get image src
         $src = substr($file, strlen($path));
         /** @var \samson\scale\ScaleController $scale */
         $scale = m('scale');
         foreach (array_keys($scale->thumnails_sizes) as $folder) {
             // Form image path for scale module
             $imageScalePath = $path . $folder . '/' . $src;
             if ($fsModule->exists($imageScalePath)) {
                 $fsModule->delete($imageScalePath);
             }
         }
     }
     if ($fsModule->exists($file)) {
         $fsModule->delete($file);
     }
     // TODO Save empty field value
     $this->field->save(' ');
     return array('status' => true);
 }
开发者ID:samsonos,项目名称:cms_input_upload,代码行数:35,代码来源:Application.php

示例3: _get_data

 function _get_data()
 {
     $cache_server =& cache_server();
     $key = $this->_get_cache_id();
     $data = $cache_server->get($key);
     if ($data === false) {
         $recom_mod =& m('recommend');
         $brand_mod =& m('brand');
         $data = array('goodslist' => $recom_mod->get_recommended_goods($this->options['img_recom_id'], $this->_num, true, $this->options['img_cate_id']), 'slides' => array(), 'brand' => $brand_mod->find(array('conditions' => "tag like '%{$this->options['bcategory']}'", 'order' => 'sort_order', 'limit' => 16)), 'model_name' => $this->options['model_name'], 'keyword_list' => explode(' ', $this->options['keyword_list']), 'ad0_image_url' => $this->options['ad0_image_url']);
         for ($i = 1; $i <= count($data['keyword_list']) * 5; $i++) {
             $data['ad' . $i . '_image_url'] = $this->options['ad' . $i . '_image_url'];
             $data['ad' . $i . '_link_url'] = $this->options['ad' . $i . '_link_url'];
             $data['ad' . $i . '_title'] = $this->options['ad' . $i . '_title'];
         }
         $cache_server->set($key, $data, $this->_ttl);
     }
     $keyword_list_ss = array();
     foreach ($data['keyword_list'] as $key => $value) {
         if (!empty($value)) {
             for ($i = 1; $i <= 5; $i++) {
                 $k = $key * 5 + $i;
                 $keyword_list_ss[$key][$i]['img_url'] = $data['ad' . $k . '_image_url'];
                 $keyword_list_ss[$key][$i]['link'] = $data['ad' . $k . '_link_url'];
                 $keyword_list_ss[$key][$i]['title'] = $data['ad' . $k . '_title'];
             }
         }
     }
     // echo "<pre>";
     // print_r($keyword_list_ss);
     $this->assign('keyword_list_ss', $keyword_list_ss);
     return $data;
 }
开发者ID:dongfeihu,项目名称:estore,代码行数:32,代码来源:main.widget.php

示例4: get_type_logist

 function get_type_logist($logist, $city_id, $types)
 {
     $logist_fee = array();
     // 通过运送目的地city_id(城市id),获取该城市的上级id,即省id,如果 $city_id=0(等于0是在通过淘宝IP数据库无法返回正常的城市名称的前提下出现,当出现该情况时,取默认运费,即设置:province_id=1
     if ($city_id) {
         $region_mod =& m('region');
         $region = $region_mod->get(array('conditions' => 'region_id=' . $city_id, 'fields' => 'parent_id'));
         $porovince_id = $region['parent_id'];
     } else {
         $porovince_id = 1;
     }
     foreach ($types as $type) {
         $find = false;
         if (isset($logist['area_fee'][$type])) {
             if (isset($logist['area_fee'][$type]['other_fee'])) {
                 foreach ($logist['area_fee'][$type]['other_fee'] as $key => $val) {
                     $dest_ids = explode('|', $val['dest_ids']);
                     if (in_array($city_id, $dest_ids) || in_array($porovince_id, $dest_ids)) {
                         $logist_fee[] = array('type' => $type, 'name' => Lang::get($type), 'start_standards' => $val['start_standards'], 'start_fees' => $val['start_fees'], 'add_standards' => $val['add_standards'], 'add_fees' => $val['add_fees']);
                         $find = true;
                         break;
                     }
                 }
                 if (!$find) {
                     $logist_fee[] = array('type' => $type, 'name' => Lang::get($type), 'start_standards' => $logist['area_fee'][$type]['default_fee']['start_standards'], 'start_fees' => $logist['area_fee'][$type]['default_fee']['start_fees'], 'add_standards' => $logist['area_fee'][$type]['default_fee']['add_standards'], 'add_fees' => $logist['area_fee'][$type]['default_fee']['add_fees']);
                 }
             } else {
                 $logist_fee[] = array('type' => $type, 'name' => Lang::get($type), 'start_standards' => $logist['area_fee'][$type]['default_fee']['start_standards'], 'start_fees' => $logist['area_fee'][$type]['default_fee']['start_fees'], 'add_standards' => $logist['area_fee'][$type]['default_fee']['add_standards'], 'add_fees' => $logist['area_fee'][$type]['default_fee']['add_fees']);
             }
         }
     }
     return $logist_fee;
 }
开发者ID:BGCX261,项目名称:zmall-svn-to-git,代码行数:33,代码来源:delivery_template.model.php

示例5: checkAjax

 public function checkAjax()
 {
     $adminuser = $this->request('adminuser');
     $adminpass = $this->request('adminpass');
     $msg = '';
     if ($this->isempt($adminuser)) {
         $msg = '帐号不能为空';
     }
     $log = m('log');
     $db = m('admin');
     if ($msg == '') {
         $us = $db->getone("`user`='{$adminuser}' and `status`=1 and `type`=1 and `state`<>5", '`pass`,`id`,`name`,`user`,`imonline`');
         if (!$us) {
             $msg = '帐号不存在';
         } else {
             $pass = $us['pass'];
             if (md5($adminpass) != $pass) {
                 $msg = '密码不对';
             }
         }
     }
     if ($msg == '') {
         if ($us['imonline'] == 1) {
             //$msg = '请不要重复登录';
         }
     }
     if ($msg == '') {
         $adminid = $us['id'];
         m('admin')->update("`imonline`=1", $adminid);
         $keystr = $this->jm->strrocktoken(array('m' => 'index', 'd' => 'webim', 'uid' => $adminid));
         $msg = 'success@@@' . $keystr . '';
     }
     echo $msg;
 }
开发者ID:fatfox21,项目名称:rockoademo,代码行数:34,代码来源:loginAction.php

示例6: view

 /**
  *    查看
  *
  *    @author    Garbin
  *    @param    none
  *    @return    void
  */
 function view()
 {
     $order_id = isset($_GET['id']) ? intval($_GET['id']) : 0;
     if (!$order_id) {
         $this->show_warning('no_such_order');
         return;
     }
     /* 获取订单信息 */
     $model_order =& m('order');
     $order_info = $model_order->get(array('conditions' => $order_id, 'join' => 'has_orderextm', 'include' => array('has_ordergoods')));
     if (!$order_info) {
         $this->show_warning('no_such_order');
         return;
     }
     $order_type =& ot($order_info['extension']);
     $order_detail = $order_type->get_order_detail($order_id, $order_info);
     $order_info['group_id'] = 0;
     if ($order_info['extension'] == 'groupbuy') {
         $groupbuy_mod =& m('groupbuy');
         $groupbuy = $groupbuy_mod->get(array('fields' => 'groupbuy.group_id', 'join' => 'be_join', 'conditions' => "order_id = {$order_info['order_id']} "));
         $order_info['group_id'] = $groupbuy['group_id'];
     }
     foreach ($order_detail['data']['goods_list'] as $key => $goods) {
         if (substr($goods['goods_image'], 0, 7) != 'http://') {
             $order_detail['data']['goods_list'][$key]['goods_image'] = SITE_URL . '/' . $goods['goods_image'];
         }
     }
     $this->assign('order', $order_info);
     $this->assign($order_detail['data']);
     $this->display('order.view.html');
 }
开发者ID:zhangxiaoling,项目名称:ecmall,代码行数:38,代码来源:order.app.php

示例7: initFileSystem

 /**
  * Init current file system module and server requests handler
  */
 protected function initFileSystem()
 {
     /** @var \samsonphp\fs\FileService $fs */
     $fs = !isset($this->fs) ? m('fs') : $this->fs;
     // Store pointer to file system module
     $this->fs = $fs;
 }
开发者ID:expenect,项目名称:upload,代码行数:10,代码来源:UploadController.php

示例8: getCategory

 public function getCategory()
 {
     global $_W;
     $shopset = m('common')->getSysset('shop');
     $allcategory = array();
     $category = pdo_fetchall("SELECT * FROM " . tablename('ewei_shop_category') . " WHERE uniacid=:uniacid and enabled=1 ORDER BY parentid ASC, displayorder DESC", array(':uniacid' => $_W['uniacid']));
     $category = set_medias($category, array('thumb', 'advimg'));
     foreach ($category as $c) {
         if (empty($c['parentid'])) {
             $children = array();
             foreach ($category as $c1) {
                 if ($c1['parentid'] == $c['id']) {
                     if (intval($shopset['catlevel']) == 3) {
                         $children2 = array();
                         foreach ($category as $c2) {
                             if ($c2['parentid'] == $c1['id']) {
                                 $children2[] = $c2;
                             }
                         }
                         $c1['children'] = $children2;
                     }
                     $children[] = $c1;
                 }
             }
             $c['children'] = $children;
             $allcategory[] = $c;
         }
     }
     return $allcategory;
 }
开发者ID:ChainBoy,项目名称:wxfx,代码行数:30,代码来源:shop.php

示例9: getmontlistAjax

 public function getmontlistAjax()
 {
     $enddt = $this->get('enddt');
     $dt = $this->get('startdt');
     $uid = $this->get('uid');
     $dtc = c('date', true);
     $jg = $dtc->datediff('d', $dt, $enddt);
     $dtaa1 = strtotime($this->date);
     $dbw = m('schedule');
     $arr = array();
     for ($i = 0; $i <= $jg; $i++) {
         if ($i > 0) {
             $dt = $dtc->adddate($dt, 'd', 1);
         }
         $dtaa2 = strtotime($dt);
         $s = '';
         $col = '';
         $rows = $dbw->getdtarr($dt, $uid);
         foreach ($rows as $a => $ars) {
             $s .= '' . ($a + 1) . '.' . $ars['title'] . '<br>';
         }
         if ($dtaa2 == $dtaa1) {
         } else {
             if ($dtaa2 < $dtaa1) {
                 $col = '#888888';
             } else {
                 $col = '#888888';
             }
         }
         $arr[$i + 1] = array('str' => '<font color="' . $col . '">' . $s . '</font>');
     }
     echo json_encode($arr);
 }
开发者ID:fatfox21,项目名称:rockoademo,代码行数:33,代码来源:scheduleAction.php

示例10: write

function write(&$frm)
{
    if (isset($_REQUEST["btn_back"])) {
        return enter($frm);
    }
    if ($frm->validate("write")) {
        return confirm($frm);
    }
    $upd = new dbUpdate("suppstock", "cubit");
    $del = new dbDelete("suppstock", "cubit");
    foreach ($_REQUEST["stkcod"] as $suppid => $stkcod) {
        if (empty($stkcod)) {
            $del->setOpt("suppid='{$suppid}' AND stkid='{$_REQUEST['id']}'");
            $del->run();
            continue;
        }
        $cols = grp(m("suppid", $suppid), m("stkid", $_REQUEST["id"]), m("stkcod", $stkcod));
        $upd->setOpt($cols, "suppid='{$suppid}' AND stkid='{$_REQUEST['id']}'");
        $upd->run(DB_REPLACE);
    }
    foreach ($_REQUEST["stkdes"] as $suppid => $stkdes) {
        if (empty($stkcod)) {
            $del->setOpt("suppid='{$suppid}' AND stkid='{$_REQUEST['id']}'");
            $del->run();
            continue;
        }
        $cols = grp(m("suppid", $suppid), m("stkid", $_REQUEST["id"]), m("stkdes", $stkdes));
        $upd->setOpt($cols, "suppid='{$suppid}' AND stkid='{$_REQUEST['id']}'");
        $upd->run(DB_REPLACE);
    }
    $OUT = "<script>window.close();</script>";
    return $OUT;
}
开发者ID:andrecoetzee,项目名称:accounting-123.com,代码行数:33,代码来源:supp_stkcod.php

示例11: pagesetAction

 public function pagesetAction()
 {
     $setid = $this->get('setid');
     $rs = m('flow_set')->getone("`id`='{$setid}'");
     if (!$rs) {
         exit('sorry!');
     }
     $this->smartydata['rs'] = $rs;
     $this->title = $rs['name'] . '_页面设置';
     $table = $rs['table'];
     $farr = c('edit')->getfield($table, 1);
     $fleft = array();
     $fleft[] = array('base_name', '申请人');
     $fleft[] = array('base_deptname', '申请部门');
     $fleft[] = array('base_sericnum', '单号');
     foreach ($farr as $k => $rs1) {
         $fleft[] = array($k, $rs1['name']);
     }
     $fleft[] = array('file_content', '相关文件');
     $this->smartydata['fleft'] = $fleft;
     $path = '' . ROOT_PATH . '/webrock/flow/applyview/page/page_' . $rs['num'] . '.html';
     $content = '';
     if (file_exists($path)) {
         $content = file_get_contents($path);
     }
     $this->smartydata['content'] = $content;
 }
开发者ID:fatfox21,项目名称:rockoademo,代码行数:27,代码来源:setAction.php

示例12: AlipayconnectApp

 function AlipayconnectApp()
 {
     parent::__construct();
     $this->_bink_mod =& m('member_bind');
     $this->_app = 'alipay';
     $this->alipay_config = $this->_hook('on_alipay_login');
 }
开发者ID:BGCX261,项目名称:zmall-svn-to-git,代码行数:7,代码来源:alipayconnect.app.php

示例13: setFooter

 public function setFooter()
 {
     global $_GPC;
     $openid = m('user')->getOpenid();
     if (empty($openid)) {
         return;
     }
     $mid = intval($_GPC['mid']);
     $this->footer['first'] = array('text' => '首页', 'ico' => 'home', 'url' => $this->createMobileUrl('shop'));
     $this->footer['second'] = array('text' => '分类', 'ico' => 'list', 'url' => $this->createMobileUrl('shop/category'));
     $this->footer['commission'] = false;
     if (p('commission')) {
         $set = p('commission')->getSet();
         if (empty($set['level'])) {
             return;
         }
         $member = m('member')->getMember($openid);
         $isagent = $member['isagent'] == 1 && $member['status'] == 1;
         if ($_GPC['do'] == 'plugin') {
             $this->footer['first'] = array('text' => '小店', 'ico' => 'home', 'url' => $this->createPluginMobileUrl('commission/myshop', array('mid' => $member['id'])));
             if ($_GPC['method'] == '') {
                 $this->footer['first']['text'] = "我的小店";
             }
             $this->footer['commission'] = array('text' => '分销中心', 'ico' => 'sitemap', 'url' => $this->createPluginMobileUrl('commission'));
         } else {
             if (!$isagent) {
                 $this->footer['commission'] = array('text' => '成为分销商', 'ico' => 'sitemap', 'url' => $this->createPluginMobileUrl('commission/register'));
             } else {
                 $this->footer['commission'] = array('text' => '小店', 'ico' => 'heart', 'url' => $this->createPluginMobileUrl('commission/myshop', array('mid' => $member['mid'])));
             }
         }
     }
 }
开发者ID:noikiy,项目名称:mygit,代码行数:33,代码来源:core.php

示例14: saveAjax

 public function saveAjax()
 {
     $stotal = (int) $this->rock->post('stotal');
     $mnum = $this->rock->post('mnum');
     $ids = array();
     $db = m('where');
     $ida = '0';
     for ($i = 0; $i < $stotal; $i++) {
         $id = $this->rock->post('id_' . $i);
         if ($this->rock->contain($id, 'rand')) {
             $id = '0';
         }
         $id = (int) $id;
         $where = '';
         if ($id > 0) {
             $where = "`id`='{$id}'";
         }
         $arr = array('name' => $this->rock->post('name_' . $i), 'field' => $this->rock->post('field_' . $i), 'optlx' => $this->rock->post('optlx_' . $i), 'value' => $this->rock->post('value_' . $i), 'values' => $this->rock->post('values_' . $i), 'luoji' => $this->rock->post('luoji_' . $i), 'sort' => $i, 'mnum' => $mnum, 'optdt' => $this->now, 'optid' => $this->adminid);
         if ($i == 0) {
             $arr['explain'] = $this->rock->post('explain');
         }
         $db->record($arr, $where);
         if ($id == 0) {
             $id = $this->db->insert_id();
         }
         $ids[] = $id;
         $ida .= ',' . $id . '';
     }
     $db->delete("`mnum`='{$mnum}' and `id` not in({$ida})");
     echo json_encode($ids);
 }
开发者ID:fatfox21,项目名称:rockoademo,代码行数:31,代码来源:whereAction.php

示例15: XwbconnectApp

 function XwbconnectApp()
 {
     parent::__construct();
     $this->_bink_mod =& m('member_bind');
     $this->_app = 'xwb';
     $this->xwb_config = $this->_hook('on_xwb_login');
 }
开发者ID:BGCX261,项目名称:zmall-svn-to-git,代码行数:7,代码来源:xwbconnect.app.php


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