• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP getMicrotime函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中getMicrotime函数的典型用法代码示例。如果您正苦于以下问题:PHP getMicrotime函数的具体用法?PHP getMicrotime怎么用?PHP getMicrotime使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: stopTimer

 /**
  * Stop a benchmarking timer.
  *
  * $name should be the same as the $name used in startTimer().
  *
  * @param string $name The name of the timer to end.
  * @access public
  * @return boolean true if timer was ended, false if timer was not started.
  * @static
  */
 function stopTimer($name = null)
 {
     $end = getMicrotime();
     $_this = DebugKitDebugger::getInstance();
     if (!$name) {
         $names = array_reverse(array_keys($_this->__benchmarks));
         foreach ($names as $name) {
             if (!empty($_this->__benchmarks[$name]['end'])) {
                 continue;
             }
             if (empty($_this->__benchmarks[$name]['named'])) {
                 break;
             }
         }
     } else {
         $i = 1;
         $_name = $name;
         while (isset($_this->__benchmarks[$name])) {
             if (empty($_this->__benchmarks[$name]['end'])) {
                 break;
             }
             $i++;
             $name = $_name . ' #' . $i;
         }
     }
     if (!isset($_this->__benchmarks[$name])) {
         return false;
     }
     $_this->__benchmarks[$name]['end'] = $end;
     return true;
 }
开发者ID:masayukiando,项目名称:cakephp1.3-mailmagazine,代码行数:41,代码来源:debug_kit_debugger.php


示例2: cached

	function cached($url) {
		if (Configure::read('Cache.check') === true) {
			$path = $this->here;
			if ($this->here == '/') {
				$path = 'home';
			}
			if($this->Session->check('Auth.User._id')){
				//$path = $_SESSION['Auth']['User']['_id'].'_'.strtolower(Inflector::slug($path));
				$path = '4d33940fda220a9606000003_'.strtolower(Inflector::slug($path));
			}else{
				$path = strtolower(Inflector::slug($path));
			}

			$filename = CACHE . 'views' . DS . $path . '.php';

			if (!file_exists($filename)) {
				$filename = CACHE . 'views' . DS . $path . '_index.php';
			}

			if (file_exists($filename)) {
				if (!class_exists('View')) {
					App::import('View', 'View', false);
				}
				$controller = null;
				$view =& new View($controller);
				$return = $view->renderCache($filename, getMicrotime());
				if (!$return) {
					ClassRegistry::removeObject('view');
				}
				return $return;
			}
		}
		return false;
	}
开发者ID:ninetwentyfour,项目名称:Homkora,代码行数:34,代码来源:my_dispatcher.php


示例3: insertMessage

 public static function insertMessage($user_id, $chat_id, $message)
 {
     $conn = DbHandler::getConnection();
     $query = "INSERT INTO messages (chat_id, user_id, message, insert_time) " . "VALUES (" . $conn->escapeString($chat_id) . ", " . $conn->escapeString($user_id) . ", '" . $conn->escapeString($message) . "', " . $conn->escapeString(getMicrotime()) . ")";
     $conn->exec($query);
     UserHandler::setUserActivity();
     return true;
 }
开发者ID:krixisLv,项目名称:SimpleChat,代码行数:8,代码来源:MessageHandler.php


示例4: end

 public function end()
 {
     if (is_null($this->startTime) || !is_null($this->endTime)) {
         return false;
     }
     $this->endTime = getMicrotime();
     $this->elapsedTime = round($this->endTime - $this->startTime, 3);
     return true;
 }
开发者ID:laiello,项目名称:fredistrano,代码行数:9,代码来源:logs.php


示例5: stopTimer

 /**
  * Stop a benchmarking timer.
  *
  * $name should be the same as the $name used in startTimer().
  *
  * @param string $name The name of the timer to end.
  * @access public
  * @return boolean true if timer was ended, false if timer was not started.
  * @static
  */
 function stopTimer($name = 'default')
 {
     $now = getMicrotime();
     $_this = DebugKitDebugger::getInstance();
     if (!isset($_this->__benchmarks[$name])) {
         return false;
     }
     $_this->__benchmarks[$name]['end'] = $now;
     return true;
 }
开发者ID:kondrat,项目名称:agift,代码行数:20,代码来源:debug_kit_debugger.php


示例6: createUser

 protected static function createUser($username)
 {
     require_once "handlers/ChatHandler.php";
     $conn = DbHandler::getConnection();
     $query = "INSERT INTO users (username, last_activity) VALUES ( '" . $conn->escapeString($username) . "', " . $conn->escapeString(getMicrotime()) . " )";
     $conn->exec($query);
     $user_id = $conn->lastInsertRowID();
     // add user rel to public chat
     ChatHandler::addUserChatRel($user_id, ChatHandler::PUBLIC_CHAT_ID);
     return $user_id;
 }
开发者ID:krixisLv,项目名称:SimpleChat,代码行数:11,代码来源:UserHandler.php


示例7: endCount

 function endCount()
 {
     global $_runtime, $_SERVER, $db, $cac;
     $_runtime['Timer']['UserCodeFinished'] = getMicrotime();
     $runtimecore = $_runtime['Timer']['InitFinished'] - $_runtime['Timer']['InitStart'];
     $runtimeuser = $_runtime['Timer']['UserCodeFinished'] - $_runtime['Timer']['UserCodeStart'];
     $runtimetotal = $runtimecore + $runtimeuser;
     $runtimeava = (file_get_contents(PROJECT_ROOT . '/p-ava.log') + $runtimetotal) / 2;
     file_put_contents(PROJECT_ROOT . '/p.log', sprintf('[Performance Log] Total Running time: %s (Core code %s, User code %s); Database query: %s (%s failed); Cache query: %sr / %sw; Men usage: %s kilobytes (peak: %s kilobytes); URL: %s' . "\r\n", $runtimetotal, $runtimecore, $runtimeuser, $db->count['Success'], $db->count['Failed'], $cac->count['Readed'], $cac->count['Written'], memory_get_usage(true) / 1024, memory_get_peak_usage(true) / 1024, $_SERVER['REQUEST_URI']), FILE_APPEND);
     file_put_contents(PROJECT_ROOT . '/p-ava.log', $runtimeava);
 }
开发者ID:BGCX067,项目名称:faculaframework-svn-to-git,代码行数:11,代码来源:index.php


示例8: mysqlQuery

function mysqlQuery($config, $request, $report)
{
    $mysql = mysqlAccess($config);
    $start_time = getMicrotime();
    //		$show_time = true;
    if (!isset($request['mode'])) {
        $request['mode'] = 'SELECT';
    }
    $request['model'] = $GLOBALS['model'][$GLOBALS['controller']]['model'];
    if ($GLOBALS['debug'] == true) {
        print_r($request);
    }
    $db_result = buildQuery($mysql, $request, $start_time, $report);
    // Return MySQL query result and query:
    return array('result' => $db_result['result'], 'query' => $db_result['query']);
    // Close MySQL connection:
    $mysql->close();
}
开发者ID:chogsden,项目名称:file-browser,代码行数:18,代码来源:functions.php


示例9: hashFileSavePath

/**
 * 散列存储
 * @param $savePath - 本地保存的路径
 * @param $fileName - 原始文件名
 * @param $isHashSaving - 是否散列存储。
 * @param $randomFileName - 是否生成随机的Hash文件名。
 * @return array
 **/
function hashFileSavePath($savePath, $fileName = '', $isHashSaving = true, $randomFileName = true)
{
    $hashFileName = $randomFileName ? md5(randStr(20) . $fileName . getMicrotime() . uniqid()) : md5($fileName);
    $fileSaveDir = $savePath;
    $hashFilePath = '';
    //是否散列存储。
    if ($isHashSaving) {
        $hashFilePath = substr($hashFileName, 0, 1) . DIRECTORY_SEPARATOR . substr($hashFileName, 1, 2);
        $fileSaveDir = $savePath . DIRECTORY_SEPARATOR . $hashFilePath;
    }
    $fileInfo = array("file_path" => $hashFilePath, "file_name" => $hashFileName, "error" => 0);
    if (!is_dir($fileSaveDir)) {
        $result = mkdir($fileSaveDir, 0777, true);
        if (!$result) {
            $fileInfo["error"] = 1;
        }
    }
    return $fileInfo;
}
开发者ID:Rming,项目名称:novophp,代码行数:27,代码来源:Helper.func.php


示例10: execute

 /**
  * Queries the database with given SQL statement, and obtains some metadata about the result
  * (rows affected, timing, any errors, number of rows in resultset). The query is also logged.
  * If DEBUG is set, the log is shown all the time, else it is only shown on errors.
  *
  * @param string $sql
  * @return unknown
  */
 function execute($sql)
 {
     $t = getMicrotime();
     $this->_result = $this->_execute($sql);
     $this->affected = $this->lastAffected();
     $this->took = round((getMicrotime() - $t) * 1000, 0);
     $this->error = $this->lastError();
     $this->numRows = $this->lastNumRows($this->_result);
     if ($this->fullDebug && Configure::read() > 1) {
         $this->logQuery($sql);
     }
     if ($this->error) {
         $this->showQuery($sql);
         return false;
     } else {
         return $this->_result;
     }
 }
开发者ID:uwitec,项目名称:eduoa,代码行数:26,代码来源:dbo_source.php


示例11: _executeQuery

    function _executeQuery($queryData = array (), $cache = true) {

        $t = getMicrotime();
        $query = $this->_queryToString($queryData);
        if ($cache && isset ($this->_queryCache[$query])) {
            if (strpos(trim(strtolower($query)), $queryData['type']) !== false) {
                $res = $this->_queryCache[$query];
            }
        } else {        
            switch ($queryData['type']) {
                case 'search':
                    // TODO pb ldap_search & $queryData['limit']
                    if ($res = @ ldap_search($this->connection, $queryData['targetDn'] . ',' . $this->config['basedn'],
                            $queryData['conditions'], $queryData['fields'], 0, $queryData['limit'])) {
                        if ($cache) {
                            if (strpos(trim(strtolower($query)), $queryData['type']) !== false) {
                                $this->_queryCache[$query] = $res;
                            }
                        }
                    } else{
                        $res = false;
                    }
                    break;
                case 'delete':
                    $res = @ ldap_delete($this->connection, $queryData['targetDn'] . ',' . $this->config['basedn']);             
                    break;
                default:
                    $res = false;
                    break;
            }
        }
                
        $this->_result = $res;
        $this->took = round((getMicrotime() - $t) * 1000, 0);
        $this->error = $this->lastError();
        $this->numRows = $this->lastNumRows();

        if ($this->fullDebug) {
            $this->logQuery($query);
        }

        return $this->_result;
    }
开发者ID:recruitcojp,项目名称:WebHive,代码行数:43,代码来源:ldap_source.php


示例12: define

 * Editing below this line should not be necessary.
 * Change at your own risk.
 *
 */
if (!defined('WEBROOT_DIR')) {
    define('WEBROOT_DIR', basename(dirname(__FILE__)));
}
if (!defined('WWW_ROOT')) {
    define('WWW_ROOT', dirname(__FILE__) . DS);
}
if (!defined('CORE_PATH')) {
    if (function_exists('ini_set') && ini_set('include_path', CAKE_CORE_INCLUDE_PATH . PATH_SEPARATOR . ROOT . DS . APP_DIR . DS . PATH_SEPARATOR . ini_get('include_path'))) {
        define('APP_PATH', null);
        define('CORE_PATH', null);
    } else {
        define('APP_PATH', ROOT . DS . APP_DIR . DS);
        define('CORE_PATH', CAKE_CORE_INCLUDE_PATH . DS);
    }
}
if (!(include CORE_PATH . 'cake' . DS . 'bootstrap.php')) {
    trigger_error("CakePHP core could not be found.  Check the value of CAKE_CORE_INCLUDE_PATH in APP/webroot/index.php.  It should point to the directory containing your " . DS . "cake core directory and your " . DS . "vendors root directory.", E_USER_ERROR);
}
if (isset($_GET['url']) && $_GET['url'] === 'favicon.ico') {
    return;
} else {
    $Dispatcher = new Dispatcher();
    $Dispatcher->dispatch($url);
}
if (Configure::read() > 0) {
    echo "<!-- " . round(getMicrotime() - $TIME_START, 4) . "s -->";
}
开发者ID:BackupTheBerlios,项目名称:openphysic-svn,代码行数:31,代码来源:index.php


示例13: read

 /**
  * Used to read records from the Datasource. The "R" in CRUD
  *
  * @param Model $model The model being read.
  * @param array $queryData An array of query data used to find the data you want
  * @return mixed
  */
 public function read(&$model, $queryData = array())
 {
     if (!isset($model->records) || !is_array($model->records) || empty($model->records)) {
         $this->_requestsLog[] = array('query' => 'Model ' . $model->alias, 'error' => __('No records found in model.', true), 'affected' => 0, 'numRows' => 0, 'took' => 0);
         return array($model->alias => array());
     }
     $startTime = getMicrotime();
     $data = array();
     $i = 0;
     $limit = false;
     if (!isset($queryData['recursive'])) {
         $queryData['recursive'] = $model->recursive;
     }
     if (is_integer($queryData['limit']) && $queryData['limit'] > 0) {
         $limit = $queryData['page'] * $queryData['limit'];
     }
     foreach ($model->records as $pos => $record) {
         // Tests whether the record will be chosen
         if (!empty($queryData['conditions'])) {
             $queryData['conditions'] = (array) $queryData['conditions'];
             if (!$this->conditionsFilter($model, $record, $queryData['conditions'])) {
                 continue;
             }
         }
         $data[$i][$model->alias] = $record;
         $i++;
         // Test limit
         if ($limit !== false && $i == $limit && empty($queryData['order'])) {
             break;
         }
     }
     if ($queryData['fields'] === 'COUNT') {
         $this->_registerLog($model, $queryData, getMicrotime() - $startTime, 1);
         if ($limit !== false) {
             $data = array_slice($data, ($queryData['page'] - 1) * $queryData['limit'], $queryData['limit'], false);
         }
         return array(array(array('count' => count($data))));
     }
     // Order
     if (!empty($queryData['order'])) {
         if (is_string($queryData['order'][0])) {
             $field = $queryData['order'][0];
             $alias = $model->alias;
             if (strpos($field, '.') !== false) {
                 list($alias, $field) = explode('.', $field, 2);
             }
             if ($alias === $model->alias) {
                 $sort = 'ASC';
                 if (strpos($field, ' ') !== false) {
                     list($field, $sort) = explode(' ', $field, 2);
                 }
                 $data = Set::sort($data, '{n}.' . $model->alias . '.' . $field, $sort);
             }
         }
     }
     // Limit
     if ($limit !== false) {
         $data = array_slice($data, ($queryData['page'] - 1) * $queryData['limit'], $queryData['limit'], false);
     }
     // Filter fields
     if (!empty($queryData['fields'])) {
         $listOfFields = array();
         foreach ($queryData['fields'] as $field) {
             if (strpos($field, '.') !== false) {
                 list($alias, $field) = explode('.', $field, 2);
                 if ($alias !== $model->alias) {
                     continue;
                 }
             }
             $listOfFields[] = $field;
         }
         foreach ($data as $id => $record) {
             foreach ($record[$model->alias] as $field => $value) {
                 if (!in_array($field, $listOfFields)) {
                     unset($data[$id][$model->alias][$field]);
                 }
             }
         }
     }
     $this->_registerLog($model, $queryData, getMicrotime() - $startTime, count($data));
     $_associations = $model->__associations;
     if ($queryData['recursive'] > -1) {
         foreach ($_associations as $type) {
             foreach ($model->{$type} as $assoc => $assocData) {
                 $linkModel =& $model->{$assoc};
                 if ($model->useDbConfig == $linkModel->useDbConfig) {
                     $db =& $this;
                 } else {
                     $db =& ConnectionManager::getDataSource($linkModel->useDbConfig);
                 }
                 if (isset($db)) {
                     if (method_exists($db, 'queryAssociation')) {
                         $stack = array($assoc);
//.........这里部分代码省略.........
开发者ID:radig,项目名称:datasources,代码行数:101,代码来源:array_source.php


示例14: getTimers

 /**
  * Get all timers that have been started and stopped.
  * Calculates elapsed time for each timer. If clear is true, will delete existing timers
  *
  * @param bool $clear false
  * @return array
  * @access public
  **/
 function getTimers($clear = false)
 {
     $_this =& DebugKitDebugger::getInstance();
     $start = DebugKitDebugger::requestStartTime();
     $now = getMicrotime();
     $times = array();
     if (!empty($_this->__benchmarks)) {
         $firstTimer = current($_this->__benchmarks);
         $_end = $firstTimer['start'];
     } else {
         $_end = $now;
     }
     $times['Core Processing (Derived)'] = array('message' => __d('debug_kit', 'Core Processing (Derived)', true), 'start' => 0, 'end' => $_end - $start, 'time' => round($_end - $start, 6), 'named' => null);
     foreach ($_this->__benchmarks as $name => $timer) {
         if (!isset($timer['end'])) {
             $timer['end'] = $now;
         }
         $times[$name] = array_merge($timer, array('start' => $timer['start'] - $start, 'end' => $timer['end'] - $start, 'time' => DebugKitDebugger::elapsedTime($name)));
     }
     if ($clear) {
         $_this->__benchmarks = array();
     }
     return $times;
 }
开发者ID:ambagasdowa,项目名称:kml,代码行数:32,代码来源:debug_kit_debugger.php


示例15: stopMicrotime

function stopMicrotime($start_time)
{
    return number_format(getMicrotime() - $start_time, 6) * 1000;
}
开发者ID:chogsden,项目名称:file-browser,代码行数:4,代码来源:functions.php


示例16: getMicrotimeDiff

function getMicrotimeDiff($start = 0)
{
    return getMicrotime() - $start;
}
开发者ID:EDVLanger,项目名称:phpwcms,代码行数:4,代码来源:default.inc.php


示例17: getMicrotime

<?php

function getMicrotime()
{
    list($usec, $sec) = explode(" ", microtime());
    $usec_array = explode(".", $usec);
    return $usec_array[1];
}
$timestamp = date('Y-m-d_H-i-s_') . getMicrotime();
$target_png = "converted/" . $timestamp . ".png";
$source_svg = "source_svg/" . $timestamp . ".svg";
$svg_xml = $_POST['svg_xml'];
$svg_xml = stripslashes($svg_xml);
if ($svg_xml == "") {
    die("no xml provided");
}
file_put_contents($source_svg, $svg_xml);
system("convert -background none " . $source_svg . " " . $target_png);
system("chmod a+r converted/*");
echo "conversion/" . $target_png;
开发者ID:sampumon,项目名称:Pottisheads,代码行数:20,代码来源:convert.php


示例18: url_parameters

        $_runtime['ScriptName'] = $cfg['facula']['PrimaryScript'];
    }
    $_runtime['ScriptFull'] = $site['APIFastCGI'] ? $_SERVER['QUERY_STRING'] : $_SERVER['PATH_INFO'];
    // Get the self url for web page
    if ($site['general']['SiteUrlRewrite'] && $site['HtaccessFileExisted']) {
        $_runtime['BaseURL'] = $_runtime['SelfRoot'] . $_runtime['ScriptFull'];
        $_runtime['RootURL'] = $_runtime['SelfRoot'];
        $_runtime['ActualBaseURL'] = $_runtime['ScriptRoot'] . $_runtime['ScriptFull'];
        $_runtime['ActualRootURL'] = $_runtime['ScriptRoot'];
    } else {
        $_runtime['BaseURL'] = $_runtime['SelfRoot'] . '/' . $_runtime['ScriptName'] . $_runtime['ScriptFull'];
        $_runtime['RootURL'] = $_runtime['SelfRoot'] . '/' . $_runtime['ScriptName'];
        $_runtime['ActualBaseURL'] = $_runtime['ScriptRoot'] . '/' . $_runtime['ScriptName'] . $_runtime['ScriptFull'];
        $_runtime['ActualRootURL'] = $_runtime['ScriptRoot'] . '/' . $_runtime['ScriptName'];
    }
    $_URLPARAM = url_parameters($_runtime['ScriptFull']);
}
// Init Template Engine
$ui = new ui($cfg['template'], $site['general'], $_URLPARAM, $_runtime, $oops, $sec, $ses);
unset($cfg['template'], $cfg['cache'], $cfg['db']);
// Save all localsetting to sec class
$sec->setLocalSetValue($cfg);
unset($cfg, $site);
// Set autoload. Great thanks to tabris17.cn@hotmail
function __autoload($classname)
{
    global $sec;
    return $sec->loadClass($classname);
}
$_runtime['Timer']['InitFinished'] = $_runtime['Timer']['UserCodeStart'] = getMicrotime();
开发者ID:BGCX067,项目名称:faculaframework-svn-to-git,代码行数:30,代码来源:inc.initializer.php


示例19: returnMicrotime

 /**
  * returnMicrotime method
  *
  * @return void
  * @access public
  */
 public function returnMicrotime()
 {
     trigger_error(__FUNCTION__);
     return getMicrotime();
 }
开发者ID:hiromi2424,项目名称:mi,代码行数:11,代码来源:mi_cache.test.php


示例20: view_getNewGoodsList

 public function view_getNewGoodsList()
 {
     //调用action层, 获取列表数据
     $start1 = getMicrotime();
     $sku = $_GET['sku'] ? post_check(trim($_GET['sku'])) : '';
     $purchaseId = intval($_GET['purchaseId']) > 0 ? intval($_GET['purchaseId']) : 0;
     $whId = intval($_GET['whId']) > 0 ? intval($_GET['whId']) : 1;
     $omAvailableAct = new OmAvailableAct();
     $tName = 'pc_goods';
     $select = 'spu';
     $where = "WHERE is_delete=0 AND isNew=1 AND substring(sku, 1, 1)<>'M' AND substring(sku, 1, 1)<>'Z' and substring(sku, 1, 1)<>'F' ";
     if (!empty($sku)) {
         $where .= "AND sku like'{$sku}%' ";
     }
     if (!empty($purchaseId)) {
         $where .= "AND purchaseId='{$purchaseId}' ";
     }
     //第一步筛选,选出isNew=1,并且goodsName!=''和'无',sku不已F和Z开头的spu
     $spuList1 = $omAvailableAct->act_getTNameList($tName, $select, $where);
     $spuArr1 = array();
     foreach ($spuList1 as $value) {
         if (!empty($value['spu'])) {
             $spuArr1[] = $value['spu'];
         }
     }
     //此时 $spuSkuRelationArr1中保存的是spu和sku的关系数组,形如 array('1201'=>array('1201_B','1201_W'),'1202'=>array('1202'));
     //此时 $spuSkuRelationArr1中保存的是spu和sku的关系数组,形如 array('1201'=>array('1201_B','1201_W'),'1202'=>array('1202'));
     //第二步,选择出制作表已经存在的数据
     $tName = 'pc_products';
     $select = 'sku';
     $where = "WHERE is_delete=0 ";
     $skuList2 = OmAvailableModel::getTNameList($tName, $select, $where);
     $spuArr2 = array();
     foreach ($skuList2 as $value) {
         $tmpArr = explode('_', $value['sku']);
         if (!empty($tmpArr[0])) {
             $spu = $tmpArr[0];
             $spuArr2["{$spu}"] = $spu;
             //SPU
         }
     }
     //第三步,找出新品领料单中存在的sku;
     $tName = 'pc_products_iostore_detail';
     $select = 'sku';
     $where = "WHERE is_delete=0 AND iostoreTypeId=1 AND useTypeId=1 AND isAudit<3 ";
     $skuList3 = OmAvailableModel::getTNameList($tName, $select, $where);
     $spuArr3 = array();
     foreach ($skuList3 as $value) {
         $tmpArr = explode('_', $value['sku']);
         if (!empty($tmpArr[0])) {
             $spu = $tmpArr[0];
             $spuArr3["{$spu}"] = $spu;
             //SPU
         }
     }
     $saveSpuArr = array();
     //要保留的SPU
     foreach ($spuArr1 as $value) {
         if (!in_array($value, $spuArr2, true) && !in_array($value, $spuArr3, true)) {
             //SPU不在$spuArr2,$spuArr3时保留
             $saveSpuArr[] = "'" . $value . "'";
         }
         $saveSpuArr = array();
         //要保留的SPU
         foreach ($spuArr1 as $value) {
             if (!in_array($value, $spuArr2) && !in_array($value, $spuArr3)) {
                 //SPU不在$spuArr2,$spuArr3时保留
                 $saveSpuArr[] = "'" . $value . "'";
             }
         }
         if (empty($saveSpuArr)) {
             $saveSpuStr = "'0'";
         } else {
             $saveSpuStr = implode(',', $saveSpuArr);
         }
         $tName = 'pc_goods';
         $select = 'spu,sku,isNew';
         $where = "WHERE is_delete=0 AND spu IN({$saveSpuStr})";
         $skuList4 = OmAvailableModel::getTNameList($tName, $select, $where);
         $spuSkuRelationArr1 = array();
         $unSaveSpu = '';
     }
     $tName = 'pc_goods';
     $select = 'spu,sku,isNew';
     $where = "WHERE is_delete=0 AND spu IN({$saveSpuStr})";
     $skuList4 = OmAvailableModel::getTNameList($tName, $select, $where);
     $spuSkuRelationArr1 = array();
     $unSaveSpu = '';
     foreach ($skuList4 as $value) {
         if ($value['isNew'] == 0) {
             //过滤出全是新品的SPU
             $unSaveSpu = $value['spu'];
         }
         if ($unSaveSpu == $value['spu']) {
             continue;
         }
         $spuSkuRelationArr1[$value['spu']][] = $value['sku'];
     }
     $skuArr4 = array();
     foreach ($skuList4 as $value) {
//.........这里部分代码省略.........
开发者ID:ohjack,项目名称:newErp,代码行数:101,代码来源:products.view.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP getMime函数代码示例发布时间:2022-05-15
下一篇:
PHP getMicroshopPersonalImageUrl函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap