fix(monitor): remove non-existent worker columns from job_run_logs query

The job_run_logs table tracks scheduled job orchestration, not individual
worker jobs. Worker info (worker_id, worker_hostname) belongs on
dispensary_crawl_jobs, not job_run_logs.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Kelly
2025-12-03 18:45:05 -07:00
parent 54f40d26bb
commit 66e07b2009
466 changed files with 84988 additions and 9226 deletions

View File

@@ -262,11 +262,16 @@ class Crawlsy_Menus_Product_Grid_Widget extends \Elementor\Widget_Base {
$columns = $settings['columns'];
?>
<div class="crawlsy-product-grid crawlsy-grid-cols-<?php echo esc_attr($columns); ?>">
<?php foreach ($products as $product): ?>
<div class="crawlsy-product-card">
<?php if ($settings['show_image'] === 'yes' && !empty($product['image_url_full'])): ?>
<?php foreach ($products as $product):
$image_url = $product['image_url'] ?? $product['primary_image_url'] ?? $product['image_url_full'] ?? '';
$product_url = !empty($product['dutchie_url']) ? $product['dutchie_url'] : '#';
?>
<div class="crawlsy-product-card"
<?php if ($product_url !== '#'): ?>onclick="window.open('<?php echo esc_url($product_url); ?>', '_blank')"<?php endif; ?>
style="cursor: <?php echo ($product_url !== '#') ? 'pointer' : 'default'; ?>;">
<?php if ($settings['show_image'] === 'yes' && !empty($image_url)): ?>
<div class="crawlsy-product-image">
<img src="<?php echo esc_url($product['image_url_full']); ?>"
<img src="<?php echo esc_url($image_url); ?>"
alt="<?php echo esc_attr($product['name']); ?>"
loading="lazy" />
</div>

View File

@@ -25,6 +25,33 @@ class Crawlsy_Menus_Single_Product_Widget extends \Elementor\Widget_Base {
return ['general'];
}
/**
* Get products for the SELECT2 dropdown
*
* @return array Associative array of product_id => product_name
*/
protected function get_products_for_select() {
$options = ['' => __('-- Select a Product --', 'crawlsy-menus')];
$plugin = Crawlsy_Menus_Plugin::instance();
$products = $plugin->fetch_products(['limit' => 500]);
if ($products && is_array($products)) {
foreach ($products as $product) {
$label = $product['name'];
if (!empty($product['brand'])) {
$label = $product['brand'] . ' - ' . $label;
}
if (!empty($product['category'])) {
$label .= ' (' . $product['category'] . ')';
}
$options[$product['id']] = $label;
}
}
return $options;
}
protected function register_controls() {
// Content Section
@@ -36,13 +63,31 @@ class Crawlsy_Menus_Single_Product_Widget extends \Elementor\Widget_Base {
]
);
// Get products for the select dropdown
$products_options = $this->get_products_for_select();
$this->add_control(
'product_id',
[
'label' => __('Product ID', 'crawlsy-menus'),
'label' => __('Select Product', 'crawlsy-menus'),
'type' => \Elementor\Controls_Manager::SELECT2,
'options' => $products_options,
'default' => '',
'label_block' => true,
'description' => __('Search and select a product to display', 'crawlsy-menus'),
]
);
$this->add_control(
'product_id_manual',
[
'label' => __('Or Enter Product ID', 'crawlsy-menus'),
'type' => \Elementor\Controls_Manager::NUMBER,
'default' => '',
'description' => __('Enter the product ID to display', 'crawlsy-menus'),
'description' => __('Manually enter a product ID if not found in dropdown', 'crawlsy-menus'),
'condition' => [
'product_id' => '',
],
]
);
@@ -228,13 +273,16 @@ class Crawlsy_Menus_Single_Product_Widget extends \Elementor\Widget_Base {
protected function render() {
$settings = $this->get_settings_for_display();
if (empty($settings['product_id'])) {
echo '<p>' . __('Please enter a product ID.', 'crawlsy-menus') . '</p>';
// Use dropdown selection, or fall back to manual ID
$product_id = !empty($settings['product_id']) ? $settings['product_id'] : $settings['product_id_manual'];
if (empty($product_id)) {
echo '<p>' . __('Please select or enter a product ID.', 'crawlsy-menus') . '</p>';
return;
}
$plugin = Crawlsy_Menus_Plugin::instance();
$product = $plugin->fetch_product($settings['product_id']);
$product = $plugin->fetch_product($product_id);
if (!$product) {
echo '<p>' . __('Product not found.', 'crawlsy-menus') . '</p>';