Example #1
4
 function command_dd()
 {
     $args = func_get_args();
     $options = $this->get_options();
     $dd = kernel::single('dev_docbuilder_dd');
     if (empty($args)) {
         $dd->export();
     } else {
         foreach ($args as $app_id) {
             $dd->export_tables($app_id);
         }
     }
     if ($filename = $options['result-file']) {
         ob_start();
         $dd->output();
         $out = ob_get_contents();
         ob_end_clean();
         if (!is_dir(dirname($filename))) {
             throw new Exception('cannot find the ' . dirname($filename) . 'directory');
         } elseif (is_dir($filename)) {
             throw new Exception('the result-file path is a directory.');
         }
         file_put_contents($options['result-file'], $out);
         echo 'data dictionary doc export success.';
     } else {
         $dd->output();
     }
 }
Example #2
1
 function display($tmpl_file, $app_id = null)
 {
     array_unshift($this->_files, $tmpl_file);
     $this->_vars = $this->pagedata;
     if ($p = strpos($tmpl_file, ':')) {
         $object = kernel::service('tpl_source.' . substr($tmpl_file, 0, $p));
         if ($object) {
             $tmpl_file_path = substr($tmpl_file, $p + 1);
             $last_modified = $object->last_modified($tmpl_file_path);
         }
     } else {
         $tmpl_file = realpath(APP_DIR . '/' . ($app_id ? $app_id : $this->app->app_id) . '/view/' . $tmpl_file);
         $last_modified = filemtime($tmpl_file);
     }
     if (!$last_modified) {
         //无文件
     }
     $compile_id = $this->compile_id($tmpl_file);
     if ($object) {
         $compile_code = $this->_compiler()->compile($object->get_file_contents($tmpl_file_path));
     } else {
         $compile_code = $this->_compiler()->compile_file($tmpl_file);
     }
     eval('?>' . $compile_code);
     array_shift($this->_files);
 }
Example #3
0
 /**
  * 根据提交的图片全局配置大小,生成相应的缩略图
  * filesystem图片重新生成
  * @param null - 通过function_get_args方法来获取
  * @return null
  */
 public function command_do()
 {
     $options = $this->get_options();
     $imageSet = app::get('image')->getConf('image.set');
     if (isset($options['large'])) {
         $setting['l'] = $imageSet['L'];
     } elseif (isset($options['middle'])) {
         $setting['m'] = $imageSet['M'];
     } elseif (isset($options['small'])) {
         $setting['s'] = $imageSet['S'];
     } else {
         $setting = $imageSet;
     }
     $objLibImage = kernel::single('image_data_image');
     $pagesize = 50;
     $imgObj = kernel::single('image_clip');
     $imgMdl = app::get('image')->model('images');
     $filter['disabled'] = 0;
     $count = $imgMdl->count($filter);
     logger::info(sprintf('Total %d records', $count));
     for ($i = 0; $i < $count; $i += $pagesize) {
         $rows = $imgMdl->getList('ident', $filter, $i, $pagesize);
         foreach ($rows as $row) {
             $objLibImage->rebuild($row['ident'], $setting);
         }
         logger::info(sprintf('%d records Completed!', $i + count($rows)));
     }
 }
Example #4
0
 public function exec($params = null)
 {
     $params = array('time_start' => strtotime(date('Y-m-d 00:00:00', strtotime('-1 day'))), 'time_end' => strtotime(date('Y-m-d 23:59:59', strtotime('-1 day'))), 'time_insert' => strtotime(date('Y-m-d', strtotime('-1 day'))));
     if (kernel::single('sysstat_shop_taskdata')->exec($params)) {
         return true;
     }
 }
Example #5
0
 public function add()
 {
     $article_id = input::get('article_id');
     if ($article_id) {
         $articles = app::get('sysinfo')->model('article');
         $artnode = app::get('sysinfo')->model('article_nodes');
         $articleinfo = $articles->getRow('*', array('article_id' => $article_id));
         $pagedata['articleinfo'] = $articleinfo;
         $pagedata['artnode'] = $artnode->getRow('*', array('node_id' => $articleinfo['node_id']));
     }
     $nodeId = input::get('node_id');
     if (!empty($nodeId)) {
         $pagedata['article']['node_id'] = $nodeId;
     }
     $sysinfoLibNode = kernel::single('sysinfo_article_node');
     $nodeList = $sysinfoLibNode->getNodeList();
     foreach ($nodeList as $key => $value) {
         $selectmaps[$key]['node_id'] = $value['node_id'];
         $selectmaps[$key]['step'] = $value['node_depth'];
         $selectmaps[$key]['node_name'] = $value['node_name'];
     }
     $articlecatlist = app::get("sysinfo")->model("article_nodes")->getlist("*");
     $pagedata["articlecatlist"] = $articlecatlist;
     $pagedata['selectmaps'] = $selectmaps;
     $pagedata['platform_options'] = $this->platforms;
     return $this->page('sysinfo/admin/article/editor.html', $pagedata);
 }
Example #6
0
 function index($method = 'apply', $app_id = 'b2c', &$callback = '', $api_url = '')
 {
     $this->Certi = base_certificate::get('certificate_id');
     $this->Token = base_certificate::get('token');
     $this->Node_id = base_shopnode::node_id($app_id);
     $token = $this->Token;
     $sess_id = kernel::single('base_session')->sess_id();
     $apply['certi_id'] = $this->Certi;
     if ($this->Node_id) {
         $apply['node_idnode_id'] = $this->Node_id;
     }
     $apply['sess_id'] = $sess_id;
     $str = '';
     ksort($apply);
     foreach ($apply as $key => $value) {
         $str .= $value;
     }
     $apply['certi_ac'] = md5($str . $token);
     if ($method == 'apply') {
         if ($apply['node_idnode_id']) {
             $this->pagedata['_PAGE_CONTENT'] = '<iframe width="100%" height="100%" src="' . MATRIX_RELATION_URL . '?source=apply&certi_id=' . $apply['certi_id'] . '&node_id=' . $apply['node_idnode_id'] . '&sess_id=' . $apply['sess_id'] . '&certi_ac=' . $apply['certi_ac'] . '&callback=' . $callback . '&api_url=' . $api_url . '" ></iframe>';
         } else {
             $this->pagedata['_PAGE_CONTENT'] = '<iframe width="100%" height="100%" src="' . MATRIX_RELATION_URL . '?source=apply&certi_id=' . $apply['certi_id'] . '&sess_id=' . $apply['sess_id'] . '&certi_ac=' . $apply['certi_ac'] . '&callback=' . $callback . '&api_url=' . $api_url . '" ></iframe>';
         }
     } elseif ($method == 'accept') {
         if ($apply['node_idnode_id']) {
             $this->pagedata['_PAGE_CONTENT'] = '<iframe width="100%" height="100%" src="' . MATRIX_RELATION_URL . '?source=accept&certi_id=' . $apply['certi_id'] . '&node_id=' . $apply['node_idnode_id'] . '&sess_id=' . $apply['sess_id'] . '&certi_ac=' . $apply['certi_ac'] . '&callback=' . $callback . '" ></iframe>';
         } else {
             $this->pagedata['_PAGE_CONTENT'] = '<iframe width="100%" height="100%" src="' . MATRIX_RELATION_URL . '?source=accept&certi_id=' . $apply['certi_id'] . '&sess_id=' . $apply['sess_id'] . '&certi_ac=' . $apply['certi_ac'] . '&callback=' . $callback . '" ></iframe>';
         }
     } else {
         $this->pagedata['_PAGE_CONTENT'] = "";
     }
     $this->page();
 }
Example #7
0
 function __construct()
 {
     error_reporting(E_ALL ^ E_NOTICE);
     if (isset($_POST['dbname'], $_POST['dbuser'], $_POST['dbhost'], $_POST['data'])) {
         $this->install_mode = 'service';
         if (file_exists('../config/install.lock')) {
             $this->service_install_res('false', 'Access denied by install.lock');
         }
         $_POST['uname'] = $_POST['dbuser'];
         $_POST['pwd'] = $_POST['dbpass'];
         $_POST['prefix'] = $_POST['prefix'] ? $_POST['prefix'] : 'sdb_';
         $_POST['use_demo'] = $_POST['data'] == 'true' ? true : false;
         $_POST['stimezone'] = $_POST['stimezone'] ? $_POST['stimezone'] : 8;
         parent::kernel();
         $this->service_install_mode();
     }
     if (file_exists('../config/install.lock')) {
         $this->responseCode('403');
         echo 'Access denied by install.lock';
         exit;
     } else {
         parent::kernel();
         $this->checkPerm();
         $this->run();
     }
 }
Example #8
0
 public function getInfo($params)
 {
     $filter = array();
     $paymenList = array();
     $objPayment = kernel::single('ectools_data_payment');
     $row = $params['fields'];
     if ($params['payment_id']) {
         $filterBill['payment_id'] = $filter['payment_id'] = $params['payment_id'];
     }
     if ($params['tids']) {
         $filterBill['tid'] = explode(',', $params['tids']);
     }
     if ($params['status']) {
         $filter['status|in'] = explode(',', $params['status']);
     }
     if ($filter) {
         $objMdlPayment = app::get('ectools')->model('payments');
         $paymentBill = $objMdlPayment->getRow($row, $filter);
     }
     if ($filterBill) {
         $objMdlTradePaybill = app::get('ectools')->model('trade_paybill');
         $billList = $objMdlTradePaybill->getList('payment_id,tid,payment,status', $filterBill);
     }
     if ($paymentBill && $billList) {
         foreach ($billList as $val) {
             $paymentBill['trade'][$val['tid']] = $val;
         }
     }
     return $paymentBill;
 }
Example #9
0
 public function post_install()
 {
     kernel::log('Initial ectools');
     kernel::single('base_initial', 'ectools')->init();
     kernel::log('Initial Regions');
     kernel::single('ectools_regions_mainland')->install();
 }
Example #10
0
 private static function _get_obj($obj_name)
 {
     $_obj_name = self::$_widgets_conf[$obj_name];
     $object_class = self::$_prefix . $_obj_name;
     $object = kernel::single($object_class);
     return $object;
 }
Example #11
0
 /**
  * 获取单笔交易数据
  *
  * @param array $params 接口传入参数
  * @return array
  */
 public function getData($params, $oauth)
 {
     if (isset($oauth['shop_id'])) {
         $filter['shop_id'] = $oauth['shop_id'];
     } else {
         if ($params['oauth']['account_id'] && $params['oauth']['auth_type'] == "member") {
             $filter['user_id'] = $params['oauth']['account_id'];
         } elseif ($params['oauth']['account_id'] && $params['oauth']['auth_type'] == "shop") {
             $sellerId = $params['oauth']['account_id'];
             $filter['shop_id'] = app::get('systrade')->rpcCall('shop.get.loginId', array('seller_id' => $this->sellerId), 'seller');
         }
     }
     if ($params['oid']) {
         $params['oid'] = explode(',', $params['oid']);
     }
     $tradeInfo = kernel::single('systrade_getTradeData')->getTradeInfo($params['fields'], $params['tid'], $params['oid'], $filter);
     if ($tradeInfo['dlytmpl_id']) {
         $dlytmpl = app::get('systrade')->rpcCall('logistics.dlytmpl.get', ['template_id' => $tradeInfo['dlytmpl_id'], 'fields' => 'corp_id,name']);
         $corptmpl = app::get('systrade')->rpcCall('logistics.dlycorp.get', ['corp_id' => $dlytmpl['corp_id'], 'fields' => 'corp_code,corp_name']);
         $tradeInfo['dlytmpl_name'] = $dlytmpl['name'];
         $tradeInfo['corptmpl_name'] = $corptmpl['corp_name'];
         $tradeInfo['corptmpl_code'] = $corptmpl['corp_code'];
     }
     //这里判断货到付款
     //现在判断货到付款在订单里没有字段标示,所以采用两个字段相结合,就是支付为线下支付且订单状态是待支付的时候,就判断为货到付款
     if ($tradeInfo['pay_type'] == "offline" && $tradeInfo['type'] == "WAIT_SELLER_SEND_GOODS") {
         $tradeInfo['is_cod'] = "true";
     } else {
         $tradeInfo['is_cod'] = "false";
     }
     $tradeInfo = $this->__paramsToString($tradeInfo);
     return $tradeInfo;
 }
Example #12
0
 public function callback(&$recv)
 {
     $objMath = kernel::single('ectools_math');
     $money = $objMath->number_multiple(array($recv['orderAmount'], 0.01));
     $merid = $this->getConf('mer_id', substr(__CLASS__, 0, strrpos(__CLASS__, '_')));
     $mer_key = $this->getConf('mer_key', substr(__CLASS__, 0, strrpos(__CLASS__, '_')));
     $sign = $recv['signature'];
     $sign_method = $recv['signMethod'];
     $arrs = array("version" => $recv['version'], "charset" => $recv['charset'], "transType" => $recv['transType'], "respCode" => $recv['respCode'], "respMsg" => $recv['respMsg'], "merAbbr" => $recv['merAbbr'], "merId" => $recv['merId'], "orderNumber" => $recv['orderNumber'], "traceNumber" => $recv['traceNumber'], "traceTime" => $recv['traceTime'], "qid" => $recv['qid'], "orderAmount" => $recv['orderAmount'], "orderCurrency" => $recv['orderCurrency'], "respTime" => $recv['respTime'], "settleCurrency" => $recv['settleCurrency'], "settleDate" => $recv['settleDate'], "settleAmount" => $recv['settleAmount'], "exchangeDate" => $recv['exchangeDate'], "exchangeRate" => $recv['exchangeRate'], "cupReserved" => $recv['cupReserved']);
     $chkvalue = $this->sign($arrs, $sign_method, $mer_key);
     $ret['payment_id'] = $arrs['orderNumber'];
     $ret['account'] = $arrs['merId'];
     $ret['bank'] = app::get('ectools')->_('银联');
     $ret['pay_account'] = app::get('ectools')->_('付款帐号');
     $ret['currency'] = 'CNY';
     $ret['money'] = $money;
     $ret['paycost'] = '0.000';
     $ret['cur_money'] = $money;
     $ret['tradeno'] = $recv['traceNumber'];
     // $ret['t_payed'] = strtotime($recv['settleDate']) ? strtotime($recv['settleDate']) : time();
     $ret['t_payed'] = time();
     $ret['pay_app_id'] = 'unionpay';
     $ret['pay_type'] = 'online';
     $ret['memo'] = 'unionpay';
     if ($sign == $chkvalue && $recv['respCode'] == 00) {
         $ret['status'] = 'succ';
     } else {
         $ret['status'] = 'failed';
     }
     return $ret;
 }
Example #13
0
 public function validate($cart_objects, &$condition)
 {
     $all = $condition['aggregator'] === 'all';
     $true = (bool) $condition['value'];
     if (!isset($condition['conditions'])) {
         return true;
     }
     if (!is_array($condition['conditions'])) {
         return false;
     }
     foreach ($condition['conditions'] as $_cond) {
         if (!is_object($this->{$_cond}['type'])) {
             $this->{$_cond}['type'] = kernel::single($_cond['type']);
         }
         $oCond = $this->{$_cond}['type'];
         $validated = $oCond->validate($cart_objects, $_cond);
         // return boolean
         if ($all && $validated !== $true) {
             // 所有不符合 如果有一个满足返回false
             return false;
         } elseif (!$all && $validated === $true) {
             // 任意一条符合 则返回true
             return true;
         }
     }
     return $all ? true : false;
 }
Example #14
0
 public function updateStatus($params)
 {
     $itemId = $params['item_id'];
     $status = $params['approve_status'];
     $result = kernel::single('sysitem_data_item')->setSaleStatus(intval($itemId), $status);
     return $result;
 }
Example #15
0
 function save()
 {
     $this->begin();
     $objMemLv = $this->app->model('member_lv');
     if ($objMemLv->validate($_POST, $msg)) {
         if ($_POST['member_lv_id']) {
             $olddata = app::get('b2c')->model('member_lv')->dump($_POST['member_lv_id']);
         }
         #↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑记录管理员操作日志@lujy↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑
         if ($objMemLv->save($_POST)) {
             #↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓记录管理员操作日志@lujy↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
             if ($obj_operatorlogs = kernel::service('operatorlog.members')) {
                 if (method_exists($obj_operatorlogs, 'member_lv_log')) {
                     $newdata = app::get('b2c')->model('member_lv')->dump($_POST['member_lv_id']);
                     $obj_operatorlogs->member_lv_log($newdata, $olddata);
                 }
             }
             #↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑记录管理员操作日志@lujy↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑
             $this->end(true, app::get('b2c')->_('保存成功'));
         } else {
             $this->end(false, app::get('b2c')->_('保存失败'));
         }
     } else {
         $this->end(false, $msg);
     }
 }
Example #16
0
 function detail_basic($id)
 {
     $arr = $this->app->model('sales_rule_goods')->dump($id);
     $render = $this->app->render();
     //会员等级
     if ($arr['member_lv_ids']) {
         $member_lv_id = explode(',', $arr['member_lv_ids']);
         $member = $this->app->model('member_lv')->getList('*', array('member_lv_id' => $member_lv_id));
         if (count($member_lv_id) > count($member)) {
             $member[] = array('name' => '非会员');
         }
         $render->pagedata['member'] = $member;
     }
     //过滤条件
     if ($arr['conditions']) {
         if ($arr['c_template']) {
             $render->pagedata['conditions'] = kernel::single($arr['c_template'])->tpl_name;
         }
     }
     //优惠方案
     if ($arr['action_solution']) {
         if ($arr['s_template']) {
             $render->pagedata['action_solution'] = kernel::single($arr['s_template'])->name;
         }
     }
     $render->pagedata['rules'] = $arr;
     return $render->fetch('admin/sales/finder/goods.html');
 }
Example #17
0
 public function getCouponCode($coupon_id, $user_id)
 {
     $objMdlUserCoupon = app::get('sysuser')->model('user_coupon');
     $couponNum = $objMdlUserCoupon->count(array('coupon_id' => $coupon_id, 'user_id' => $user_id));
     $oldQuantity = $couponNum ? $couponNum : 0;
     $userInfo = kernel::single('sysuser_passport')->memInfo($user_id);
     $apiData = array('gen_quantity' => 1, 'old_quantity' => $oldQuantity, 'coupon_id' => $coupon_id, 'grade_id' => $userInfo['grade_id']);
     $db = app::get('sysuser')->database();
     $transaction_status = $db->beginTransaction();
     try {
         if ($couponInfo = app::get('sysuser')->rpcCall('promotion.coupon.gencode', $apiData)) {
             $userCoupon['coupon_id'] = $coupon_id;
             $userCoupon['coupon_code'] = $couponInfo['coupon_code'];
             $userCoupon['user_id'] = $user_id;
             $userCoupon['obtain_desc'] = '免费领取';
             $userCoupon['shop_id'] = $couponInfo['shop_id'];
             $userCoupon['obtain_time'] = time();
             $userCoupon['used_platform'] = $couponInfo['used_platform'];
             if (!app::get('sysuser')->model('user_coupon')->save($userCoupon)) {
                 throw new \LogicException('优惠券保存失败');
             }
             $db->commit($transaction_status);
             return $couponInfo;
         } else {
             throw new \LogicException('生成优惠券号码失败');
         }
     } catch (Exception $e) {
         $db->rollback();
         throw $e;
     }
     return true;
 }
Example #18
0
 public function login($userData, $vcode = false, &$msg)
 {
     $userData = utils::_filter_input($userData);
     //过滤xss攻击
     if ($vcode && !$this->vcode_verify($vcode)) {
         $msg = app::get('pam')->_('验证码错误');
         return false;
     }
     //如果指定了登录类型,则不再进行获取(邮箱登录,手机号登录,用户名登录)
     if (!$userData['login_type']) {
         $userPassport = kernel::single('b2c_user_passport');
         $userData['login_type'] = $userPassport->get_login_account_type($userData['login_account']);
     }
     $filter = array('login_type' => $userData['login_type'], 'login_account' => $userData['login_account']);
     $account = app::get('pam')->model('members')->getList('member_id,password_account,login_password,createtime', $filter);
     if (!$account) {
         $msg = app::get('pam')->_('用户名或密码错误');
         return false;
     }
     $login_password = pam_encrypt::get_encrypted_password($userData['login_password'], 'member', array('createtime' => $account[0]['createtime'], 'login_name' => $account[0]['password_account']));
     if ($account[0]['login_password'] != $login_password) {
         $msg = app::get('pam')->_('用户名或密码错误');
         return false;
     }
     return $account[0]['member_id'];
 }
Example #19
0
 /**
  * 构造方法
  * @param null
  * @return boolean
  */
 public function __construct($app)
 {
     parent::__construct($app);
     //$this->callback_url = $this->app->base_url(true)."/apps/".basename(dirname(__FILE__))."/".basename(__FILE__);
     $this->notify_url = kernel::openapi_url('openapi.ectools_payment/parse/' . $this->app->app_id . '/ectools_payment_plugin_alipay_server', 'callback');
     if (preg_match("/^(http):\\/\\/?([^\\/]+)/i", $this->notify_url, $matches)) {
         $this->notify_url = str_replace('http://', '', $this->notify_url);
         $this->notify_url = preg_replace("|/+|", "/", $this->notify_url);
         $this->notify_url = "http://" . $this->notify_url;
     } else {
         $this->notify_url = str_replace('https://', '', $this->notify_url);
         $this->notify_url = preg_replace("|/+|", "/", $this->notify_url);
         $this->notify_url = "https://" . $this->notify_url;
     }
     $this->callback_url = kernel::openapi_url('openapi.ectools_payment/parse/' . $this->app->app_id . '/ectools_payment_plugin_alipay', 'callback');
     if (preg_match("/^(http):\\/\\/?([^\\/]+)/i", $this->callback_url, $matches)) {
         $this->callback_url = str_replace('http://', '', $this->callback_url);
         $this->callback_url = preg_replace("|/+|", "/", $this->callback_url);
         $this->callback_url = "http://" . $this->callback_url;
     } else {
         $this->callback_url = str_replace('https://', '', $this->callback_url);
         $this->callback_url = preg_replace("|/+|", "/", $this->callback_url);
         $this->callback_url = "https://" . $this->callback_url;
     }
     //$this->submit_url = 'https://www.alipay.com/cooperate/gateway.do?_input_charset=utf-8';
     //ajx  按照相应要求请求接口网关改为一下地址
     $this->submit_url = 'https://mapi.alipay.com/gateway.do?_input_charset=utf-8';
     $this->submit_method = 'POST';
     $this->submit_charset = 'utf-8';
 }
/**
 * ShopEx licence
 *
 * @copyright  Copyright (c) 2005-2010 ShopEx Technologies Inc. (http://www.shopex.cn)
 * @license  http://ecos.shopex.cn/ ShopEx License
 */

function theme_widget_main_slide(&$setting,&$render){
    $setting['allimg']="";
    $setting['allurl']="";
    if($system->theme){
        $theme_dir = kernel::get_themes_host_url().'/'.$smarty->theme;
    }else{
        $theme_dir = kernel::get_themes_host_url().'/'.app::get('site')->getConf('current_theme');
    }
    if(!$setting['pic']){
        foreach($setting['img'] as $value){
            $setting['allimg'].=$rvalue."|";
            $setting['allurl'].=urlencode($value["url"])."|";
        }
    }else{
        foreach($setting['pic'] as $key=>$value){
            if($value['link']){
                if($value["url"]){
                    $value["linktarget"]=$value["url"];
                }
                $setting['allimg'].=$rvalue."|";
                $setting['allurl'].=urlencode($value["linktarget"])."|";
                $setting['pic'][$key]['link'] = str_replace('%THEME%',$theme_dir,$value['link']);
            }
        }
    }
    return $setting;
}
Example #21
0
 /**
  * 导出需要的数据
  * @access public
  * @param array &$data
  * @param array $filter
  * @param int $offset
  * @return bool
  * @version 1 Jul 15, 2011
  */
 public function fgetlist_csv(&$data, $filter, $offset)
 {
     //CSV标题
     $title = array('开户人姓名', '开户银行', '账户类型', '开户支行', '开户账号', '用户名', '发放状态', '佣金总额');
     $data['title'] = '"' . implode('","', $title) . '"';
     //联盟商银行账户模型
     $mdlUpa = kernel::single('cps_mdl_userpayaccount');
     //联盟商模型
     $mdlUser = kernel::single('cps_mdl_users');
     //用户类型
     $userTypes = $mdlUser->getUserTypes();
     //发放状态
     $umpState = $this->getStates();
     $limit = 100;
     if (!($umps = $this->getList('u_id, u_name, state, money_sum', $filter, $offset * $limit, $limit))) {
         return false;
     }
     $cnt = array();
     //根据u_id获取用户信息
     foreach ($umps as $ump) {
         $upa = $mdlUpa->dump($ump['u_id'], 'acc_person, acc_bank, acc_bname, account');
         $user = $mdlUser->dump($ump['u_id'], 'u_type');
         $cnt[] = '"' . $upa['acc_person'] . '","' . $upa['acc_bank'] . '","' . $userTypes[$user['u_type']] . '","' . $upa['acc_bname'] . '","' . $upa['account'] . '","' . $ump['u_name'] . '","' . $umpState[$ump['state']] . '","' . $ump['money_sum'] . '"';
     }
     $data['contents'] = $cnt;
     return true;
 }
Example #22
0
 public function command_sync_user()
 {
     //kernel::console_output = false;
     $http = kernel::single('base_httpclient');
     $response = $http->get(app::get('suitclient')->getConf('syncuser'));
     if ($response) {
         $server_users = json_decode($response);
         $model = app::get('pam')->model('account');
         $result = $model->getList('login_name', array('account_type' => 'shopadmin'));
         $client_user = array();
         foreach ($result as $value) {
             $client_user[] = $value['login_name'];
         }
         $model2 = app::get('desktop')->model('users');
         foreach ($server_users as $server_user) {
             if (!in_array($server_user, $client_user)) {
                 $user = array('name' => $server_user, 'status' => 1, 'super' => 0, 'disabled' => false, 'pam_account' => array('login_name' => $server_user, 'login_password' => md5(time() . rand()), 'account_type' => 'shopadmin'), 'roles' => array(array('role_id' => 1)));
                 $model2->save($user);
             }
         }
         kernel::log('同步成功');
         kernel::log('ok.');
         //不加 "ok."则会弹提示信息并不能自动关闭@lujy
     } else {
         kernel::log('同步失败或套件里没有用户');
         kernel::log('ok.');
     }
     exit;
 }
Example #23
0
 /**
  * 获取所有开启(激活)的支付方式
  * @param mixed 过滤条件
  * @return array 支付方式数组
  */
 public function get_all($sdf)
 {
     $arr_payments = array();
     $obj_payments_service_all = kernel::servicelist('ectools_payment.ectools_mdl_payment_cfgs');
     foreach ($obj_payments_service_all as $obj) {
         switch ($obj->app_key) {
             case 'offline':
                 $payout_type = 'offline';
                 break;
             case 'offlinemeitong':
                 $payout_type = 'offline';
                 break;
             case 'offlinecard':
                 $payout_type = 'offline';
                 break;
             case 'deposit':
                 $payout_type = 'deposit';
                 break;
             default:
                 $payout_type = 'online';
                 break;
         }
         $strPayment = $this->app->getConf(get_class($obj));
         $arrPaymnet = unserialize($strPayment);
         if (isset($arrPaymnet['status']) && $arrPaymnet['status'] == 'true') {
             $arr_payments[$obj->app_key] = array('payout_type' => $payout_type, 'payment_name' => isset($arrPaymnet['setting']['pay_name']) && $arrPaymnet['setting']['pay_name'] ? $arrPaymnet['setting']['pay_name'] : $obj->display_name, 'payment_id' => isset($obj->app_rpc_key) && $obj->app_rpc_key ? $obj->app_rpc_key : $obj->app_key);
         }
     }
     return $arr_payments;
 }
Example #24
0
 function __construct()
 {
     if (!setlocale(LC_ALL, 'zh_CN.gbk')) {
         setlocale(LC_ALL, "chs");
     }
     $this->charset = kernel::single('base_charset');
 }
Example #25
0
 private function __replaceImage($desc)
 {
     $desc = stripslashes($desc);
     preg_match_all("/src=[\\'|\"](.+?)[\\'|\"]/", $desc, $match);
     foreach ($match[1] as $imageUrl) {
         if (strpos($imageUrl, 'images.bbc.shopex123.com')) {
             continue;
         }
         if (strpos($imageUrl, 'localhost')) {
             continue;
         }
         ini_set("memory_limit", "120M");
         try {
             $localImageUrl = kernel::single('image_data_image')->storeNetworkImage($imageUrl, 'shop', 'item');
             if ($localImageUrl) {
                 $url = $localImageUrl['url'];
                 kernel::single('image_data_image')->rebuild($localImageUrl['ident']);
                 $desc = str_replace($imageUrl, $url, $desc);
             } else {
                 $desc = str_replace($imageUrl, '#', $desc);
             }
         } catch (\Exception $e) {
             $desc = str_replace($imageUrl, '#', $desc);
         }
     }
     return $desc;
 }
Example #26
0
 public function get_params($sdf)
 {
     $order_id = $sdf['order_id'];
     $order_detail = kernel::single('b2c_order_full')->get($order_id);
     $order_detail['real_time'] = 'true';
     return $order_detail;
 }
Example #27
0
 /**
  * 需要同步的数据
  */
 public function sync($request, $rpcService)
 {
     // $cnt    = kernel::single('b2c_shop')->getShopBindStatus();
     // if ( $cnt > 0 ) {
     if ($request['region_id']) {
         $obj_regions_op = kernel::service('ectools_regions_apps', array('content_path' => 'ectools_regions_operation'));
         if ($request['sync_type'] == 'del') {
             if ($request['region_id']) {
                 $obj_regions_op->toRemoveArea($request['region_id']);
             }
         } else {
             $ordernum = isset($request['ordernum']) ? $request['ordernum'] : 50;
             $package = $request['package'] ? $request['package'] : 'mainland';
             $data = array('region_id' => $request['region_id'], 'local_name' => $request['local_name'], 'ordernum' => $ordernum, 'package' => $package);
             if ($request['p_region_id']) {
                 $data['p_region_id'] = $request['p_region_id'];
             }
             $obj_regions_op->replaceDlArea($data, $msg);
         }
         $ret = array('code' => 1, 'msg' => app::get('ectools')->_('同步成功'));
     } else {
         $ret = array('code' => -1, 'msg' => app::get('ectools')->_('请确保地区ID'));
     }
     // } else {
     //     $ret    = array (
     //             'code'  => -2,
     //             'msg'   => app::get('ectools')->_('店铺未绑定无需同步'),
     //             );
     // }
     if ($ret['code'] < 0) {
         $rpcService->send_user_error($ret['code'], $ret['msg']);
     }
     return $ret;
 }
Example #28
0
 function show($gid, $item = 'ask', $limit)
 {
     $objComment = kernel::single('b2c_message_disask');
     $aComment = $objComment->good_all_disask($gid, $item, 1, null, $limit);
     $memberInfo = kernel::single('b2c_frontpage')->get_current_member();
     $params['member_id'] = $memberInfo['member_id'];
     if (!$params['member_id']) {
         $aComment['setting']['login'] = '******';
     }
     $validate_type = $item == 'discuss' ? 'discussReply' : $item;
     // 评论回复/咨询/咨询回复的权限
     $aComment['setting']['power_status'] = kernel::single('b2c_message_disask')->toValidate($validate_type, $params, $message);
     $aComment['setting']['power_message'] = $message;
     if ($item == 'ask') {
         $aComment['gask_type'] = $objComment->gask_type($gid);
     } else {
         $point_status = app::get('b2c')->getConf('goods.point.status') ? app::get('b2c')->getConf('goods.point.status') : 'on';
         if ($point_status == 'on') {
             $objPoint = $this->app->model('comment_goods_point');
             $aComment['goods_point'] = $objPoint->get_single_point($gid);
             $aComment['total_point_nums'] = $objPoint->get_point_nums($gid);
             $aComment['_all_point'] = $objPoint->get_goods_point($gid);
         }
         $aComment['point_status'] = $point_status;
     }
     return $aComment;
 }
Example #29
0
 public function layout()
 {
     $article_id = $this->_request->get_get('article_id');
     $this->pagedata['layouts'] = kernel::single('content_article_single')->get_layout_list();
     $this->pagedata['article_id'] = $article_id;
     $this->display('admin/article/single/layout.html');
 }
Example #30
-1
 /**
  * send 
  * 必有方法,发送时调用
  *
  * config参数为getOptions取得的所有项的配置结果
  * 
  * @param mixed $to 
  * @param mixed $message 
  * @param mixed $config 
  * @access public
  * @return void
  */
 function send($to, $subject, $body, $config)
 {
     if ($config['sendway'] == "mail") {
         $this->email = kernel::single('desktop_email_email');
     }
     $this->Sender = $config['usermail'];
     $this->Subject = $this->email->inlineCode($subject);
     $this->email->Sender = $this->Sender;
     $this->email->Subject = $this->Subject;
     $header = array('Return-path' => '<' . $config['usermail'] . '>', 'Date' => date('r'), 'From' => $this->email->inlineCode(app::get('site')->getConf('site.name')) . '<' . $config['usermail'] . '>', 'MIME-Version' => '1.0', 'Subject' => $this->Subject, 'To' => $to, 'Content-Type' => 'text/html; charset=UTF-8; format=flowed', 'Content-Transfer-Encoding' => 'base64');
     $body = chunk_split(base64_encode($body));
     $header = $this->email->buildHeader($header);
     $config['sendway'] = $config['sendway'] ? $config['sendway'] : 'smtp';
     switch ($config['sendway']) {
         case "sendmail":
             $result = $this->email->SendmailSend($to, $header, $body);
             break;
         case "mail":
             $result = $this->email->MailSend($to, $header, $body);
             break;
         case "smtp":
             $result = $this->email->SmtpSend($to, $header, $body, $config);
             break;
         default:
             # trigger_error('mailer_not_supported',E_ERROR);
             $result = false;
             break;
     }
     return $result;
 }