本文整理汇总了PHP中CommonAction类的典型用法代码示例。如果您正苦于以下问题:PHP CommonAction类的具体用法?PHP CommonAction怎么用?PHP CommonAction使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CommonAction类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: index
public function index()
{
$this->assign("parent_region", M("DeliveryRegion")->where("id=" . intval($_REQUEST['pid']))->find());
$condition['pid'] = intval($_REQUEST['pid']);
$this->assign("default_map", $condition);
parent::index();
}
开发者ID:dalinhuang,项目名称:zsh_business,代码行数:7,代码来源:DeliveryRegionAction.class.php
示例17: array
function _initialize()
{
//预处理
$this->permissions = array("1" => "Article", "2" => "Gropus", "3" => "Albums", "4" => "Events", "5" => "Cityguide");
if (!$this->_is_login()) {
$arr = array('/cid/3', '/cid/2', '/cid/1', '/cid/4', '/cid/0', '/1.html', '/0.html', '/2.html', '/3.html', '/4.html', '.html', '/index.php?s=', '/Public/select_city');
$url = str_replace($arr, '', $_SERVER["REQUEST_URI"]);
$url = $url == '/' ? '/Index/index' : $url;
$url = myencode($url);
redirect("/Public/login/to/{$url}");
}
parent::_initialize();
$rudao = D("RoleUser");
$condition = array("user_id" => $this->user['uid']);
$data = array();
$data = $rudao->where($condition)->find();
//dump($rudao->getlastsql());
if (count($data) > 0) {
$data['per'] = unserialize($data['permissions']);
$this->user_per = $data;
$this->assign("permissions", $this->permissions);
$this->assign("per", $data);
}
import("ORG.Util.Page");
$this->assign('pmnum', $this->ckh_pm());
}
开发者ID:putera99,项目名称:iic-classified,代码行数:26,代码来源:CpAction.class.php
示例18: add_sms
public function add_sms()
{
//输出会员组
$group_list = M("UserGroup")->findAll();
$this->assign("group_list", $group_list);
parent::index();
}
开发者ID:myjavawork,项目名称:sanxin-fangwei,代码行数:7,代码来源:PromoteMsgAction.class.php
示例19: __construct
/**
* 构造函数,父类
* @Title: __construct
* @Description: todo(基础构造函数)
*
* @author quqiang
* @date 2015年5月12日 下午4:37:55
* @throws
*
*/
public function __construct()
{
parent::__construct();
// 加载基础配置信息
$dir = CONF_PATH;
$configDir = $dir . 'desing.php';
if (!file_exists($configDir)) {
$msg = '文件 ' . $configDir . ' 不存在!';
throw new NullDataExcetion($msg);
}
require $configDir;
$this->default = $desing_default;
$this->controls = $desing_controll;
// 合并组件配置元素
if ($this->controls && $this->default) {
unset($temp);
foreach ($this->controls as $k => $v) {
$array = array_merge($this->default, $v['property']);
sortArray($array, 'sort');
$temp[$k] = $array;
}
$this->controlsConfig = $temp;
}
$this->assign('config', $this->controlsConfig);
$this->assign('control', $this->controls);
$this->assign('tagIndentity', $this->tagIndentity);
$this->assign('propertyTagType', $this->propertyTagType);
}
开发者ID:tmlsoft,项目名称:main,代码行数:38,代码来源:DesingFormBaseAction.class.php
示例20: read
public function read()
{
if (!$_GET["includeRows"] or $_GET['workflow']) {
return parent::read();
}
// $this->readModel = "PurchaseView";
// $formData = parent::read(true);
$formData = D("PurchaseView")->find($_GET['id']);
$formData["inputTime"] = $formData["dateline"] * 1000;
// $formData["total_amount"] = $formData["total_price"];
// $formData["total_amount_real"] = $formData["total_price_real"];
// $formData["total_num"] = $formData["quantity"];
$rowModel = D("PurchaseDetailView");
$rows = $rowModel->where("PurchaseDetail.purchase_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["amount"] = $v["price"];
$rowData[$v["id"]] = $v;
}
// array_flip(array_flip($modelIds));
$formData["customer_id_label"] = $formData["customer"];
$params = array($rowData, $modelIds);
tag("assign_dataModel_data", $params);
$formData["rows"] = reIndex($params[0]);
/*
* 相关单据
* **/
$relateItem = array();
$id = abs(intval($_GET["id"]));
if (isAppLoaded("store")) {
$tmp = D("Stockin")->toRelatedItem("Purchase", $id);
if ($tmp) {
$relateItem = array_merge($relateItem, $tmp);
}
}
if (isAppLoaded("finance")) {
$tmp = D("FinancePayPlan")->toRelatedItem("Purchase", $id);
if ($tmp) {
$relateItem = array_merge($relateItem, $tmp);
}
}
if ($formData["source_model"] == "ProducePlan" && $formData["source_id"] && isAppLoaded("produce")) {
$tmp = D("ProducePlan")->getRelatedItem($formData["source_id"]);
if ($tmp) {
$relateItem[] = $tmp;
}
}
$formData["relatedItems"] = $relateItem;
$this->response($formData);
}
开发者ID:bqx619,项目名称:ones_dev,代码行数:60,代码来源:PurchaseAction.class.php
注:本文中的CommonAction类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论