当前位置: 首页>>代码示例>>PHP>>正文


PHP kernel::serviceList方法代码示例

本文整理汇总了PHP中kernel::serviceList方法的典型用法代码示例。如果您正苦于以下问题:PHP kernel::serviceList方法的具体用法?PHP kernel::serviceList怎么用?PHP kernel::serviceList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在kernel的用法示例。


在下文中一共展示了kernel::serviceList方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: function_header

 /**
  * 头部
  */
 function function_header()
 {
     $ret = '<base href="' . kernel::base_url(1) . '"/>';
     $path = app::get('site')->res_url;
     $debug_css = defined('DEBUG_CSS') && constant('DEBUG_CSS');
     $debug_js = defined('DEBUG_JS') && constant('DEBUG_JS');
     $css_mini = $debug_css ? '' : '_mini';
     $cssver = kernel::single('base_component_ui')->getVer($debug_css);
     $jsver = kernel::single('base_component_ui')->getVer($debug_js);
     if (!defined("DONOTUSE_CSSFRAMEWORK") || !constant('DONOTUSE_CSSFRAMEWORK')) {
         $ret .= '<link rel="stylesheet" href="' . $path . '/css' . $css_mini . '/typical.css' . $cssver . '" />';
     }
     $ret .= '<link rel="stylesheet" href="' . $path . '/css' . $css_mini . '/widgets_edit.css' . $cssver . '" />';
     $ret .= kernel::single('base_component_ui')->lang_script(array('src' => 'lang.js', 'app' => 'site', 'pdir' => 'js_mini'));
     $ret .= kernel::single('base_component_ui')->lang_script(array('src' => 'lang.js', 'app' => 'b2c', 'pdir' => 'js_mini'));
     if ($debug_js) {
         $ret .= '<script src="' . $path . '/js/mootools.js?' . $jsver . '"></script>
         <script src="' . $path . '/js/moomore.js' . $jsver . '"></script>
         <script src="' . $path . '/js/jstools.js' . $jsver . '"></script>
         <script src="' . $path . '/js/switchable.js' . $jsver . '"></script>
         <script src="' . $path . '/js/dragdropplus.js' . $jsver . '"></script>
         <script src="' . $path . '/js/shopwidgets.js' . $jsver . '"></script>';
     } else {
         $ret .= '<script src="' . $path . '/js_mini/moo.min.js' . $jsver . '"></script>
         <script src="' . $path . '/js_mini/ui.min.js' . $jsver . '"></script>
         <script src="' . $path . '/js_mini/shopwidgets.min.js' . $jsver . '"></script>';
     }
     foreach (kernel::serviceList('site_theme_view_helper') as $service) {
         if (method_exists($service, 'function_header')) {
             $ret .= $service->function_header();
         }
     }
     return $ret;
 }
开发者ID:sss201413,项目名称:ecstore,代码行数:37,代码来源:helper.php

示例2: function_header

 /**
  * 头部
  */
 function function_header()
 {
     $ret = '<base href="' . kernel::base_url(1) . '"/>';
     $path = app::get('site')->res_url;
     $css_min = defined('DEBUG_CSS') && constant('DEBUG_CSS') ? '' : '_min';
     $css_mini = $css_min ? '_mini' : '';
     $ret .= '<link rel="stylesheet" href="' . $path . '/css' . $css_min . '/framework.css" type="text/css" />';
     $ret .= '<link rel="stylesheet" href="' . $path . '/css' . $css_mini . '/widgets_edit.css" type="text/css" />';
     $ret .= kernel::single('base_component_ui')->lang_script(array('src' => 'lang.js', 'app' => 'site'));
     if (defined('DEBUG_JS') && constant('DEBUG_JS')) {
         $ret .= '<script src="' . $path . '/js/mootools.js?' . time() . '"></script>
         <script src="' . $path . '/js/moomore.js?' . time() . '"></script>
         <script src="' . $path . '/js/jstools.js?' . time() . '"></script>
         <script src="' . $path . '/js/coms/switchable.js?' . time() . '"></script>
         <script src="' . $path . '/js/dragdropplus.js?' . time() . '"></script>
         <script src="' . $path . '/js/shopwidgets.js?' . time() . '"></script>';
     } else {
         $ret .= '<script src="' . $path . '/js_mini/moo_min.js"></script>
         <script src="' . $path . '/js_mini/switchable_min.js"></script>
         <script src="' . $path . '/js_mini/shopwidgets_min.js"></script>';
     }
     foreach (kernel::serviceList('site_theme_view_helper') as $service) {
         if (method_exists($service, 'function_header')) {
             $ret .= $service->function_header();
         }
     }
     return $ret;
 }
开发者ID:syjzwjj,项目名称:quyeba,代码行数:31,代码来源:helper.php

示例3: dorecycle

 function dorecycle($mdl_name, $filter = null)
 {
     $oRecycle = app::get('desktop')->model('recycle');
     list($app_id, $table) = explode('_mdl_', $mdl_name);
     $o = app::get($app_id)->model($table);
     $recycle_item = array();
     $recycle_item['drop_time'] = time();
     $recycle_item['item_type'] = $o->table_name();
     $dbschema = $o->get_schema();
     $textColumn = $dbschema['textColumn'];
     $pkey = $dbschema['idColumn'];
     foreach ($dbschema['columns'] as $k => $col) {
         if ($col['is_title'] && $col['sdfpath']) {
             $textColumn = $col['sdfpath'];
             break;
         }
     }
     $rows = $o->getList('*', $filter, 0, -1);
     if (method_exists($o, 'pre_recycle')) {
         if (!$o->pre_recycle($rows)) {
             return false;
         }
     }
     $menus = app::get('desktop')->model('menus');
     $permission_id = $menus->permissionId($_GET);
     foreach ($rows as $k => $v) {
         $pkey_value = $v[$pkey];
         $v = $o->dump($v[$pkey], '*', 'delete');
         $recycle_item['item_sdf'] = $v;
         $recycle_item['app_key'] = $app_id;
         $recycle_item['item_title'] = $v[$textColumn];
         if (method_exists($o, 'title_recycle')) {
             $recycle_item['item_title'] = $o->title_recycle($v);
         }
         $tmp = $recycle_item;
         $tmp['permission'] = $permission_id;
         $return = $oRecycle->save($tmp);
         unset($tmp[$pkey]);
         $o->delete(array($pkey => $pkey_value));
         #↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓记录管理员操作日志@lujy↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
         if ($obj_operatorlogs = kernel::service('operatorlog.system')) {
             if (method_exists($obj_operatorlogs, 'dorecycle')) {
                 $obj_operatorlogs->dorecycle($v);
             }
         }
         #↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑记录管理员操作日志@lujy↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑
     }
     if (method_exists($o, 'suf_recycle')) {
         if (!$o->suf_recycle($_POST)) {
             return false;
         }
     }
     $services = kernel::serviceList('desktop_finder_callback.' . get_class($o));
     foreach ($services as $service) {
         if (method_exists($service, 'recycle')) {
             $service->recycle($_POST);
         }
     }
     return true;
 }
开发者ID:sss201413,项目名称:ecstore,代码行数:60,代码来源:recycle.php

示例4: pre_display

 public function pre_display(&$content)
 {
     foreach (kernel::serviceList('base_render_pre_display') as $service) {
         if (method_exists($service, 'pre_display')) {
             $service->pre_display($content);
         }
     }
 }
开发者ID:dalinhuang,项目名称:shopexts,代码行数:8,代码来源:render.php

示例5: exception_handler

    public static function exception_handler($exception)
    {
        foreach (kernel::serviceList('base_exception_handler') as $service) {
            if (method_exists($service, 'pre_display')) {
                $service->pre_display($content);
            }
        }
        $message = $exception->getMessage();
        $code = $exception->getCode();
        $file = $exception->getFile();
        $line = $exception->getLine();
        $trace = $exception->getTrace();
        $trace_message = $exception->getTraceAsString();
        $trace_message = null;
        $root_path = realpath(ROOT_DIR);
        $output = ob_end_clean();
        $position = str_replace($root_path, '&gt; &nbsp;', $file) . ':' . $line;
        $i = 0;
        foreach ($trace as $t) {
            if (!($t['class'] == 'kernel' && $t['function'] == 'exception_error_handler')) {
                $t['file'] = str_replace($root_path, 'ROOT:', $t['file']);
                $basename = basename($t['file']);
                if ($i == 0) {
                    $trace_message .= '<tr class="code" style="color:#000"><td><b>&gt;&nbsp;</b></td>';
                } else {
                    $trace_message .= '<tr class="code" style="color:#999"><td></td>';
                }
                if ($t['args']) {
                    $args_info = htmlspecialchars(implode(',', $t['args']));
                    if (trim($args_info)) {
                        $args = "<span class=\"lnk\" onclick=\"alert(this.nextSibling.innerHTML)\">...</span><span style='display:none'>{$args_info}</span>";
                    } else {
                        $args = "\"{$args_inf}\"";
                    }
                } else {
                    $args = '';
                }
                if ($t['line']) {
                    $trace_message .= "<td>#{$i}</td><td>{$t['class']}{$t['type']}{$t['function']}({$args})</td><td>{$basename}:{$t['line']}</td></tr>";
                } else {
                    $trace_message .= "<td>#{$i}</td><td>{$t['class']}{$t['type']}{$t['function']}({$args})</td><td>{$basename}</td></tr>";
                }
                $i++;
            }
        }
        $output = <<<EOF
        <p style="background:#eee;border:1px solid #ccc;padding:10px;margin:10px 0">{$message}</p>
        <div style="padding:10px 0;font-weight:bold;color:#000">{$position}</div>
        <table cellspacing="0" cellpadding='0' style="width:100%;">
        {$trace_message}
        </table>
EOF;
        self::output($output, 'Track');
    }
开发者ID:syjzwjj,项目名称:quyeba,代码行数:54,代码来源:errorpage.php

示例6: getList

 /** 
  * 重写getList方法
  */
 public function getList($cols = '*', $filter = array(), $offset = 0, $limit = -1, $orderType = null)
 {
     $arr_list = parent::getList($cols, $filter, $offset, $limit, $orderType);
     $obj_extends_order_service = kernel::serviceList('b2c.api_reship_extends_actions');
     if ($obj_extends_order_service) {
         foreach ($obj_extends_order_service as $obj) {
             $obj->extend_item_list($arr_list);
         }
     }
     return $arr_list;
 }
开发者ID:syjzwjj,项目名称:quyeba,代码行数:14,代码来源:items.php

示例7: main

 function main()
 {
     $this->controller->begin();
     $oRecycle = app::get('desktop')->model('recycle');
     $recycle_item = array();
     $recycle_item['drop_time'] = time();
     $recycle_item['item_type'] = $this->object->table_name();
     $o = $this->app->model($this->object->table_name());
     $this->dbschema = $this->object->get_schema();
     $textColumn = $this->dbschema['textColumn'];
     foreach ($this->dbschema['columns'] as $k => $col) {
         if ($col['is_title'] && $col['sdfpath']) {
             $textColumn = $col['sdfpath'];
             break;
         }
     }
     $pkey = $this->dbschema['idColumn'];
     $pkey_value = $_POST[$pkey];
     //explode('|',$_POST['_PKEY_']);
     $rows = $o->getList('*', array($pkey => $pkey_value), 0, -1);
     if (method_exists($o, 'pre_recycle')) {
         if (!$o->pre_recycle($rows)) {
             $this->controller->end(false, $o->recycle_msg ? $o->recycle_msg : '删除失败');
             return false;
         }
     }
     foreach ($rows as $k => $v) {
         $pkey_value = $v[$pkey];
         $v = $o->dump($v[$pkey], '*', 'delete');
         $recycle_item['item_sdf'] = $v;
         $recycle_item['app_key'] = $this->app->app_id;
         $recycle_item['item_title'] = $v[$textColumn];
         $tmp = $recycle_item;
         $return = $oRecycle->save($tmp);
         unset($tmp[$pkey]);
         $o->delete(array($pkey => $pkey_value));
     }
     if (method_exists($o, 'suf_recycle')) {
         if (!$o->suf_recycle($_POST)) {
             $this->controller->end(false, $o->recycle_msg ? $o->recycle_msg : '删除失败');
             return false;
         }
     }
     $services = kernel::serviceList('desktop_finder_callback.' . get_class($o));
     foreach ($services as $service) {
         if (method_exists($service, 'recycle')) {
             $service->recycle($_POST);
         }
     }
     $this->controller->end(true, '删除成功', 'javascript:finderGroup["' . $_GET['finder_id'] . '"].unselectAll();finderGroup["' . $_GET['finder_id'] . '"].refresh();');
 }
开发者ID:dalinhuang,项目名称:shopexts,代码行数:51,代码来源:dorecycle.php

示例8: getList

 public function getList($cols = '*', $filter = array('status' => 'false'), $offset = 0, $limit = -1, $orderby = null)
 {
     $services = kernel::serviceList('passport');
     foreach ($services as $service) {
         if ($service instanceof pam_interface_passport) {
             $a_temp = $service->get_config();
             $item['passport_id'] = $a_temp['passport_id']['value'];
             $item['passport_name'] = $a_temp['passport_name']['value'];
             $item['passport_status'] = $a_temp['passport_status']['value'];
             $item['passport_version'] = $a_temp['passport_version']['value'];
             $ret[] = $item;
         }
     }
     return $ret;
 }
开发者ID:dalinhuang,项目名称:shopexts,代码行数:15,代码来源:pam.php

示例9: function_header

 function function_header()
 {
     $ret = '<base href="' . kernel::base_url(1) . '"/>';
     $path = app::get('site')->res_full_url;
     $debug_css = defined('DEBUG_CSS') && constant('DEBUG_CSS');
     $debug_js = defined('DEBUG_JS') && constant('DEBUG_JS');
     $css_mini = $debug_css ? '' : '_mini';
     $cssver = kernel::single('base_component_ui')->getVer($debug_css);
     $jsver = kernel::single('base_component_ui')->getVer($debug_js);
     if (!defined("DONOTUSE_CSSFRAMEWORK") || !constant('DONOTUSE_CSSFRAMEWORK')) {
         $ret .= '<link rel="stylesheet" href="' . $path . '/css' . $css_mini . '/typical.css' . $cssver . '" />';
     }
     $ret .= '<link rel="stylesheet" href="' . $path . '/css' . $css_mini . '/widgets_edit.css' . $cssver . '" />';
     $ret .= kernel::single('base_component_ui')->lang_script(array('src' => 'lang.js', 'app' => 'site', 'pdir' => 'js_mini'));
     $ret .= kernel::single('base_component_ui')->lang_script(array('src' => 'lang.js', 'app' => 'b2c', 'pdir' => 'js_mini'));
     if ($debug_js) {
         $ret .= '<script src="' . $path . '/js/mootools.js' . $jsver . '"></script>
         <script src="' . $path . '/js/moomore.js' . $jsver . '"></script>
         <script src="' . $path . '/js/jstools.js' . $jsver . '"></script>
         <script src="' . $path . '/js/switchable.js' . $jsver . '"></script>
         <script src="' . $path . '/js/dragdropplus.js' . $jsver . '"></script>
         <script src="' . $path . '/js/widgetsinstance.js' . $jsver . '"></script>';
     } else {
         $ret .= '<script src="' . $path . '/js_mini/moo.min.js' . $jsver . '"></script>
         <script src="' . $path . '/js_mini/ui.min.js' . $jsver . '"></script>
         <script src="' . $path . '/js_mini/widgetsinstance.min.js' . $jsver . '"></script>';
     }
     if ($theme_info = app::get('site')->getConf('site.theme_' . app::get('site')->getConf('current_theme') . '_color')) {
         $theme_color_href = kernel::base_url(1) . '/themes/' . app::get('site')->getConf('current_theme') . '/' . $theme_info;
         $ret .= "<script>\n            window.addEvent('domready',function(){\n                new Element('link',{href:'" . $theme_color_href . "',type:'text/css',rel:'stylesheet'}).injectBottom(document.head);\n             });\n            </script>";
     }
     /*$ret .= '<script>
     					window.addEvent(\'domready\',function(){(parent.loadedPart[1])++});
                         parent.document.getElementById(\'loadpart\').style.display="none";
                         parent.document.getElementById(\'body\').style.display="block";
                     </script>';
     */
     foreach (kernel::serviceList('site_theme_view_helper') as $service) {
         if (method_exists($service, 'function_header')) {
             $ret .= $service->function_header();
         }
     }
     return $ret;
 }
开发者ID:sss201413,项目名称:ecstore,代码行数:44,代码来源:helper.php

示例10: analysis_hour

 /**
  * 每小时例行任务
  * @param null
  * @return null
  */
 public function analysis_hour()
 {
     $data = $this->fetch_by_interval('hour');
     foreach (kernel::serviceList('ectools_analyse_hour') as $service) {
         if (!$service instanceof ectools_analysis_interface) {
             continue;
         }
         $run_task = false;
         $service_name = get_class($service);
         $run_hour = strtotime(date("Y-m-d H", time() - 3600) . ':00:00');
         if (!isset($data[$service_name])) {
             $new_service = array('service' => $service_name, 'interval' => 'hour');
             if ($analysis_id = app::get('ectools')->model('analysis')->insert($new_service)) {
                 $run_task = true;
             }
         } elseif ($data[$service_name]['modify'] + 3600 <= $run_hour) {
             $run_hour = $data[$service_name]['modify'] + 3600;
             $run_task = true;
             $analysis_id = $data[$service_name]['id'];
             unset($data[$service_name]);
         } else {
             unset($data[$service_name]);
         }
         if ($run_task) {
             $rows = $service->get_logs($run_hour);
             if ($rows) {
                 foreach ($rows as $row) {
                     $logs = array();
                     $logs['analysis_id'] = $analysis_id;
                     $logs['type'] = $row['type'];
                     $logs['target'] = $row['target'];
                     $logs['flag'] = $row['flag'];
                     $logs['value'] = $row['value'];
                     $logs['time'] = $run_hour;
                     app::get('ectools')->model('analysis_logs')->insert($row);
                 }
             }
             app::get('ectools')->model('analysis')->update(array('modify' => $run_hour), array('id' => $analysis_id));
         }
     }
 }
开发者ID:sss201413,项目名称:ecstore,代码行数:46,代码来源:task.php

示例11: function_header

 function function_header()
 {
     $ret = '<base href="' . kernel::base_url(1) . '"/>';
     $path = app::get('site')->res_full_url;
     $debug_css = config::get('app.debug', false);
     $debug_js = config::get('app.debug', false);
     $css_mini = $debug_css ? '' : '.min';
     $cssver = view::ui()->getVer($debug_css);
     $jsver = view::ui()->getVer($debug_js);
     $ret .= '<link rel="stylesheet" href="' . $path . '/stylesheets/widgets_edit' . $css_mini . '.css' . $cssver . '" />';
     $ret .= view::ui()->lang_script(array('src' => 'lang.js', 'app' => 'site'));
     if ($debug_js) {
         $ret .= '<script src="' . $path . '/scripts/lib/mootools.js' . $jsver . '"></script>
         <script src="' . $path . '/scripts/lib/moomore.js' . $jsver . '"></script>
         <script src="' . $path . '/scripts/jstools.js' . $jsver . '"></script>
         <script src="' . $path . '/scripts/switchable.js' . $jsver . '"></script>
         <script src="' . $path . '/scripts/dragdropplus.js' . $jsver . '"></script>
         <script src="' . $path . '/scripts/widgetsinstance.js' . $jsver . '"></script>';
     } else {
         $ret .= '<script src="' . $path . '/scripts/lib/mootools.min.js' . $jsver . '"></script>
         <script src="' . $path . '/scripts/ui.min.js' . $jsver . '"></script>
         <script src="' . $path . '/scripts/widgetsinstance.min.js' . $jsver . '"></script>';
     }
     if ($theme_info = app::get('site')->getConf('site.theme_' . app::get('site')->getConf('current_theme') . '_color')) {
         $theme_color_href = kernel::base_url(1) . '/themes/' . app::get('site')->getConf('current_theme') . '/' . $theme_info;
         $ret .= "<script>\n            window.addEvent('domready',function(){\n                new Element('link',{href:'" . $theme_color_href . "',rel:'stylesheet'}).injectBottom(document.head);\n             });\n            </script>";
     }
     /*$ret .= '<script>
                         window.addEvent(\'domready\',function(){(parent.loadedPart[1])++});
                         parent.document.getElementById(\'loadpart\').style.display="none";
                         parent.document.getElementById(\'body\').style.display="block";
                     </script>';
     */
     foreach (kernel::serviceList('site_theme_view_helper') as $service) {
         if (method_exists($service, 'function_header')) {
             $ret .= $service->function_header();
         }
     }
     return $ret;
 }
开发者ID:453111208,项目名称:bbc,代码行数:40,代码来源:helper.php

示例12: function_header

 function function_header()
 {
     $ret = '<base href="' . kernel::base_url(1) . '"/>';
     $path = app::get('site')->res_full_url;
     $css_mini = defined('DEBUG_CSS') && constant('DEBUG_CSS') ? '' : '_mini';
     $ret .= '<link rel="stylesheet" href="' . $path . '/css' . $css_mini . '/framework.css" type="text/css" />';
     $ret .= '<link rel="stylesheet" href="' . $path . '/css' . $css_mini . '/widgets_edit.css" type="text/css" />';
     $ret .= kernel::single('base_component_ui')->lang_script(array('src' => 'lang.js', 'app' => 'site'));
     if (defined('DEBUG_JS') && constant('DEBUG_JS')) {
         $ret .= '<script src="' . $path . '/js/mootools.js?' . time() . '"></script>
                 <script src="' . $path . '/js/moomore.js?' . time() . '"></script>
                 <script src="' . $path . '/js/jstools.js?' . time() . '"></script>
                 <script src="' . $path . '/js/coms/switchable.js?' . time() . '"></script>
                 <script src="' . $path . '/js/dragdropplus.js?' . time() . '"></script>
                 <script src="' . $path . '/js/shopwidgets.js?' . time() . '"></script>';
     } else {
         $ret .= '<script src="' . $path . '/js_mini/moo_min.js"></script>
             <script src="' . $path . '/js_mini/tools_min.js"></script>
             <script src="' . $path . '/js_mini/ui_min.js"></script>
             <script src="' . $path . '/js_mini/shopwidgets_min.js"></script>';
     }
     //$ret.='<script src="'.$path.'/js_mini/patch.js"></script>';
     if ($theme_info = app::get('site')->getConf('site.theme_' . app::get('site')->getConf('current_theme') . '_color')) {
         $theme_color_href = kernel::base_url(1) . '/themes/' . app::get('site')->getConf('current_theme') . '/' . $theme_info;
         $ret .= "<script>\n            window.addEvent('domready',function(){\n                new Element('link',{href:'" . $theme_color_href . "',type:'text/css',rel:'stylesheet'}).inject(document.head);\n             });\n            </script>";
     }
     /* $ret .= '<script>
                         window.addEvent(\'domready\',function(){(parent.loadedPart[1])++});
                         parent.document.getElementById(\'loadpart\').style.display="none";
                         parent.document.getElementById(\'body\').style.display="block";
                     </script>';
     */
     foreach (kernel::serviceList('site_theme_view_helper') as $service) {
         if (method_exists($service, 'function_header')) {
             $ret .= $service->function_header();
         }
     }
     return $ret;
 }
开发者ID:syjzwjj,项目名称:quyeba,代码行数:39,代码来源:helper.php

示例13: __construct

 function __construct(&$app)
 {
     parent::__construct($app);
     if (@constant('WITHOUT_STRIP_HTML')) {
         $this->enable_strip_whitespace = false;
     }
     $this->app = $app;
     $this->_request = kernel::single('base_component_request');
     $this->_response = kernel::single('base_component_response');
     foreach (kernel::serviceList('site_controller_construct') as $service) {
         $service->prepare($this);
     }
     //构造时加载
     //finish modify controler-action html
     foreach (kernel::serviceList(sprintf('site_controller_content.%s.%s.%s', $this->_request->get_app_name(), $this->_request->get_ctl_name(), $this->_request->get_act_name())) as $class_name => $service) {
         if ($service instanceof site_interface_controller_content) {
             if (method_exists($service, 'modify')) {
                 $this->__finish_modifier[$class_name] = $service;
             }
             if (method_exists($service, 'boot')) {
                 $service->boot($this);
             }
         }
     }
 }
开发者ID:dalinhuang,项目名称:shopexts,代码行数:25,代码来源:controller.php

示例14: generate


//.........这里部分代码省略.........
     $aUpdate['ship_billno'] = $delivery['logi_no'];
     $aUpdate['ship_corp'] = $delivery['logi_name'];
     // 配送方式名称
     $obj_dlytype = $this->app->model('dlytype');
     $arr_dlytype = $obj_dlytype->dump($delivery['delivery'], 'dt_name');
     $aUpdate['delivery']['delivery'] = $arr_dlytype['dt_name'];
     if ($sdf_order['member_id']) {
         $pamMembers = app::get('pam')->model('members');
         $arr_member = $pamMembers->getList('login_account', array('member_id' => $sdf_order['member_id'], 'login_type' => 'email'));
     }
     $aUpdate['email'] = !$sdf_order['member_id'] ? $sdf_order['consignee']['email'] : $arr_member[0]['login_account'];
     $order->fireEvent('shipping', $aUpdate, $sdf_order['member_id']);
     $is_change_point = true;
     // 订单积分结算埋点
     $policy_stage = $this->app->getConf("site.consume_point.stage");
     if ($sdf_order['pay_status'] == '1' && $aUpdate['ship_status'] == '1' && $policy_stage == '2') {
         $stage = '1';
     } else {
         $stage = '0';
     }
     // 扣除积分,使用积分
     $obj_reducte_point = kernel::service('b2c_member_point_reducte');
     if ($stage) {
         $is_change_point = $obj_reducte_point->change_point($sdf_order['member_id'], 0 - intval($sdf_order['score_u']), $msg, 'order_pay_use', 1, $stage, $sdf['order_id'], $controller->user->user_id, 'delivery');
     }
     if (!$is_change_point) {
         $msg = app::get('b2c')->_('积分扣除超过会员已有积分');
         return false;
     }
     // 订单积分结算埋点
     $policy_stage = $this->app->getConf("site.get_policy.stage");
     if ($sdf_order['pay_status'] == '1' && $aUpdate['ship_status'] == '1' && $policy_stage == '2') {
         $stage = '1';
     } else {
         $stage = '0';
     }
     // 获得积分
     $obj_add_point = kernel::service('b2c_member_point_add');
     if ($stage) {
         $obj_add_point->change_point($sdf_order['member_id'], intval($sdf_order['score_g']), $msg, 'order_pay_get', 2, $stage, $sdf['order_id'], $controller->user->user_id, 'delivery');
     }
     //取得发货的具体信息,add by hujianxin
     $message_part1 = "";
     $message = "";
     $ship_status = $aUpdate['ship_status'];
     if ($ship_status == '1') {
         //全部发货
         $message_part1 = app::get('b2c')->_("发货完成");
     } else {
         if ($ship_status == '2') {
             //部分发货
             $message_part1 = app::get('b2c')->_("已发货");
         }
     }
     $message = "" . app::get('b2c')->_('订单') . "<!--order_id=" . $sdf['order_id'] . "&delivery_id=" . $delivery['delivery_id'] . "&ship_status=" . $ship_status . "-->" . $message_part1;
     $log_text = "";
     if ($ship_status == '1') {
         $log_text[] = array('txt_key' => stripslashes('订单<a href="javascript:void(0)" onclick=\'show_delivery_item(this,"%s",%s)\' title="点击查看详细" style="color: rgb(0, 51, 102); font-weight: bolder; text-decoration: underline;">全部商品</a>发货完成'), 'data' => array(0 => $delivery['delivery_id'], 1 => htmlentities(json_encode($arr_items), ENT_QUOTES)));
         if ($aCorp) {
             $log_text[] = array('txt_key' => ',物流公司:<a class="lnk" target="_blank" title="%s" href="%s">%s</a>(可点击进入物流公司网站跟踪配送)', 'data' => array(0 => $aCorp['name'], 1 => $aCorp['request_url'], 2 => $aCorp['name']));
         }
         if ($delivery['logi_no']) {
             $log_text[] = array('txt_key' => "物流单号:%s", 'data' => array(0 => $delivery['logi_no']));
             $log_addon['logi_no'] = $delivery['logi_no'];
             $log_addon = serialize($log_addon);
         }
         /*$log_text = "".app::get('b2c')->_('订单')."<a style=\"color: rgb(0, 51, 102); font-weight: bolder; text-decoration: underline;\" title=\"".app::get('b2c')->_('点击查看详细')."\" onclick=\"show_delivery_item(this,&quot;".$delivery['delivery_id']."&quot;," . htmlentities(json_encode($arr_items), ENT_QUOTES) . ")
         \" href=\"javascript:void(0)\">".app::get('b2c')->_('全部商品')."</a>".app::get('b2c')->_('发货完成')."," . (($aCorp) ? "".app::get('b2c')->_('物流公司:')."<a href=\"" . $aCorp['request_url'] . "\" title=\"" . $aCorp['name'] . "\" target=\"_blank\" class=\"lnk\">" . $aCorp['name'] . "</a>(".app::get('b2c')->_('可点击进入物流公司网站跟踪配送').")" : "") . (($delivery['logi_no']) ? "".app::get('b2c')->_('物流单号:')."" . $delivery['logi_no'] : "");*/
     }
     if ($ship_status == '2') {
         $log_text['items'] = array('txt_key' => stripslashes('订单<a href="javascript:void(0)" onclick=\'show_delivery_item(this,"%s",%s)\' title="点击查看详细" style="color: rgb(0, 51, 102); font-weight: bolder; text-decoration: underline;">部分商品</a>已发货'), 'data' => array(0 => $delivery['delivery_id'], 1 => htmlentities(json_encode($arr_items), ENT_QUOTES)));
         if ($aCorp) {
             $log_text['dlycorp'] = array('txt_key' => ',物流公司:<a class="lnk" target="_blank" title="%s" href="%s">%s</a>(可点击进入物流公司网站跟踪配送)', 'data' => array(0 => $aCorp['name'], 1 => $aCorp['request_url'], 2 => $aCorp['name']));
         }
         if ($delivery['logi_no']) {
             $log_text['logi_no'] = array('txt_key' => "物流单号:%s", 'data' => array(0 => $delivery['logi_no']));
             $log_addon['logi_no'] = $delivery['logi_no'];
             $log_addon = serialize($log_addon);
         }
         /*$log_text = "".app::get('b2c')->_('订单')."<a style=\"color: rgb(0, 51, 102); font-weight: bolder; text-decoration: underline;\" title=\"".app::get('b2c')->_('点击查看详细')."\" onclick=\"show_delivery_item(this,&quot;".$delivery['delivery_id']."&quot;," . htmlentities(json_encode($arr_items), ENT_QUOTES) . ")
         \" href=\"javascript:void(0)\">".app::get('b2c')->_('部分商品')."</a>".app::get('b2c')->_('已发货')."," . (($aCorp) ? "".app::get('b2c')->_('物流公司:')."<a href=\"" . $aCorp['request_url'] . "\" title=\"" . $aCorp['name'] . "\" target=\"_blank\" class=\"lnk\">" . $aCorp['name'] . "</a>(".app::get('b2c')->_('可点击进入物流公司网站跟踪配送').")" : "") . (($delivery['logi_no']) ? "".app::get('b2c')->_('物流单号:')."" . $delivery['logi_no'] : "");*/
     }
     $log_text = serialize($log_text);
     // 更新发货日志结果
     $objorder_log = $this->app->model('order_log');
     $sdf_order_log = array('rel_id' => $sdf['order_id'], 'op_id' => $sdf['opid'], 'op_name' => $sdf['opname'], 'alttime' => time(), 'bill_type' => 'order', 'behavior' => 'delivery', 'result' => 'SUCCESS', 'log_text' => $log_text, 'addon' => $log_addon);
     $log_id = $objorder_log->save($sdf_order_log);
     // 发货单结束后的处理任务
     $obj_after_delivery_service = kernel::serviceList('b2c.order.delivery.after');
     if ($obj_after_delivery_service) {
         $delivery['delivery_items'] = $items;
         $delivery['orders'] = $order_delivery_data;
         foreach ($obj_after_delivery_service as $obj) {
             if (method_exists($obj, 'generate')) {
                 $obj->generate($delivery);
             }
         }
     }
     return true;
 }
开发者ID:sss201413,项目名称:ecstore,代码行数:101,代码来源:delivery.php

示例15: get_global_varys

 public static function get_global_varys()
 {
     $app_varys = array();
     $serviceList = kernel::serviceList('cachemgr_global_vary');
     foreach ($serviceList as $service) {
         $class_name = get_class($service);
         $p = strpos($class_name, '_');
         if (method_exists($service, 'get_varys')) {
             $varys = $service->get_varys();
         }
         if (is_array($varys) && $p) {
             $app_id = substr($class_name, 0, $p);
             if (isset($app_varys[$app_id])) {
                 $app_varys[$app_id] = array_merge($app_varys[$app_id], $varys);
             } else {
                 $app_varys[$app_id] = $varys;
             }
             if (is_array($app_varys[$app_id])) {
                 ksort($app_varys[$app_id]);
             }
         }
     }
     ksort($app_varys);
     return $app_varys;
 }
开发者ID:dalinhuang,项目名称:shopexts,代码行数:25,代码来源:cachemgr.php


注:本文中的kernel::serviceList方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。