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


PHP CommonAction类代码示例

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


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

示例1: __construct

 public function __construct()
 {
     parent::__construct();
     //        $this->pM = D('Product');
     //        $this->bM = D('Brand');
     //        $this->sM = D('Store');
 }
开发者ID:bennylii,项目名称:waterfall,代码行数:7,代码来源:IndexAction.class.php

示例2: dirname

 function _initialize()
 {
     parent::_initialize();
     $this->url_path = dirname('http://' . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF']);
     $this->theme = isset($_REQUEST['theme']) && $_REQUEST['theme'] != '' ? trim($_REQUEST['theme']) : 'default';
     cookie('think_template', $this->theme);
 }
开发者ID:babyhuangshiming,项目名称:webserver,代码行数:7,代码来源:BuildAction.class.php

示例3: __construct

 public function __construct()
 {
     parent::__construct();
     if (empty($_SESSION['info']['a_name'])) {
         $this->redirect('Login/index');
     }
 }
开发者ID:snowtl,项目名称:tanglang,代码行数:7,代码来源:CenterAction.class.php

示例4: review

 public function review()
 {
     $uid = intval($_GET['uid']);
     if ($uid == '') {
         parent::error404();
     }
     //分配根据GET传过来的uid用户的信息
     $objUser = M('user');
     $userMessage = $objUser->where('id=' . $uid)->field('id,username,face,introduce,point,exp')->find();
     $userMessage = deep_htmlspecialchars_decode($userMessage);
     if ($userMessage == '') {
         parent::error404();
     }
     $this->assign('userMessage', $userMessage);
     //分配该用户的评论
     $objComment = M('comment');
     import('ORG.Util.Page');
     //导入分页类
     $count = $objComment->where(array('comment_uid' => $uid))->count();
     $page = new page($count, 20);
     $page->setConfig('theme', '%upPage% %first% %prePage% %linkPage% %downPage%');
     $commentList = $objComment->where(array('comment_uid' => $uid))->field('aid,time,comment')->order('time desc')->limit($page->firstRow . ',' . $page->listRows)->select();
     foreach ($commentList as $k1 => $v1) {
         $commentList[$k1]['url'] = '__APP__/List/detail/id/' . $v1['aid'] . '.html';
     }
     $commentList = deep_htmlspecialchars_decode($commentList);
     $show = $page->show();
     $this->assign('page', $show);
     $this->assign('commentList', $commentList);
     //分配Pagetitle
     $this->pageTitle = $userMessage['username'] . '的个人主页_支招网';
     $this->display();
 }
开发者ID:GobYang,项目名称:zhizhao,代码行数:33,代码来源:UserAction.class.php

示例5: index

 public function index()
 {
     $data = parent::index(true);
     if ($_GET["mergeSameRows"] && $_GET["batch"] === "all") {
         $tmp = array();
         foreach ($data as $row) {
             $k = $row["factory_code_all"] . "|" . $row["repository_id"];
             if (!$tmp[$k]) {
                 $tmp[$k] = $row;
                 $tmp[$k]["stocks"][] = $row["stock_name"];
             } else {
                 $tmp[$k]["num"] += $row["num"];
                 if (!in_array($row["stock_name"], $tmp[$k]["stocks"])) {
                     $tmp[$k]["stocks"][] = $row["stock_name"];
                 }
             }
         }
         foreach ($tmp as $k => $v) {
             $tmp[$k]["stock_name"] = implode(",", $v["stocks"]);
             unset($tmp[$k]["stocks"]);
         }
         $this->response(reIndex($tmp));
     } else {
         $this->response($data);
     }
 }
开发者ID:bqx619,项目名称:ones_dev,代码行数:26,代码来源:StockLogAction.class.php

示例6: D

 function __construct()
 {
     parent::__construct();
     $this->db = D("Model");
     $this->field_db = D("ModelField");
     $this->type_db = D("ModelType");
 }
开发者ID:lxp521125,项目名称:TP-Admin,代码行数:7,代码来源:ModelAction.class.php

示例7: add

 public function add()
 {
     $this->assign("newsort", M(MODULE_NAME)->max("sort") + 1);
     $cate_tree = M("Forum")->where('parent_id = 0')->order('sort asc,fid asc')->findAll();
     $this->assign("cate_tree", $cate_tree);
     parent::add();
 }
开发者ID:dalinhuang,项目名称:concourse,代码行数:7,代码来源:ForumAction.class.php

示例8: singleEdit

 public function singleEdit()
 {
     $id = intval($_GET['id']);
     $objSingle = M('single');
     if (IS_POST) {
         $POST = deep_htmlspecialchars($_POST);
         parent::checkField('title', $POST['title'], 'require', '单页标题不能为空');
         parent::checkField('content', $POST['content'], 'require', '内容不能为空');
         $data = array();
         $data['id'] = $POST['id'];
         $data['title'] = $POST['title'];
         $data['status'] = $POST['status'];
         $data['content'] = $POST['content'];
         $result = $objSingle->save($data);
         if ($result) {
             $this->success('修改成功...', U(APP_NAME . '/Single/singlelist'));
         } else {
             $this->error('修改失败,请稍后再试');
         }
     } else {
         $data = $objSingle->where('id=' . $id)->find();
         $data = deep_htmlspecialchars_decode($data);
         $this->assign('data', $data);
         $this->display();
     }
 }
开发者ID:GobYang,项目名称:zhizhao,代码行数:26,代码来源:SingleAction.class.php

示例9: edit

 public function edit()
 {
     $user_model = M("User");
     $sell_list = $user_model->where("user_sort=2")->field("id,username")->select();
     $this->assign('sell_list', $sell_list);
     parent::edit();
 }
开发者ID:yunsite,项目名称:nuomituan,代码行数:7,代码来源:DealAction.class.php

示例10: add

 public function add()
 {
     $cate_list = D('NavCategory')->where('status = 1')->order('sort ASC,id ASC')->findAll();
     $cate_list = D('NavCategory')->toFormatTree($cate_list, 'name', 'id');
     $this->assign("cate_list", $cate_list);
     parent::add();
 }
开发者ID:dalinhuang,项目名称:concourse,代码行数:7,代码来源:NavAction.class.php

示例11: read

 public function read()
 {
     if (!$_GET["includeRows"] or $_GET['workflow']) {
         return parent::read();
     }
     $formData = parent::read(true);
     $formData["inputTime"] = $formData["dateline"] * 1000;
     $rowModel = D("ReturnsDetailView");
     $rows = $rowModel->where("ReturnsDetail.returns_id=" . $formData["id"])->select();
     //        echo $rowModel->getLastSql();exit;
     $modelIds = array();
     $rowData = array();
     foreach ($rows as $v) {
         $tmp = explode(DBC("goods.unique.separator"), $v["factory_code_all"]);
         //根据factory_code_all factory_code - standard - version
         $factory_code = array_shift($tmp);
         $modelIds = array_merge($modelIds, $tmp);
         $v["modelIds"] = $tmp;
         $v["goods_id"] = sprintf("%s_%s_%s", $factory_code, $v["goods_id"], $v["goods_category_id"]);
         // factory_code, id, catid
         $v["goods_id_label"] = sprintf("%s", $v["goods_name"]);
         $v["unit_price"] = $v["price"];
         $v["amount"] = $v["num"];
         $rowData[$v["id"]] = $v;
     }
     //        array_flip(array_flip($modelIds));
     $formData["customer_id_label"] = $formData["customer"];
     $dataModel = D("DataModelDataView");
     $rowData = $dataModel->assignModelData($rowData, $modelIds);
     $formData["rows"] = reIndex($rowData);
     $this->response($formData);
 }
开发者ID:bqx619,项目名称:ones_dev,代码行数:32,代码来源:ReturnsAction.class.php

示例12: read

 public function read()
 {
     if (!$_GET["includeRows"] or $_GET['workflow']) {
         return parent::read();
     }
     $formData = parent::read(true);
     $formData["start_time"] = $formData["start_time"] * 1000;
     $formData["end_time"] = $formData["end_time"] * 1000;
     $rowModel = D("ProducePlanDetailView");
     $rows = $rowModel->where("ProducePlanDetail.plan_id=" . $formData["id"])->select();
     //        echo $rowModel->getLastSql();exit;
     $modelIds = array();
     $rowData = array();
     foreach ($rows as $v) {
         $tmp = explode(DBC("goods.unique.separator"), $v["factory_code_all"]);
         //根据factory_code_all factory_code - standard - version
         $factory_code = array_shift($tmp);
         $modelIds = array_merge($modelIds, $tmp);
         $v["modelIds"] = $tmp;
         $v["stock"] = $v["stock_id"];
         $v["stock_label"] = $v["stock_name"];
         $v["goods_id"] = sprintf("%s_%s_%s", $factory_code, $v["goods_id"], $v["goods_category_id"]);
         // factory_code, id, catid
         $v["goods_id_label"] = sprintf("%s", $v["goods_name"]);
         $rowData[$v["id"]] = $v;
     }
     //        array_flip(array_flip($modelIds));
     $params = array($rowData, $modelIds);
     tag("assign_dataModel_data", $params);
     $formData["rows"] = reIndex($params[0]);
     $this->response($formData);
 }
开发者ID:bqx619,项目名称:ones_dev,代码行数:32,代码来源:ProducePlanAction.class.php

示例13: index

 public function index()
 {
     if (strim($_REQUEST['order_sn']) != '') {
         $condition['order_id'] = M("DealOrder")->where("order_sn='" . strim($_REQUEST['order_sn']) . "'")->getField("id");
     }
     if (strim($_REQUEST['notice_sn']) != '') {
         $condition['notice_sn'] = $_REQUEST['notice_sn'];
     }
     if (strim($_REQUEST['user_name']) != '') {
         $condition['user_id'] = M("User")->where("user_name='" . strim($_REQUEST['user_name']) . "'")->getField("id");
     }
     if (strim($_REQUEST['begin_time']) != '') {
         $start_time = strtotime($_REQUEST['begin_time'] . ' 00:00:00');
         $end_time = strtotime($_REQUEST['begin_time'] . ' 23:59:59');
         $condition['s_create_time'] = $start_time;
         //开始时间
         $condition['e_create_time'] = $end_time;
         //结束时间
     }
     $condition['is_payment_list'] = 1;
     if (intval($_REQUEST['payment_id']) == 0) {
         unset($_REQUEST['payment_id']);
     }
     $this->assign("default_map", $condition);
     $this->assign("payment_list", M("Payment")->findAll());
     parent::index();
 }
开发者ID:macall,项目名称:jishida,代码行数:27,代码来源:PaymentNoticeAction.class.php

示例14: editDetails

 public function editDetails()
 {
     $objLinkTxt = M('linktxt');
     $id = intval($_GET['id']);
     if ($_POST) {
         $POST = deep_htmlspecialchars($_POST);
         parent::checkField('link_name', $POST['link_name'], 'require', '友情链接名称不能为空');
         parent::checkField('link_url', $POST['link_url'], 'require', '友情链接地址不能为空');
         parent::checkField('explain', $POST['explain'], 'require', '友情链接备注不能为空');
         $data = array();
         $data['id'] = $POST['id'];
         $data['link_name'] = $POST['link_name'];
         $data['status'] = $POST['status'];
         $data['link_url'] = $POST['link_url'];
         $data['explain'] = $POST['explain'];
         $result = $objLinkTxt->data($data)->save();
         if ($result) {
             $this->success('修改成功', U(GROUP_NAME . '/Link/detailslist'));
         } else {
             $this->error('修改失败');
         }
     } else {
         $data = $objLinkTxt->where('id=' . $id)->find();
         $data = deep_htmlspecialchars_decode($data);
         $this->assign('data', $data);
         $this->display();
     }
 }
开发者ID:GobYang,项目名称:zhizhao,代码行数:28,代码来源:LinkAction.class.php

示例15: __construct

 public function __construct()
 {
     parent::__construct();
     $this->server = DBC("remote.service.uri") . "Update/";
     $this->local = ENTRY_PATH . "/Data/Updates/";
     $this->currentVersion = DBC("system.version");
 }
开发者ID:bqx619,项目名称:ones_dev,代码行数:7,代码来源:SystemUpdateAction.class.php


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