本文整理匯總了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;
}