本文整理汇总了PHP中CommonModel类的典型用法代码示例。如果您正苦于以下问题:PHP CommonModel类的具体用法?PHP CommonModel怎么用?PHP CommonModel使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CommonModel类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: view_addOrder
public function view_addOrder()
{
$OmAccountAct = new OmAccountAct();
$state = isset($_GET['state']) ? post_check($_GET['state']) : '';
$this->smarty->assign('state', $state);
//平台
//$platform_lsit = OmAvailableModel::getTNameList("om_platform","*","where is_delete=0");
$platform_lsit = $OmAccountAct->act_getPlatformListByPower();
$tmpPlatformList = array();
foreach ($platform_lsit as $value) {
if (in_array($value['id'], array(3))) {
$tmpPlatformList[] = $value;
}
}
$platform_lsit = $tmpPlatformList;
$this->smarty->assign('platform_lsit', $platform_lsit);
//账号
//$account_lsit = OmAvailableModel::getTNameList("om_account","*","where is_delete=0 and platformId=3");
$account_lsit = $OmAccountAct->act_getAccountListByPlatform();
$account_lsit = array();
$this->smarty->assign('account_lsit', $account_lsit);
//物流
$Shiping = CommonModel::getCarrierList();
$this->smarty->assign('Shiping', $Shiping);
$toplevel = 2;
//一级菜单的序号
$this->smarty->assign('toplevel', $toplevel);
$secondlevel = 21;
//当前的二级菜单
$this->smarty->assign('secondlevel', $secondlevel);
$this->smarty->assign('toptitle', '订单添加');
$this->smarty->assign('curusername', $_SESSION['userName']);
$this->smarty->display('orderAdd.htm');
}
示例2: act_updateNewPostion
public static function act_updateNewPostion()
{
$sku = isset($_GET['sku']) ? $_GET['sku'] : '';
$location = isset($_GET['location']) ? $_GET['location'] : '';
if (empty($sku)) {
self::$errCode = 400;
self::$errMsg = "sku参数有误!";
return false;
}
if (empty($location)) {
self::$errCode = 400;
self::$errMsg = "sku参数有误!";
return false;
}
$data = CommonModel::updateNewPostion($sku, $location);
if ($data) {
self::$errCode = 200;
self::$errMsg = "更新成功!";
return true;
} else {
self::$errCode = 400;
self::$errMsg = "更新失败!";
return false;
}
}
示例3: view_orderWeighing
public function view_orderWeighing()
{
$config_path = 'images/cz';
$time = date("Y/m/d", time());
$dirPath = $config_path . '/' . $time;
if (!is_dir($dirPath)) {
mkdirs($dirPath, 0777);
}
$this->smarty->assign('time', $time);
$navlist = array(array('url' => '', 'title' => '出库'), array('url' => 'index.php?mod=waitWeighing&act=waitWeighingList', 'title' => '待称重'), array('url' => '', 'title' => '称重扫描<小包>'));
$secnev = 3;
$toplevel = 2;
$secondlevel = 26;
//$userName = $_SESSION['username'];
//$this->smarty->assign('secnev','1');
$this->smarty->assign('navlist', $navlist);
$this->smarty->assign('secnev', $secnev);
$this->smarty->assign('toplevel', $toplevel);
$this->smarty->assign('secondlevel', $secondlevel);
$partion_list = CommonModel::getChannelNameByIds('all');
//$channel_list = CommonModel::getCarrierChannelByIds('all');
$channel_list = C('MAILWAYCONFIG');
$this->smarty->assign("partion_list", $partion_list);
$this->smarty->assign("channel_list", $channel_list);
//$this->smarty->assign('toptitle', '货品资料管理');
$this->smarty->display('orderWeighing.htm');
}
示例4: act_judgeCombineSku
function act_judgeCombineSku($sku)
{
$list = CommonModel::judgeCombineSku($sku);
if ($list) {
return $list;
} else {
self::$errCode = CommonModel::$errCode;
self::$errMsg = CommonModel::$errMsg;
return 0;
}
}
示例5: act_getChannel
/**
* 通过运输方式id获取对应的渠道
* @return array $channellist
* @author czq
*/
public function act_getChannel()
{
$transportId = isset($_POST['transportId']) ? intval($_POST['transportId']) : '';
if (empty($transportId)) {
$errCode = 101;
$errMsg = '未获取运输方式id';
return false;
}
$channellist = CommonModel::getCarrierChannelByIds($transportId);
//获取国家渠道信息
self::$errCode = 200;
self::$errMsg = '获取运输渠道成功!';
return $channellist;
}
示例6: view_waitWeighingList
public function view_waitWeighingList()
{
$pagesize = 100;
//页面大小
$statusar = array(PKS_WWEIGHING, PKS_WWEIGHING_EX, PKS_INLANDWWEIGHING);
$statusstr = implode(',', $statusar);
$packing_obj = new PackingOrderModel();
$count = $packing_obj->getRecordsNumByStatus($statusar);
//获得当前状态为待包装的发货单总数量
$pager = new Page($count, $pagesize);
//分页对象
$billlist = $packing_obj->getBillList(' and orderStatus in (' . $statusstr . ') order by po.id ' . $pager->limit);
$this->smarty->assign('billlist', $billlist);
$ShipingTypeList = CommonModel::getShipingTypeListKeyId();
$count = count($billlist);
for ($i = 0; $i < $count; $i++) {
$billlist[$i]['shipingname'] = isset($ShipingTypeList[$billlist[$i]['transportId']]) ? $ShipingTypeList[$billlist[$i]['transportId']] : '';
}
$acc_id_arr = array();
foreach ($billlist as $key => $valbil) {
if (!in_array($valbil['accountId'], $acc_id_arr)) {
array_push($acc_id_arr, $valbil['accountId']);
}
}
$salesaccountinfo = CommonModel::getAccountInfo($acc_id_arr);
$this->smarty->assign('salesaccountinfo', $salesaccountinfo);
if ($count > $pagesize) {
//分页链接
$pagestr = $pager->fpage(array(0, 2, 3, 4, 5, 6, 7, 8, 9));
} else {
$pagestr = $pager->fpage(array(0, 2, 3));
}
$this->smarty->assign('pagestr', $pagestr);
$navlist = array(array('url' => '', 'title' => '出库'), array('url' => '', 'title' => '待包装称重'));
$this->smarty->assign('navlist', $navlist);
$toptitle = '待包装称重';
//顶部链接
$this->smarty->assign('toptitle', $toptitle);
$toplevel = 2;
//顶层菜单
$this->smarty->assign('toplevel', $toplevel);
$secondlevel = '26';
//当前的二级菜单
$this->smarty->assign('secondlevel', $secondlevel);
$this->smarty->assign('secnev', 3);
//二级导航
$this->smarty->display('waitweighinglist.htm');
}
示例7: act_getGroupInfo
function act_getGroupInfo()
{
$userId = $_SESSION['userId'];
$shipOrderGroup = $_POST['order_group'];
$group_sql = WhGoodsAssignModel::getOrderGroup("*", array('assignNumber' => $shipOrderGroup));
//var_dump($group_sql);exit;
if (empty($group_sql)) {
self::$errCode = "001";
self::$errMsg = "该调拨单号不存在,请重新输入!";
return false;
}
if ($group_sql[0]['status'] != 106) {
self::$errCode = "002";
self::$errMsg = "调拨单只有在接收复核后才可完结!";
return false;
}
$orderIds = WhGoodsAssignModel::getAssignOrderIds($group_sql[0]['id']);
if (!$orderIds) {
self::$errCode = "003";
self::$errMsg = "该调拨单下没有关联的B仓订单!";
return false;
}
$ids = array();
foreach ($orderIds as $id) {
$ids[] = $id['orderId'];
}
TransactionBaseModel::begin();
//更新调拨单状态
$info = WhGoodsAssignModel::updateAssignListStatus(array('id' => $group_sql[0]['id']), array('status' => 107));
if (!$info) {
self::$errCode = "004";
self::$errMsg = "更新调拨单状态失败!";
TransactionBaseModel::rollback();
return false;
}
$ids = implode(',', $ids);
$info = CommonModel::updateOrderStatus($ids, 745);
if ($info['errCode'] != 200) {
self::$errCode = "004";
self::$errMsg = "同步旧ERP订单状态失败!";
TransactionBaseModel::rollback();
return false;
}
self::$errCode = "0";
self::$errMsg = "调拨单完结成功!";
TransactionBaseModel::commit();
return TRUE;
}
示例8: getAdvertise
public static function getAdvertise($position, $modelName = null, $modelId = null)
{
// Header & Footer
if ($modelName == null && $modelId == null) {
if (Cache::has('ad' . $position)) {
$ad = Cache::get('ad' . $position);
} else {
$ad = Advertise::where(array('position' => $position, 'status' => ENABLED))->first();
Cache::put('ad' . $position, $ad, CACHETIME);
}
return $ad;
} else {
//check Common models
if (Cache::has('common_model' . $modelName . $modelId)) {
$common_model = Cache::get('common_model' . $modelName . $modelId);
} else {
$common_model = CommonModel::where(array('model_name' => $modelName, 'model_id' => $modelId))->first();
Cache::put('common_model' . $modelName . $modelId, $common_model, CACHETIME);
}
if ($common_model) {
$common_model_id = $common_model->id;
if (Cache::has('advertisement_id' . $common_model_id)) {
$advertisement_id = Cache::get('advertisement_id' . $common_model_id);
} else {
$advertisement_id = AdvertisePosition::where(array('common_model_id' => $common_model_id, 'status' => ENABLED))->first();
Cache::put('advertisement_id' . $common_model_id, $advertisement_id, CACHETIME);
}
if ($advertisement_id) {
if (Cache::has('ad' . $advertisement_id)) {
$ad = Cache::get('ad' . $advertisement_id);
} else {
$advertisement_id = AdvertisePosition::where(array('common_model_id' => $common_model_id, 'status' => ENABLED))->first()->advertisement_id;
$ad = Advertise::find($advertisement_id);
Cache::put('ad' . $advertisement_id, $advertisement_id, CACHETIME);
}
return $ad;
}
return null;
} else {
return null;
}
}
}
示例9: view_edit
/**
* 编辑一个分渠道
* @author czq
*/
public function view_edit()
{
if ($_POST['submit']) {
$id = intval($_POST['id']);
$data = array('title' => $_POST['title'], 'channelName' => $_POST['channelName'], 'transportId' => $_POST['transportId'], 'channelId' => $_POST['channelId'], 'partition' => $_POST['partition'], 'is_delete' => 0);
WhChannelPartitionModel::update($data, $id);
header("location:index.php?mod=whChannelPartition&act=index");
} else {
$id = intval($_GET['id']);
$data = WhChannelPartitionModel::find($id);
$transportlist = CommonModel::getShipingTypeList();
//获取运输方式
$channellist = CommonModel::getCarrierChannelByIds($data['transportId']);
//获取国家渠道信息
$this->smarty->assign('data', $data);
$this->smarty->assign('transportlist', $transportlist);
$this->smarty->assign('channellist', $channellist);
$this->smarty->display('whChannelPartitionEdit.htm');
}
}
示例10: view_showUserCompense
public function view_showUserCompense()
{
$shipArr = array();
$platformAccountList = CommonModel::getPlatformAccountList();
//获取平台及对应账号
$shipingtyplist = CommonModel::getShipingTypeList();
//运输方式列表
$uid = $_GET['uid'];
$shipArr = UserCompetenceModel::showCompetenceVisibleShip($uid);
$powerAccountList = UserCompetenceModel::showCompetenceVisibleAccount($uid);
//获取权限对应账号
$powerPlatformList = UserCompetenceModel::getCompetenceVisiblePlat($uid);
//获取权限对应平台
$this->smarty->assign('uid', $uid);
$this->smarty->assign('shipArr', $shipArr);
$this->smarty->assign('shipingtypelist', $shipingtyplist);
$this->smarty->assign('platformAccountList', $platformAccountList);
$this->smarty->assign('powerAccountList', $powerAccountList);
$this->smarty->assign('powerPlatformList', $powerPlatformList);
$this->smarty->display("showUserCompense.htm");
}
示例11: _before_write
protected function _before_write(&$data)
{
parent::_before_write($data);
if (!empty($data['user_pass']) && strlen($data['user_pass']) < 25) {
$data['user_pass'] = sp_password($data['user_pass']);
}
}
示例12: getInstance
public static function getInstance()
{
if (!self::$_instance instanceof self) {
self::$_instance = new self();
}
return self::$_instance;
}
示例13: __construct
public function __construct($mode, $params = null)
{
$this->mode = $mode;
$this->params = $params;
$this->user_id = $_SESSION["USER_DATA"]["user_id"];
parent::__construct();
}
示例14: _initialize
public function _initialize()
{
parent::_initialize();
// TODO: Change the autogenerated stub
$this->connection = C('BUSINESS_DB');
$this->tablePrefix = C('BUSINESS_DB_TABLE_PREFIX');
}
示例15: select
public function select($options = array())
{
$data = parent::select($options);
foreach ($data as $k => $v) {
unset($data[$k]["password"]);
}
return $data;
}