本文整理汇总了PHP中Sys::D方法的典型用法代码示例。如果您正苦于以下问题:PHP Sys::D方法的具体用法?PHP Sys::D怎么用?PHP Sys::D使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Sys
的用法示例。
在下文中一共展示了Sys::D方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: index
static function index()
{
Sys::D('StoreVisitStatic');
// StoreVisitStaticModel::newAccessNum(1);
// $accessNum=StoreVisitStaticModel::getVisitedNum(1);
// Sys::D('StoreOrderStatic');
// $num= StoreOrderStaticModel::getDateOrderNum(1,'20150819');
//
// var_dump($num);
// Sys::D('SysMessage');
// $msgData=SysMessageModel::getMsgList();
// Sys::D('UserAddress');
//
// UserAddressModel::newAddress(1,'bee','18224087281','成都市高新区天府软件园D区6栋一楼232');
// UserAddressModel::disabledAddress(1);
//
// $data= UserAddressModel::getList(1);
//
// var_dump($data);
// Sys::D('AreaLnglat');
// $data= AreaLnglatModel::getLngLatByCode('340403');
// $data=AreaLnglatModel::getInfoByCode('510100');
// $address=AreaLnglatModel::decorateAddress('510100','510100','详细地址');
// var_dump($address);
Sys::S('core.PhpExcel.PHPExcel.php');
PHPExcel::init();
$PHPExcel = PHPExcel::load();
}
示例2: login
public static function login($username, $psd)
{
$rs = Sys::M(self::$trueTableName)->select('*', '`username`=\'' . $username . '\'', 1);
if ($rs) {
if ($rs['password'] != md5($psd)) {
if ($rs['login_err_times'] + 1 > self::MAX_LOGIN_ERROR_TIME) {
self::lockAccount($rs['id']);
} else {
self::loginFail($rs['id']);
}
return self::MAX_LOGIN_ERROR_TIME - $rs['login_err_times'];
}
if (!$rs['status']) {
return self::ACCOUNT_DISABLED;
}
/*判断是否已经被锁定*/
if ($rs['last_login_time'] > NOW) {
return self::ACCOUNT_LOCKED;
} else {
self::loginSuccess($rs['id']);
Sys::D('GroupMember');
$rs['group_id'] = GroupMemberModel::getGroupId($rs['id']);
$_SESSION['userinfo'] = $rs;
return self::LOGIN_SUCCESS;
}
} else {
Sys::D('LoginFailLog');
LoginFailLogModel::log($username, $psd);
return self::LOGIN_FAIL;
}
}
示例3: test
public function test()
{
Sys::D('Order');
$goodsData = array(array(1, 3), array(2, 1));
$receiveData = array('username' => 'bee', 'tel' => '18224087281', 'email' => '1107942585@qq.com', 'address' => '四川省成都市青羊区');
OrderModel::add(1, 1, $goodsData, $receiveData, 'this is a remark');
}
示例4: verify
static function verify()
{
$data = array('uname' => array(null, 'string', '', '用户名为空'), 'password' => array(null, 'length', array(4, 16), '密码错误'), 'checkcode' => array(null, 'string', '', '验证码为空'));
Sys::S('core.Verify.Input');
$data = Input::dataFilter($data, 'post');
if (!isset($_SESSION['verify_code']) || strtoupper($data['checkcode']) != $_SESSION['verify_code']) {
Error::halt(self::WRONG_CHECK_CODE, '验证码错误!');
}
$oUcenterMember = Sys::D('UcenterMember');
$loginStatus = UcenterMemberModel::login($data['uname'], $data['password']);
if ($loginStatus >= 10) {
if ($loginStatus == 10) {
Error::halt(UcenterMemberModel::LOGIN_SUCCESS, array('msg' => '登录成功', 'redirect' => DOMAIN . 'Index_index.jsp'));
} else {
if ($loginStatus == UcenterMemberModel::ACCOUNT_LOCKED) {
Error::halt($loginStatus, '账号已被锁定!');
} else {
if ($loginStatus == UcenterMemberModel::ACCOUNT_DISABLED) {
Error::halt($loginStatus, '账号无效');
} else {
Error::halt($loginStatus, '用户名或密码错误');
}
}
}
} else {
$msg = $loginStatus <= 0 ? '您的账号已被锁定' : '登录失败,您还有' . $loginStatus . '次机会登录!';
Error::halt($loginStatus, $msg);
}
}
示例5: getAuthInfo
private static function getAuthInfo()
{
if (!isset($_SESSION['authority'])) {
Sys::D('Group');
$_SESSION['authority'] = GroupModel::getInheritRule($_SESSION['userinfo']['group_id']);
}
return true;
}
示例6: setDriver
/**
* 实例化驱动
*/
private function setDriver($driver, $driver_config)
{
$this->uploader = Sys::D($driver);
if ($this->uploader) {
return $this->uploader->init($driver_config);
} else {
$this->error(10);
}
}
示例7: getOrderGoodsInfo
static function getOrderGoodsInfo($goods_id)
{
$data = Sys::M(self::$trueTableName)->select('`logo`,`name`,`price`,`discount_price`', '`id`=' . $goods_id, 1);
if (empty($data)) {
$data = array('logo' => 0, 'name' => '', 'price' => 0, 'discount_price' => 0);
}
Sys::D('Image');
$imgData = ImageModel::getImageInfo($data['logo']);
return array_merge($data, $imgData);
}
示例8: getMenu
/**
* 获取菜单信息
*/
public static function getMenu($listIds)
{
$menuData = array();
$list = explode(',', $listIds);
foreach ($list as $v) {
$menuData[] = self::getInfo($v);
}
$treeData = Sys::D('Tree.tree')->getTreeData($menuData, 'id', 'pid');
return self::getMenuDecorate($treeData);
}
示例9: getTable
/**
* 获取table入口
*/
public function getTable(&$data)
{
$tableArr = array();
$this->id = $data['id'];
$tableArr[] = '<table class="table dataTable no-footer" id="' . $this->id . '" role="grid" aria-describedby=' . $this->id . '"_info">';
$tableArr[] = $this->getHeader($data['header']);
$pageData = Sys::D('Page')->getPager($data['pageData']);
$tableArr[] = $this->getBody($pageData['data'], $data['callback']);
$tableArr[] = $this->getPager($pageData['paging']);
return implode('', $tableArr);
}
示例10: index
public static function index()
{
Sys::D('AdminLoginLog');
AdminLoginLogModel::log($_SESSION['userinfo']['id'], AdminLoginLogModel::LOGIN_OUT);
if (isset($_SESSION['userinfo'])) {
unset($_SESSION['userinfo']);
}
if (isset($_SESSION['authority'])) {
unset($_SESSION['authority']);
}
Error::halt(SUCCESS, '登出成功!', './Login_index.jsp');
}
示例11: getTable
/**
* 获取table入口
*/
static function getTable(&$data)
{
self::init();
$tableArr = array();
self::$tableId = $data['id'];
$pageData = Sys::D('Page')->getPager($data['pageData']);
$tableArr[] = '<div class="paging_full_numbers">';
$tableArr[] = '<table class="table dataTable no-footer" id="' . self::$tableId . '">';
$tableArr[] = self::getHeader($pageData['paging'], $data['header']);
$tableArr[] = self::getBody($pageData['data'], $data['callback']);
$tableArr[] = '</table>';
$tableArr[] = self::getPager($pageData['paging']);
$tableArr[] = '</div>';
return implode('', $tableArr);
}
示例12: modifyPassword
public function modifyPassword()
{
Sys::S('core.Verify.Input');
$data = array('src_password' => array(null, 'string', '', '原密码不能为空'), 'new_password' => array(null, 'string', '', '新密码不能为空'));
$data = Input::dataFilter($data, 'post');
if (md5($data['src_password']) != $_SESSION['userinfo']['password']) {
Error::halt(FAIL, '原密码不正确');
} else {
if ($data['src_password'] == $data['new_password']) {
Error::halt(FAIL, '新密码不能与原密码一致');
} else {
Sys::D('UcenterMember');
UcenterMemberModel::savePassword($_SESSION['userinfo']['id'], $data['new_password']);
Error::halt(SUCCESS, '操作成功');
}
}
}
示例13: getInheritRule
public static function getInheritRule($group_id)
{
$rule_arr = array('rules' => array(), 'g_rules' => array());
$group_info = array();
$tmpRule = array();
$group_info = self::getGroupInfo($group_id);
$oAuthGroup = Sys::D('AuthGroup');
do {
$tmpRule = $oAuthGroup::getRuleByGroupId($group_id);
$rule_arr['rules'][] = $tmpRule['rules'];
$rule_arr['g_rules'][] = $tmpRule['g_rules'];
$group_info = self::getGroupInfo($group_info['pid']);
} while ($group_info && ($group_id = $group_info['id'] && $group_info['pid'] != 0 && $group_info['inherit']));
//去除重复项
$rule_arr['rules'] = array_unique(explode(',', implode(',', $rule_arr['rules'])));
$rule_arr['g_rules'] = array_unique(explode(',', implode(',', $rule_arr['g_rules'])));
return $rule_arr;
}
示例14: saveGoodsInfo
private static function saveGoodsInfo(&$goodsData, $orderNum)
{
Sys::D('StoreGoods');
$data = array();
$totalPrice = 0;
$goodsTotalPrice = 0;
$goodsInfo = array();
foreach ($goodsData as $v) {
$goodsInfo = StoreGoodsModel::getOrderGoodsInfo($v[0]);
/*
* goods_id goods_img price discount_price count total_price name order_num
* */
$totalPrice = ($goodsInfo['discount_price'] > 0 ? $goodsInfo['discount_price'] : $goodsInfo['price']) * $v[1];
$goodsTotalPrice += $totalPrice;
$data[] = sprintf('(%s,\'%s\',%s,%s,%s,%s,\'%s\',\'%s\')', $v[0], $goodsInfo['url'], $goodsInfo['price'], $goodsInfo['discount_price'], $v[1], $totalPrice, $goodsInfo['name'], $orderNum);
}
Sys::D('OrderGoods');
OrderGoodsModel::save($data);
return $goodsTotalPrice;
}
示例15: index
static function index()
{
Sys::D('PathTrace');
echo PathTraceModel::getTraceByUrl('user', 'test');
}