Browse Source

餐厅订单

gorden 3 months ago
parent
commit
ee65e3fffa
1 changed files with 5 additions and 1 deletions
  1. 5 1
      app/admin/controller/order/DishesController.php

+ 5 - 1
app/admin/controller/order/DishesController.php

@@ -127,7 +127,11 @@ class DishesController extends Curd
                 if ($value[0] === 'like' || $value[0] === 'not like') {
                     $model = $model->where($column, $value[0], "%$value[1]%");
                 } elseif ($column == 'json') {
-                    $model = $model->whereJsonContains($value[0] . '->' . $value[1], intval($value[2]));
+                    $model = $model->where(function ($query) use ($value){
+                        $query->whereJsonContains($value[0] . '->' . $value[1], intval($value[2]))
+                            ->orWhereJsonContains($value[0] . '->' . $value[1], strval($value[2]));
+                    });
+//                    $model = $model->whereJsonContains($value[0] . '->' . $value[1], intval($value[2]));
                 } elseif (in_array($value[0], ['>', '=', '<', '<>'])) {
                     $model = $model->where($column, $value[0], $value[1]);
                 } elseif ($value[0] == 'in' && !empty($value[1])) {