1) { // $result['is_more_sku'] = 1; // } // break; // case GoodsEnum::GATHER_CHANNEL_JD: // $result['goods_name'] = $data['gather_info']['data']['item']['name']; // $result['goods_image'] = isset($data['gather_info']['data']['item']['images'][0]) ? ltrim($data['gather_info']['data']['item']['images'][0],'//') : ''; // $result['goods_image'] = checkHttp($result['goods_image']); // $result['is_more_sku'] = 0; // if (count($data['gather_info']['data']['item']['sku']) > 1) { // $result['is_more_sku'] = 1; // } // break; // case GoodsEnum::GATHER_CHANNEL_1688: // $result['goods_name'] = $data['gather_info']['data']['title']; // $result['goods_image'] = isset($data['gather_info']['data']['images'][0]) ? ltrim($data['gather_info']['data']['images'][0],'//') : ''; // $result['goods_image'] = checkHttp($result['goods_image']); // $result['is_more_sku'] = 0; // if (count($data['gather_info']['data']['skuMap']) > 1) { // $result['is_more_sku'] = 1; // } // break; // } $goods_gather_goods = GoodsGatherGoods::where(['gather_id'=>$data['id']])->findOrEmpty()->toArray(); $result['goods_name'] = $goods_gather_goods['name']; $result['goods_image'] = $goods_gather_goods['goods_image'][0] ?? 0; $result['goods_image'] = checkHttp($result['goods_image']); $result['is_more_sku'] = 0; if ($goods_gather_goods['spec_type'] == 2) { $result['is_more_sku'] = 1; } } return $result; } /** * @notes 采集状态 * @param $value * @param $data * @return string|string[] * @author ljj * @date 2023/3/14 2:55 下午 */ public function getGatherStatusDescAttr($value,$data) { return YesNoEnum::getGatherStatusDesc($data['gather_status']); } /** * @notes 采集渠道 * @param $value * @param $data * @return string|string[] * @author ljj * @date 2023/3/14 2:56 下午 */ public function getChannelDescAttr($value,$data) { return GoodsEnum::getGatherChannelDesc($data['channel']); } }