我有2个运行循环以获取所有结果的数据库调用。
首先,我得到相对于当年的结果。
其次,我得到的结果相对于上一年(-1)。
如何将第二个循环的输出中的月份与第一个循环中的同一月对齐?
public function cargovolumes_cy() {
global $wpdb;
$cargodb = new $wpdb('root', 'devpw', 'exdb', 'localhost');
$currentmonthtxt = date('M');
$currentyear = date('Y');
$cargovolume_cy = array();
foreach($cargodb->get_results(
"
SELECT *, SUM(tonneCount)
FROM volumes
WHERE year = $currentyear
GROUP BY terminal, year, month
ORDER BY month desc, year desc
"
) as $key => $row) {
$tonnages = $row->tonneCount;
$terminal = $row->terminal;
$year = $row->year;
$month = $row->month;
$cargovolume_cy[] =
'<h4 class="cv-terminal-title">'.$terminal.' </h4>'.
'<div class="cargovolumes_cy">'.
'<div class="cargovolumes_cy-dates cvrow-'.$month.'-'.$year.'">'.
'<span class="cy-month"> '.$month.' …Run Code Online (Sandbox Code Playgroud) 当我尝试在我的 Wordpress 5.5.3 主题中运行 Sage 9.0.10 并安装 Yarn 然后执行“yarn build”或“yarn start”时,我收到此错误:
PS C:\xampp\htdocs\patrick.visiegroep\wp-content\themes\visiegroep> yarn build
yarn run v1.22.5
$ webpack --progress --config resources/assets/build/webpack.config.js
Error: No files matching the pattern "C:\xampp\htdocs\patrick.visiegroep\wp-content\themes\visiegroep\resources\assets\**\*.s?(c|a)ss" were found.
at C:\xampp\htdocs\patrick.visiegroep\wp-content\themes\visiegroep\node_modules\stylelint\lib\standalone.js:212:12
at processTicksAndRejections (internal/process/task_queues.js:97:5)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
PS C:\xampp\htdocs\patrick.visiegroep\wp-content\themes\visiegroep>
Run Code Online (Sandbox Code Playgroud)
通过“构建”和“开始”,我总是得到
Error: No files matching the pattern "C:\xampp\htdocs\patrick.visiegroep\wp-content\themes\visiegroep\resources\assets\**\*.s?(c|a)ss"
Run Code Online (Sandbox Code Playgroud)
我找不到哪里出了问题,因为在我不得不核对我的整个 Wordpress 和 Sage 之前,它曾经可以工作。重新安装后出现这种情况。
所以我尝试安装基本的 Sage 主题,但我不断收到此错误:
PHP 8.0.2 导致了一些问题,我一直在寻找解决方案......
有人可以给我一些关于我应该做什么的提示吗?
错误:
$ composer create-project roots/sage my-first-sage-theme
Creating a "roots/sage" project at "./my-first-sage-theme"
Installing roots/sage (9.0.10)
- Installing roots/sage (9.0.10): Extracting archive
Created project in D:\FUN\My-First-Sage-Website\wp-content\themes\my-first-sage-theme
Installing dependencies from lock file (including require-dev)
Verifying lock file contents can be installed on current platform.
Your lock file does not contain a compatible set of packages. Please run composer update.
Problem 1
- illuminate/config is locked to version v5.6.39 and an update of this package …Run Code Online (Sandbox Code Playgroud)