宅男在线永久免费观看网直播,亚洲欧洲日产国码无码久久99,野花社区在线观看视频,亚洲人交乣女bbw,一本一本久久a久久精品综合不卡

全部
常見問(wèn)題
產(chǎn)品動(dòng)態(tài)
精選推薦

進(jìn)店規(guī)則獲取門店和商品所在門店沖突問(wèn)題

管理 管理 編輯 刪除

問(wèn)題說(shuō)明:進(jìn)店規(guī)則獲取門店和商品所在門店沖突造成沒(méi)獲取到門店信息

修改文件:app/services/store/SystemStoreServices.php

修改方法:getStoreList()

public function getStoreList(array $where, array $field = ['*'], string $latitude = '', string $longitude = '', int $product_id = 0, array $with = [], int $type = 0, $store_id = 0)
    {
        $order = 0;
        if (isset($where['order_id']) && $where['order_id']) {
            /** @var StoreOrderServices $storeOrderServices */
            $storeOrderServices = app()->make(StoreOrderServices::class);
            $user_location = $storeOrderServices->value(['id' => $where['order_id']], 'user_location');
			if ($user_location) {
				[$longitude, $latitude] = explode(' ', $user_location);
			}
        }
        if ($longitude && $latitude) {
            $order = 1;
        }
        $list = [];
        $count = 0;
        //移動(dòng)端定位選擇門店
        if ($store_id) {
            $where['ids'] = [$store_id];
        }
        //該商品上架的門店
        if ($product_id) {
            /** @var StoreBranchProductServices $productServices */
            $productServices = app()->make(StoreBranchProductServices::class);
            [$ids, $applicableType, $productType] = $productServices->getApplicableStoreIds($product_id, $type);
            if ($ids) {
				if ($productType == 1) {//門店商品
					$where['ids'] = $ids;
				} else {
					if ($store_id && !in_array($store_id, $ids)) {
						return compact('list', 'count');
					}
					if (isset($where['ids']) && $where['ids']) {
						$ids = array_intersect($where['ids'], $ids);
					}
					if ($ids) {
						$where['ids'] = $ids;
					} else {
						return compact('list', 'count');
					}
					$where['ids'] = isset($where['ids']) && $where['ids'] ? array_intersect($where['ids'], $ids) : $ids;
				}
            } else {
                if ($applicableType != 1) {//不是所有門店
                    return compact('list', 'count');
                }
            }
        }
        $oid = (int)($where['order_id'] ?? 0);
        unset($where['order_id']);
       if (isset($where['ids'])) {//有選擇門店 || 商品適用門店情況
			if (isset($where['id']) && $where['id']) {//合并進(jìn)店規(guī)則進(jìn)入門店
				$where['ids'] = array_merge($where['ids'], is_array($where['id']) ? $where['id'] :[$where['id']]);
				unset($where['id']);
			}
            $where['ids'] = array_unique(array_diff($where['ids'], [0]));
        }
		if ($oid || $product_id) {//不分頁(yè)
			$page = $limit = 0;
		} else {
			[$page, $limit] = $this->getPageValue();
		}
		$storeList = $this->dao->getStoreList($where, $field, $page, $limit, $with, $latitude, $longitude, $order);
        if ($storeList) {
            $storeIds = [];
            if ($oid) {
                [$storeIds, $cartInfo] = $this->checkOrderProductShare($oid, $storeList, 2);
            }
            $prefix = config('admin.store_prefix');
            $regionIds = array_column($storeList, 'region_id');
            if ($regionIds) {
                /** @var SystemRegionAgentServices $storeRegionServices */
                $storeRegionServices = app()->make(SystemRegionAgentServices::class);
                $regionNames = $storeRegionServices->getColumn([['id', 'in', $regionIds], ['is_del', '=', 0]], 'name', 'id');
            }
			$now = date('Hi');
            foreach ($storeList as &$item) {
				$item['type_name'] = '';
				if (isset($item['type'])) {
					$item['type_name'] = $this->typeName[$item['type']] ?? '';
				}
                if (isset($item['distance'])) {
                    $item['range'] = bcdiv($item['distance'], '1000', 1);
                } else {
                    $item['range'] = 0;
                }
				$item['business_status'] = 0;
                if ($item['is_show'] == 1) {
                    $item['status_name'] = '營(yíng)業(yè)中';
					if ($item['day_start'] && $item['day_end']) {
						$start = date('Hi', strtotime($item['day_start']));
						$end = date('Hi', strtotime($item['day_end']));
						if ($now >= $start && $now <= $end) {
							$item['business_status'] = 1;
						}
					}
                } else {
                    $item['status_name'] = '已停業(yè)';
                }

                $item['prefix'] = $prefix;
                $item['recommend_region_name'] = '';
                if (isset($item['region_id']) && $item['region_id']) {
                    $item['recommend_region_name'] = $regionNames[$item['region_id']] ?? '';
                }
                if ($oid) {
                    if (in_array($item['id'], $storeIds)) {
                        $list[] = $item;
                    }
                } else {
                    $list[] = $item;
                }
            }
            if (count($list) && $store_id) {
                $arr = [];
                foreach ($list as $key => $value) {
                    if ($value['id'] == $store_id) {
                        $arr = $value;
                        unset($list[$key]);
                    }
                }
                if ($arr) array_unshift($list, $arr);
            }
            if ($oid) {
                $count = count($list);
            } else {
                $count = $this->dao->count($where);
            }
        }

        return compact('list', 'count');
    }



請(qǐng)登錄后查看

全 最后編輯于2025-10-23 16:41:44

快捷回復(fù)
回復(fù)
回復(fù)
回復(fù)({{post_count}}) {{!is_user ? '我的回復(fù)' :'全部回復(fù)'}}
排序 默認(rèn)正序 回復(fù)倒序 點(diǎn)贊倒序

{{item.user_info.nickname ? item.user_info.nickname : item.user_name}} LV.{{ item.user_info.bbs_level || item.bbs_level }}

作者 管理員 企業(yè)

{{item.floor}}# 同步到gitee 已同步到gitee {{item.is_suggest == 1? '取消推薦': '推薦'}}
{{item.is_suggest == 1? '取消推薦': '推薦'}} 【已收集】
{{item.floor}}# 沙發(fā) 板凳 地板 {{item.floor}}# 【已收集】
{{item.user_info.title || '暫無(wú)簡(jiǎn)介'}}
附件

{{itemf.name}}

{{item.created_at}}  {{item.ip_address}}
打賞
已打賞¥{{item.reward_price}}
{{item.like_count}}
分享
{{item.showReply ? '取消回復(fù)' : '回復(fù)'}}
刪除
回復(fù)
回復(fù)

{{itemc.user_info.nickname}}

{{itemc.user_name}}

回復(fù) {{itemc.comment_user_info.nickname}}

附件

{{itemf.name}}

{{itemc.created_at}}
打賞
已打賞¥{{itemc.reward_price}}
{{itemc.like_count}}
{{itemc.showReply ? '取消回復(fù)' : '回復(fù)'}}
刪除
回復(fù)
回復(fù)
查看更多
打賞
已打賞¥{{reward_price}}
313
{{like_count}}
{{collect_count}}
添加回復(fù) ({{post_count}})

相關(guān)推薦

快速安全登錄

使用微信掃碼登錄
回復(fù)
回復(fù)
問(wèn)題:
問(wèn)題自動(dòng)獲取的帖子內(nèi)容,不準(zhǔn)確時(shí)需要手動(dòng)修改. [獲取答案]
答案:
提交
bug 需求 取 消 確 定
打賞金額
當(dāng)前余額:¥{{rewardUserInfo.reward_price}}
{{item.price}}元
請(qǐng)輸入 0.1-{{reward_max_price}} 范圍內(nèi)的數(shù)值
打賞成功
¥{{price}}
完成 確認(rèn)打賞

微信登錄/注冊(cè)

切換手機(jī)號(hào)登錄

{{ bind_phone ? '綁定手機(jī)' : '手機(jī)登錄'}}

{{codeText}}
切換微信登錄/注冊(cè)
暫不綁定
CRMEB客服

CRMEB咨詢熱線 咨詢熱線

400-8888-794

微信掃碼咨詢

CRMEB開源商城下載 源碼下載 CRMEB幫助文檔 幫助文檔
返回頂部 返回頂部
CRMEB客服