初始版本

This commit is contained in:
贾祥聪
2025-08-19 14:16:51 +08:00
commit f937a1f9b9
4373 changed files with 359728 additions and 0 deletions

View File

@@ -0,0 +1,340 @@
<?php
// +----------------------------------------------------------------------
// | likeshop100%开源免费商用商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | 商业版本务必购买商业授权,以免引起法律纠纷
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | gitee下载https://gitee.com/likeshop_gitee
// | github下载https://github.com/likeshop-github
// | 访问官网https://www.likeshop.cn
// | 访问社区https://home.likeshop.cn
// | 访问手册http://doc.likeshop.cn
// | 微信公众号likeshop技术社区
// | likeshop团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshopTeam
// +----------------------------------------------------------------------
namespace app\common\model\shop;
use app\common\enum\shop\ShopEnum;
use app\common\model\BaseModel;
use app\common\model\coach\Coach;
use app\common\model\Region;
use app\common\service\FileService;
/**
* 店铺模型类
* Class Shop
* @package app\common\model\shop
*/
class Shop extends BaseModel
{
public function coach()
{
return $this->hasMany(Coach::class,'shop_id');
}
public function categoryIds()
{
return $this->hasMany(ShopCategoryIndex::class,'shop_id');
}
public function goods()
{
return $this->hasMany(ShopGoodsIndex::class,'shop_id');
}
public function goodsIds()
{
return $this->hasMany(ShopGoodsIndex::class,'shop_id');
}
public function shopImage()
{
return $this->hasMany(ShopImage::class,'shop_id');
}
public function getTakeOrderAttr($value,$data)
{
return [
'everyday' => 2,
'total_order' => 1
];
}
/**
* @notes 获取工作状态
* @param $value
* @param $data
* @return string|string[]
* @author cjhao
* @date 2024/10/3 15:43
*/
public function getWorkStatusDescAttr($value,$data)
{
return ShopEnum::getWorkStatus($data['work_status']);
}
/**
* @notes 获取工作状态
* @param $value
* @param $data
* @return string|string[]
* @author cjhao
* @date 2024/10/3 15:43
*/
public function getServerStatusDescAttr($value,$data)
{
return ShopEnum::getServerStatus($data['server_status']);
}
/**
* @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::getFileUrl($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
* @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'];
$data['region_id'] && $cityIds[] = $data['region_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 将距离转成km格式显示
* @param $value
* @param $data
* @return string
* @author cjhao
* @date 2024/9/3 22:56
*/
public function getDistanceDescAttr($value,$data){
return !empty($data['distance']) ? round($data['distance'],2).'km' : '';
}
/**
* @notes 获取营业时间
* @param $value
* @param $data
* @return string
* @author cjhao
* @date 2024/11/20 20:44
*/
public function getBusinessTimeDescAttr($value,$data)
{
$businessTimeLists = [
'周一' => $data['monday'],
'周二' => $data['tuesday'],
'周三' => $data['wednesday'],
'周四' => $data['thursday'],
'周五' => $data['friday'],
'周六' => $data['saturday'],
'周日' => $data['sunday']
];
$businessTime = displayBusinessHours($businessTimeLists);
if(empty($businessTime)){
return '';
}
return $businessTime . ' '.$data['business_start_time'].'-'.$data['business_end_time'];
}
/**
* @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');
}
}

View File

@@ -0,0 +1,32 @@
<?php
// +----------------------------------------------------------------------
// | likeshop100%开源免费商用商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | 商业版本务必购买商业授权,以免引起法律纠纷
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | gitee下载https://gitee.com/likeshop_gitee
// | github下载https://github.com/likeshop-github
// | 访问官网https://www.likeshop.cn
// | 访问社区https://home.likeshop.cn
// | 访问手册http://doc.likeshop.cn
// | 微信公众号likeshop技术社区
// | likeshop团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshopTeam
// +----------------------------------------------------------------------
namespace app\common\model\shop;
use app\common\model\BaseModel;
use app\common\model\goods\GoodsCategory;
class ShopCategoryIndex extends BaseModel
{
public function category()
{
return $this->hasMany(GoodsCategory::class,'id','category_id');
}
}

View File

@@ -0,0 +1,12 @@
<?php
namespace app\common\model\shop;
use app\common\model\BaseModel;
/**
* 店铺申请模型类
* Class ShopCoachApply
* @package app\common\model\shop
*/
class ShopCoachApply extends BaseModel{
}

View File

@@ -0,0 +1,26 @@
<?php
// +----------------------------------------------------------------------
// | likeshop100%开源免费商用商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | 商业版本务必购买商业授权,以免引起法律纠纷
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | gitee下载https://gitee.com/likeshop_gitee
// | github下载https://github.com/likeshop-github
// | 访问官网https://www.likeshop.cn
// | 访问社区https://home.likeshop.cn
// | 访问手册http://doc.likeshop.cn
// | 微信公众号likeshop技术社区
// | likeshop团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshopTeam
// +----------------------------------------------------------------------
namespace app\common\model\shop;
use app\common\model\BaseModel;
class ShopGoodsIndex extends BaseModel
{
}

View File

@@ -0,0 +1,54 @@
<?php
// +----------------------------------------------------------------------
// | likeshop100%开源免费商用商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | 商业版本务必购买商业授权,以免引起法律纠纷
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | gitee下载https://gitee.com/likeshop_gitee
// | github下载https://github.com/likeshop-github
// | 访问官网https://www.likeshop.cn
// | 访问社区https://home.likeshop.cn
// | 访问手册http://doc.likeshop.cn
// | 微信公众号likeshop技术社区
// | likeshop团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshopTeam
// +----------------------------------------------------------------------
namespace app\common\model\shop;
use app\common\model\BaseModel;
use app\common\service\FileService;
class ShopImage extends BaseModel
{
/**
* @notes 补全图片路径
* @param $value
* @param $data
* @return string
* @author ljj
* @date 2022/2/17 6:11 下午
*/
public function getUriAttr($value,$data)
{
return FileService::getFileUrl($value);
}
/**
* @notes 补全图片路径
* @param $value
* @param $data
* @return string
* @author ljj
* @date 2022/2/17 6:11 下午
*/
public function setUriAttr($value,$data)
{
return FileService::setFileUrl($value);
}
}

View File

@@ -0,0 +1,345 @@
<?php
// +----------------------------------------------------------------------
// | likeshop100%开源免费商用商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | 商业版本务必购买商业授权,以免引起法律纠纷
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | gitee下载https://gitee.com/likeshop_gitee
// | github下载https://github.com/likeshop-github
// | 访问官网https://www.likeshop.cn
// | 访问社区https://home.likeshop.cn
// | 访问手册http://doc.likeshop.cn
// | 微信公众号likeshop技术社区
// | likeshop团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshopTeam
// +----------------------------------------------------------------------
namespace app\common\model\shop;
use app\common\enum\shop\ShopEnum;
use app\common\model\BaseModel;
use app\common\model\goods\Goods;
use app\common\model\Region;
use app\common\service\FileService;
/**
* 店铺模型类
* Class Shop
* @package app\common\model\shop
*/
class ShopUpdate extends BaseModel
{
public function goods()
{
return $this->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');
}
}

View File

@@ -0,0 +1,43 @@
<?php
namespace app\common\model\shop;
use app\common\model\BaseModel;
use app\common\service\FileService;
/**
* 店铺账号逻辑类
* Class ShopUser
* @package app\common\model\coach
*/
class ShopUser extends BaseModel
{
/**
* @notes 去掉图片路径
* @param $value
* @param $data
* @return string
* @author ljj
* @date 2022/2/17 6:11 下午
*/
public function setAvatarAttr($value,$data)
{
return FileService::setFileUrl($value);
}
/**
* @notes 补全图片路径
* @param $value
* @param $data
* @return string
* @author ljj
* @date 2022/2/17 6:11 下午
*/
public function getAvatarAttr($value,$data)
{
return FileService::getFileUrl($value);
}
}

View File

@@ -0,0 +1,28 @@
<?php
// +----------------------------------------------------------------------
// | likeshop开源商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | gitee下载https://gitee.com/likeshop_gitee
// | github下载https://github.com/likeshop-github
// | 访问官网https://www.likeshop.cn
// | 访问社区https://home.likeshop.cn
// | 访问手册http://doc.likeshop.cn
// | 微信公众号likeshop技术社区
// | likeshop系列产品在gitee、github等公开渠道开源版本可免费商用未经许可不能去除前后端官方版权标识
// | likeshop系列产品收费版本务必购买商业授权购买去版权授权后方可去除前后端官方版权标识
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | likeshop团队版权所有并拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshop.cn.team
// +----------------------------------------------------------------------
namespace app\common\model\shop;
use app\common\model\BaseModel;
class ShopUserSession extends BaseModel
{
}

View File

@@ -0,0 +1,36 @@
<?php
// +----------------------------------------------------------------------
// | likeshop100%开源免费商用商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | 商业版本务必购买商业授权,以免引起法律纠纷
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | gitee下载https://gitee.com/likeshop_gitee
// | github下载https://github.com/likeshop-github
// | 访问官网https://www.likeshop.cn
// | 访问社区https://home.likeshop.cn
// | 访问手册http://doc.likeshop.cn
// | 微信公众号likeshop技术社区
// | likeshop团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshopTeam
// +----------------------------------------------------------------------
namespace app\common\model\shop;
use app\common\model\BaseModel;
use think\model\concern\SoftDelete;
/**
* 首页访问浏览记录
* Class Visitor
* @package app\common\model
*/
class ShopVisit extends BaseModel
{
use SoftDelete;
protected $deleteTime = 'delete_time';
}