|
|
@@ -5064,6 +5064,16 @@ class StoreOrderRepository extends BaseRepository
|
|
5064
|
5064
|
{
|
|
5065
|
5065
|
$where['paid'] = 1;
|
|
5066
|
5066
|
$query = $this->dao->search($where, null);
|
|
|
5067
|
+ $kw = trim($where['product_keywords'] ?? '');//从where取出去除空格
|
|
|
5068
|
+ if ($kw !== '') {
|
|
|
5069
|
+ $ids =Db::name('store_order_product')
|
|
|
5070
|
+ ->whereRaw("JSON_UNQUOTE(JSON_EXTRACT(cart_info, '$.product.store_name')) LIKE ?", ["%{$kw}%"])
|
|
|
5071
|
+ ->column('order_id');
|
|
|
5072
|
+ if (empty($ids)) {
|
|
|
5073
|
+ return ['count' => 0, 'list' => []];
|
|
|
5074
|
+ }
|
|
|
5075
|
+ $query->whereIn('order_id', $ids);
|
|
|
5076
|
+ }
|
|
5067
|
5077
|
$count = $query->count();
|
|
5068
|
5078
|
$list = $query->with([
|
|
5069
|
5079
|
'orderProduct', 'merchant' => function ($query) {
|
|
|
@@ -5125,6 +5135,15 @@ class StoreOrderRepository extends BaseRepository
|
|
5125
|
5135
|
return $query->field('uid,phone,nickname');
|
|
5126
|
5136
|
}
|
|
5127
|
5137
|
]);
|
|
|
5138
|
+
|
|
|
5139
|
+ $kw = trim($where['product_keywords'] ?? '');
|
|
|
5140
|
+ if ($kw !== '') {
|
|
|
5141
|
+ $ids = Db::name('store_order_product')
|
|
|
5142
|
+ ->whereRaw("JSON_UNQUOTE(JSON_EXTRACT(cart_info, '$.product.store_name')) LIKE ?", ["%{$kw}%"])
|
|
|
5143
|
+ ->column('order_id');
|
|
|
5144
|
+ $ids = $ids ?: [-1];
|
|
|
5145
|
+ $query->whereIn('order_id', $ids);
|
|
|
5146
|
+ }
|
|
5128
|
5147
|
$query1 = clone ($query);
|
|
5129
|
5148
|
$query2 = clone ($query);
|
|
5130
|
5149
|
|