hasMany(Goods::class,'shop_id','shop_id'); } /** * @notes 公共处理图片,补全路径 * @param $value * @return string * @author 张无忌 * @date 2021/9/10 11:02 */ public function getIdCardFrontAttr($value) { return trim($value) ? FileService::getFileUrl($value) : ''; } /** * @notes 公共图片处理,去除图片域名 * @param $value * @return mixed|string * @author 张无忌 * @date 2021/9/10 11:04 */ public function setIdCardFrontAttr($value) { return trim($value) ? FileService::setFileUrl($value) : ''; } /** * @notes 公共处理图片,补全路径 * @param $value * @return string * @author 张无忌 * @date 2021/9/10 11:02 */ public function getIdCardBackAttr($value) { return trim($value) ? FileService::getFileUrl($value) : ''; } /** * @notes 公共图片处理,去除图片域名 * @param $value * @return mixed|string * @author 张无忌 * @date 2021/9/10 11:04 */ public function setIdCardBackAttr($value) { return trim($value) ? FileService::setFileUrl($value) : ''; } /** * @notes 公共处理图片,补全路径 * @param $value * @return string * @author 张无忌 * @date 2021/9/10 11:02 */ public function getPortraitShootingAttr($value) { return trim($value) ? FileService::setFileUrl($value) : ''; } /** * @notes 公共图片处理,去除图片域名 * @param $value * @return mixed|string * @author 张无忌 * @date 2021/9/10 11:04 */ public function setPortraitShootingAttr($value) { return trim($value) ? FileService::setFileUrl($value) : ''; } /** * @notes 公共处理图片,补全路径 * @param $value * @return string * @author 张无忌 * @date 2021/9/10 11:02 */ public function getLogoAttr($value) { return trim($value) ? FileService::getFileUrl($value) : ''; } /** * @notes 公共图片处理,去除图片域名 * @param $value * @return mixed|string * @author 张无忌 * @date 2021/9/10 11:04 */ public function setLogoAttr($value) { return trim($value) ? FileService::setFileUrl($value) : ''; } /** * @notes 公共处理图片,补全路径 * @param $value * @return string * @author 张无忌 * @date 2021/9/10 11:02 */ public function getBusinessLicenseAttr($value) { return trim($value) ? FileService::getFileUrl($value) : ''; } /** * @notes 公共图片处理,去除图片域名 * @param $value * @return mixed|string * @author 张无忌 * @date 2021/9/10 11:04 */ public function setBusinessLicenseAttr($value) { return trim($value) ? FileService::setFileUrl($value) : ''; } /** * @notes 公共图片处理,去除图片域名 * @param $value * @return array|string[] * @author cjhao * @date 2024/10/5 21:02 */ public function getShopImageAttr($value) { $shopImageLists = []; if($value) { $shopImageLists = explode(',',$value); foreach ($shopImageLists as $key => $shopImage) { $shopImageLists[$key] = FileService::getFileUrl($shopImage); } } return $shopImageLists; } /** * @notes 公共图片处理 * @param $value * @return string * @author cjhao * @date 2024/10/5 21:05 */ public function setShopImageAttr($value) { $shopImageLists = []; if($value){ foreach ($value as $shopImage){ $shopImageLists[] = FileService::setFileUrl($shopImage); } } return implode(',',$shopImageLists); } /** * @notes 获取分类ids * @param $value * @return string * @author cjhao * @date 2024/10/6 13:05 */ public function getCategoryIdsAttr($value) { $categoryIds = ''; if($value){ $categoryIds = explode(',',$value); } return $categoryIds; } /** * @notes 设置分类ids * @param $value * @return array|string[] * @author cjhao * @date 2024/10/6 13:06 */ public function setCategoryIdsAttr($value){ $categoryIds = []; if($value){ $categoryIds = implode(',',$value); } return $categoryIds; } /** * @notes 获取商品ids * @param $value * @return string * @author cjhao * @date 2024/10/6 13:05 */ public function getGoodsIdsAttr($value) { $goodsIds = ''; if($value){ $goodsIds = explode(',',$value); } return $goodsIds; } /** * @notes 设置商品ids * @param $value * @return array|string[] * @author cjhao * @date 2024/10/6 13:06 */ public function setGoodsIdsAttr($value){ $goodsIds = []; if($value){ $goodsIds = implode(',',$value); } return $goodsIds; } /** * @notes 获取店铺地址 * @param $value * @param $data * @return string * @author cjhao * @date 2024/10/7 00:34 */ public function getRegionDescAttr($value,$data) { $cityIds = []; $cityLists = ''; $data['province_id'] && $cityIds[] = $data['province_id']; $data['city_id'] && $cityIds[] = $data['city_id']; if($cityIds){ $cityLists = Region::where(['id'=>$cityIds])->column('name'); $cityLists = implode('',$cityLists); } return $cityLists; } /** * @notes 审核状态 * @param $value * @return string|string[] * @author cjhao * @date 2024/10/7 00:25 */ public function getAuditStatusDescAttr($value,$data) { return ShopEnum::getAuditStatusDesc($data['audit_status']); } /** * @notes 获取地区 * @param $value * @param $data * @return string * @author cjhao * @date 2024/8/26 12:52 */ public function getRegionNameAttr($value,$data) { return Region::where(['id'=>$data['region_id']])->value('name'); } /** * @notes 省份id * @param $value * @param $data * @return mixed * @author cjhao * @date 2024/11/26 14:47 */ public function getProvinceNameAttr($value,$data) { return Region::where(['id'=>$data['province_id']])->value('name'); } /** * @notes 省份id * @param $value * @param $data * @return mixed * @author cjhao * @date 2024/11/26 14:47 */ public function getCityNameAttr($value,$data) { return Region::where(['id'=>$data['city_id']])->value('name'); } }