wangsong1234

1504 经验值

只前端验证的话,我们的测试会提bug。。。验证这块也是做的非常严格,需要这样吗?

每行命令后面总有 账户名称 xxx@xxx-xx 这个怎么去掉显示啊

改掉了:是主题的原因

类实例化时,通过映射获取了构造器的参数,按照参数的依赖在去实例依赖。闭包的话没有太清楚,按 Closure 处理应该可以

和你要的结果一样

        $json = (new Filesystem())->get(public_path('1.json'));

        $json = collect(json_decode($json, true))->groupBy('good.shop.id')->map(function (Collection $company) {

            $data          = Arr::get($company->first(), 'good.shop');
            $data['goods'] = $company->map(function ($good) {

                Arr::forget($good, 'good.shop');
                $g = $good['good'];
                Arr::forget($good, 'good');

                return array_merge($g, $good);
            })->toArray();

            return $data;
        });

        dump($json->toArray());
        $goods = collect($goods)->pluck('good_name', 'good_id');

        $order = collect($order)->map(function ($value, $key) use($goods) {

            if ($goods->has($value['good_id'])) {
                $value['good_name'] = $goods->get($value['good_id']);
            }

            return $value;
        });

        dump($order->toArray());