初始版本

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,55 @@
<?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;
use app\common\service\FileService;
use think\Model;
/**
* 基础模型
* Class BaseModel
* @package app\common\model
*/
class BaseModel extends Model
{
/**
* @notes 公共处理图片,补全路径
* @param $value
* @return string
* @author 张无忌
* @date 2021/9/10 11:02
*/
public function getImageAttr($value)
{
return trim($value) ? FileService::getFileUrl($value) : '';
}
/**
* @notes 公共图片处理,去除图片域名
* @param $value
* @return mixed|string
* @author 张无忌
* @date 2021/9/10 11:04
*/
public function setImageAttr($value)
{
return trim($value) ? FileService::setFileUrl($value) : '';
}
}

View File

@@ -0,0 +1,25 @@
<?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;
class Config extends BaseModel
{
}

View File

@@ -0,0 +1,79 @@
<?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;
use think\model\concern\SoftDelete;
class Crontab extends BaseModel
{
use SoftDelete;
protected $deleteTime = 'delete_time';
protected $name = 'dev_crontab';
/**
* @notes 类型获取器
* @param $value
* @return string
* @author Tab
* @date 2021/8/17 11:03
*/
public function getTypeDescAttr($value)
{
$desc = [
1 => '定时任务',
2 => '守护进程',
];
return $desc[$value] ?? '';
}
/**
* @notes 状态获取器
* @param $value
* @return string
* @author Tab
* @date 2021/8/17 11:04
*/
public function getStatusDescAttr($value)
{
$desc = [
1 => '运行',
2 => '停止',
3 => '错误',
];
return $desc[$value] ?? '';
}
/**
* @notes 最后执行时间获取器
* @param $value
* @return string
* @author Tab
* @date 2021/8/17 14:35
*/
public function getLastTimeAttr($value)
{
return empty($value) ? '' : date('Y-m-d H:i:s', $value);
}
}

View File

@@ -0,0 +1,20 @@
<?php
// +----------------------------------------------------------------------
// | likeadmin快速开发前后端分离管理后台PHP版
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | gitee下载https://gitee.com/likeshop_gitee/likeadmin
// | github下载https://github.com/likeshop-github/likeadmin
// | 访问官网https://www.likeadmin.cn
// | likeadmin团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeadminTeam
// +----------------------------------------------------------------------
namespace app\common\model;
class HotSearch extends BaseModel
{
}

View File

@@ -0,0 +1,35 @@
<?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;
use think\model\concern\SoftDelete;
/**
* 首页访问浏览记录
* Class Visitor
* @package app\common\model
*/
class IndexVisit extends BaseModel
{
use SoftDelete;
protected $deleteTime = 'delete_time';
}

View File

@@ -0,0 +1,43 @@
<?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;
use app\common\enum\MapKeyEnum;
use think\model\concern\SoftDelete;
class MapKey extends BaseModel
{
use SoftDelete;
protected $deleteTime = 'delete_time';
/**
* @notes 类型
* @param $value
* @param $data
* @return string|string[]
* @author ljj
* @date 2024/11/5 下午2:33
*/
public function getTypeDescAttr($value,$data)
{
return MapKeyEnum::getTypeDesc($data['type']);
}
}

View File

@@ -0,0 +1,35 @@
<?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;
use think\model\concern\SoftDelete;
/**
* 通知记录模型
* Class Notice
* @package app\common\model
*/
class Notice extends BaseModel
{
use SoftDelete;
protected $deleteTime = 'delete_time';
}

View File

@@ -0,0 +1,10 @@
<?php
namespace app\common\model;
class OperationLog extends BaseModel
{
}

View File

@@ -0,0 +1,71 @@
<?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;
use app\common\enum\PayEnum;
use app\common\model\BaseModel;
use think\model\concern\SoftDelete;
class RechargeOrder extends BaseModel
{
use SoftDelete;
protected $deleteTime = 'delete_time';
/**
* @notes 支付方式
* @param $value
* @param $data
* @return string|string[]
* @author ljj
* @date 2022/12/2 6:25 下午
*/
public function getPayWayDescAttr($value,$data)
{
return PayEnum::getPayTypeDesc($data['pay_way']);
}
/**
* @notes 支付状态
* @param $value
* @param $data
* @return string|string[]
* @author ljj
* @date 2022/12/2 6:26 下午
*/
public function getPayStatusDescAttr($value,$data)
{
return PayEnum::getPayStatusDesc($data['pay_status']);
}
/**
* @notes 支付时间
* @param $value
* @param $data
* @return false|string
* @author ljj
* @date 2022/12/2 6:47 下午
*/
public function getPayTimeAttr($value,$data)
{
return empty($value) ? '' : date('Y-m-d H:i:s',$value);
}
}

View File

@@ -0,0 +1,26 @@
<?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;
class Region extends BaseModel
{
protected $name = 'dev_region';
}

View File

@@ -0,0 +1,26 @@
<?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;
class SmsLog extends BaseModel
{
}

View File

@@ -0,0 +1,29 @@
<?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;
/**
* 文本列表模型类
* Class TextList
* @package app\common\model
*/
class TextList extends BaseModel
{
}

View File

@@ -0,0 +1,62 @@
<?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\accountLog;
use app\common\enum\accountLog\AccountLogEnum;
use app\common\model\BaseModel;
use app\common\model\user\User;
use think\model\concern\SoftDelete;
class AccountLog extends BaseModel
{
use SoftDelete;
protected $deleteTime = 'delete_time';
/**
* @notes 关联用户模型
* @return \think\model\relation\HasOne
* @author ljj
* @date 2022/9/29 6:41 下午
*/
public function user()
{
return $this->hasOne(User::class,'id','user_id')
->field('id,sn,nickname,avatar,mobile');
}
/**
* @notes 变动类型
* @param $value
* @param $data
* @return string|string[]
* @author ljj
* @date 2022/5/31 4:45 下午
*/
public function getChangeTypeDescAttr($value,$data)
{
return AccountLogEnum::getChangeTypeDesc($data['change_type']);
}
}

View File

@@ -0,0 +1,92 @@
<?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\accountLog;
use app\common\enum\accountLog\AccountLogEnum;
use app\common\enum\accountLog\CoachAccountLogEnum;
use app\common\model\BaseModel;
use app\common\model\coach\Coach;
use app\common\model\user\User;
use think\model\concern\SoftDelete;
class CoachAccountLog extends BaseModel
{
use SoftDelete;
protected $deleteTime = 'delete_time';
/**
* @notes 变动类型
* @param $value
* @param $data
* @return string|string[]
* @author ljj
* @date 2022/5/31 4:45 下午
*/
public function getChangeTypeDescAttr($value,$data)
{
return CoachAccountLogEnum::getChangeTypeDesc($data['change_type']);
}
/**
* @param $coachId (技师ID
* @param $changeType (变动类型
* @param $action (操作动作: [1=新增, 2=扣减])
* @param $changeAmount (变动的值
* @param string $sourceSn (来源编号)
* @param string $remark (备注信息)
* @param array $extra (扩展信息)
* @param int $adminId (管理员ID)
* @param array $flowUsage (token信息组)
* @return CoachAccountLog|false|Model
*/
public static function add($caochId, $changeObject,$changeType, $action, $changeAmount, string $sourceSn = '', int $adminId = 0, string $remark = '', array $extra = []): bool|Model|CoachAccountLog
{
// 取用户信息
$coach = (new Coach())->findOrEmpty($caochId);
if ($coach->isEmpty()) {
return false;
}
$leftAmount = $coach->money;
if(CoachAccountLogEnum::DEPOSIT == $changeObject){
$leftAmount = $coach->deposit;
}
$data = [
'sn' => generate_sn((new CoachAccountLog()), 'sn', 20),
'coach_id' => $caochId,
'change_object' => $changeObject,
'change_type' => $changeType,
'action' => $action,
'left_amount' => $leftAmount,
'change_amount' => $changeAmount,
'source_sn' => $sourceSn,
'remark' => $remark,
'extra' => $extra ? json_encode($extra, JSON_UNESCAPED_UNICODE) : '',
'admin_id' => $adminId
];
return CoachAccountLog::create($data);
}
}

View File

@@ -0,0 +1,94 @@
<?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\accountLog;
use app\common\enum\accountLog\AccountLogEnum;
use app\common\enum\accountLog\CoachAccountLogEnum;
use app\common\enum\accountLog\ShopAccountLogEnum;
use app\common\model\BaseModel;
use app\common\model\coach\Coach;
use app\common\model\shop\Shop;
use app\common\model\user\User;
use think\model\concern\SoftDelete;
class ShopAccountLog extends BaseModel
{
use SoftDelete;
protected $deleteTime = 'delete_time';
/**
* @notes 变动类型
* @param $value
* @param $data
* @return string|string[]
* @author ljj
* @date 2022/5/31 4:45 下午
*/
public function getChangeTypeDescAttr($value,$data)
{
return ShopAccountLogEnum::getChangeTypeDesc($data['change_type']);
}
/**
* @param $shopId (店铺ID
* @param $changeType (变动类型
* @param $action (操作动作: [1=新增, 2=扣减])
* @param $changeAmount (变动的值
* @param string $sourceSn (来源编号)
* @param string $remark (备注信息)
* @param array $extra (扩展信息)
* @param int $adminId (管理员ID)
* @param array $flowUsage (token信息组)
* @return CoachAccountLog|false|Model
*/
public static function add($shopId, $changeObject,$changeType, $action, $changeAmount, string $sourceSn = '', int $adminId = 0, string $remark = '', array $extra = []): bool|Model|ShopAccountLog
{
// 取用户信息
$shop = (new Shop())->findOrEmpty($shopId);
if ($shop->isEmpty()) {
return false;
}
$leftAmount = $shop->money;
if(ShopAccountLogEnum::DEPOSIT == $changeObject){
$leftAmount = $shop->deposit;
}
$data = [
'sn' => generate_sn((new ShopAccountLog()), 'sn', 20),
'shop_id' => $shopId,
'change_object' => $changeObject,
'change_type' => $changeType,
'action' => $action,
'left_amount' => $leftAmount,
'change_amount' => $changeAmount,
'source_sn' => $sourceSn,
'remark' => $remark,
'extra' => $extra ? json_encode($extra, JSON_UNESCAPED_UNICODE) : '',
'admin_id' => $adminId
];
return ShopAccountLog::create($data);
}
}

View File

@@ -0,0 +1,70 @@
<?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\ad;
use app\common\enum\AdEnum;
use app\common\enum\MenuEnum;
use app\common\model\BaseModel;
use app\common\model\goods\Goods;
use app\common\model\goods\GoodsCategory;
use think\model\concern\SoftDelete;
class Ad extends BaseModel
{
use SoftDelete;
protected $deleteTime = 'delete_time';
/**
* @notes 链接地址
* @param $value
* @param $data
* @return string|string[]
* @author ljj
* @date 2022/2/14 6:25 下午
*/
public function getLinkAddressDescAttr($value,$data)
{
$address = AdEnum::getLinkDesc($data['link_type']);
if ($data['link_type'] == AdEnum::LINK_CUSTOM) {
$address = $address.':'.$data['link_address'];
}elseif ($data['link_type'] == AdEnum::LINK_SHOP) {
$shop_page = array_column(MenuEnum::SHOP_PAGE,NULL,'index');
$address = $address.':'.$shop_page[$data['link_address']]['name'];
}elseif ($data['link_type'] == AdEnum::LINK_GOODS) {
$goods_name = GoodsCategory::where('id',$data['link_address'])->value('name');
$address = $address.':'.$goods_name;
}
return $address;
}
/**
* @notes 广告位名称
* @param $value
* @param $data
* @return mixed
* @author ljj
* @date 2022/2/14 6:37 下午
*/
public function getApNameAttr($value,$data)
{
return AdPosition::where('id',$data['pid'])->value('name');
}
}

View File

@@ -0,0 +1,58 @@
<?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\ad;
use app\common\enum\DefaultEnum;
use app\common\model\BaseModel;
use think\model\concern\SoftDelete;
class AdPosition extends BaseModel
{
use SoftDelete;
protected $deleteTime = 'delete_time';
/**
* @notes 状态
* @param $value
* @param $data
* @return string|string[]
* @author ljj
* @date 2022/2/14 4:38 下午
*/
public function getStatusDescAttr($value,$data)
{
return DefaultEnum::getEnableDesc($data['status']);
}
/**
* @notes 属性
* @param $value
* @param $data
* @return string|string[]
* @author ljj
* @date 2022/2/14 4:42 下午
*/
public function getAttrDescAttr($value,$data)
{
return DefaultEnum::getAttrDesc($data['attr']);
}
}

View File

@@ -0,0 +1,85 @@
<?php
// +----------------------------------------------------------------------
// | likeadmin快速开发前后端分离管理后台PHP版
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | gitee下载https://gitee.com/likeshop_gitee/likeadmin
// | github下载https://github.com/likeshop-github/likeadmin
// | 访问官网https://www.likeadmin.cn
// | likeadmin团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeadminTeam
// +----------------------------------------------------------------------
namespace app\common\model\article;
use app\common\model\BaseModel;
use think\model\concern\SoftDelete;
/**
* 资讯管理模型
* Class Article
* @package app\common\model\article;
*/
class Article extends BaseModel
{
use SoftDelete;
protected $deleteTime = 'delete_time';
/**
* @notes 获取分类名称
* @param $value
* @param $data
* @return string
* @author heshihu
* @date 2022/2/22 9:53
*/
public function getCateNameAttr($value, $data)
{
return ArticleCate::where('id', $data['cid'])->value('name');
}
/**
* @notes 浏览量
* @param $value
* @param $data
* @return mixed
* @author 段誉
* @date 2022/9/15 11:33
*/
public function getClickAttr($value, $data)
{
return $data['click_actual'] + $data['click_virtual'];
}
/**
* @notes 设置图片域名
* @param $value
* @param $data
* @return array|string|string[]|null
* @author 段誉
* @date 2022/9/28 10:17
*/
public function getContentAttr($value, $data)
{
return get_file_domain($value);
}
/**
* @notes 清除图片域名
* @param $value
* @param $data
* @return array|string|string[]
* @author 段誉
* @date 2022/9/28 10:17
*/
public function setContentAttr($value, $data)
{
return clear_file_domain($value);
}
}

View File

@@ -0,0 +1,62 @@
<?php
// +----------------------------------------------------------------------
// | likeadmin快速开发前后端分离管理后台PHP版
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | gitee下载https://gitee.com/likeshop_gitee/likeadmin
// | github下载https://github.com/likeshop-github/likeadmin
// | 访问官网https://www.likeadmin.cn
// | likeadmin团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeadminTeam
// +----------------------------------------------------------------------
namespace app\common\model\article;
use app\common\model\BaseModel;
use think\model\concern\SoftDelete;
/**
* 资讯分类管理模型
* Class ArticleCate
* @package app\common\model\article;
*/
class ArticleCate extends BaseModel
{
use SoftDelete;
protected $deleteTime = 'delete_time';
/**
* @notes 状态描述
* @param $value
* @param $data
* @return string
* @author 段誉
* @date 2022/9/15 11:25
*/
public function getIsShowDescAttr($value, $data)
{
return $data['is_show'] ? '启用' : '停用';
}
/**
* @notes 文章数量
* @param $value
* @param $data
* @return int
* @author 段誉
* @date 2022/9/15 11:32
*/
public function getArticleCountAttr($value, $data)
{
return Article::where(['cid' => $data['id']])->count('id');
}
}

View File

@@ -0,0 +1,34 @@
<?php
// +----------------------------------------------------------------------
// | likeadmin快速开发前后端分离管理后台PHP版
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | gitee下载https://gitee.com/likeshop_gitee/likeadmin
// | github下载https://github.com/likeshop-github/likeadmin
// | 访问官网https://www.likeadmin.cn
// | likeadmin团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeadminTeam
// +----------------------------------------------------------------------
namespace app\common\model\article;
use app\common\model\BaseModel;
use think\model\concern\SoftDelete;
/**
* 资讯收藏
* Class ArticleCollect
* @package app\common\model\article
*/
class ArticleCollect extends BaseModel
{
use SoftDelete;
protected $deleteTime = 'delete_time';
}

View File

@@ -0,0 +1,103 @@
<?php
// +----------------------------------------------------------------------
// | likeadmin快速开发前后端分离管理后台PHP版
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | gitee下载https://gitee.com/likeshop_gitee/likeadmin
// | github下载https://github.com/likeshop-github/likeadmin
// | 访问官网https://www.likeadmin.cn
// | likeadmin团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeadminTeam
// +----------------------------------------------------------------------
namespace app\common\model\auth;
use app\common\enum\YesNoEnum;
use app\common\model\BaseModel;
use app\common\model\dept\Dept;
use think\model\concern\SoftDelete;
use app\common\service\FileService;
class Admin extends BaseModel
{
use SoftDelete;
protected $deleteTime = 'delete_time';
/**
* @notes 关联角色模型
* @date 2021/6/30 17:48
* @return \think\model\relation\HasOne
* @author lr
*/
public function role()
{
return $this->hasOne(SystemRole::class, 'id', 'role_id')
->field('id,name');
}
/**
* @notes 关联部门
* @return \think\model\relation\HasOne
* @author 段誉
* @date 2022/5/26 11:11
*/
public function dept()
{
return $this->hasOne(Dept::class, 'id', 'dept_id')->bind(['dept_name' => 'name']);
}
/**
* @notes 角色菜单关联
* @return \think\model\relation\HasMany
* @author 段誉
* @date 2022/7/7 12:04
*/
public function roleMenu()
{
return $this->hasMany(SystemRoleMenu::class,'role_id','role_id');
}
/**
* @notes 获取禁用状态
* @param $value
* @param $data
* @return string|string[]
* @author 令狐冲
* @date 2021/7/7 01:25
*/
public function getDisableDescAttr($value, $data)
{
return YesNoEnum::getDisableDesc($data['disable']);
}
/**
* @notes 最后登录时间获取器 - 格式化:年-月-日 时:分:秒
* @param $value
* @return string
* @author Tab
* @date 2021/7/13 11:35
*/
public function getLoginTimeAttr($value)
{
return empty($value) ? '' : date('Y-m-d H:i:s', $value);
}
/**
* @notes 头像获取器 - 头像路径添加域名
* @param $value
* @return string
* @author Tab
* @date 2021/7/13 11:35
*/
public function getAvatarAttr($value)
{
return empty($value) ? FileService::getFileUrl(config('project.default_image.admin_avatar')) : FileService::getFileUrl(trim($value, '/'));
}
}

View File

@@ -0,0 +1,32 @@
<?php
// +----------------------------------------------------------------------
// | likeadmin快速开发前后端分离管理后台PHP版
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | gitee下载https://gitee.com/likeshop_gitee/likeadmin
// | github下载https://github.com/likeshop-github/likeadmin
// | 访问官网https://www.likeadmin.cn
// | likeadmin团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeadminTeam
// +----------------------------------------------------------------------
namespace app\common\model\auth;
use app\common\model\BaseModel;
class AdminSession extends BaseModel
{
/**
* @notes 关联管理员表
* @return \think\model\relation\HasOne
* @author 令狐冲
* @date 2021/7/5 14:39
*/
public function admin()
{
return $this->hasOne(Admin::class, 'id', 'admin_id')
->field('id,multipoint_login');
}
}

View File

@@ -0,0 +1,42 @@
<?php
// +----------------------------------------------------------------------
// | likeadmin快速开发前后端分离管理后台PHP版
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | gitee下载https://gitee.com/likeshop_gitee/likeadmin
// | github下载https://github.com/likeshop-github/likeadmin
// | 访问官网https://www.likeadmin.cn
// | likeadmin团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeadminTeam
// +----------------------------------------------------------------------
namespace app\common\model\auth;
use app\common\model\BaseModel;
use think\model\concern\SoftDelete;
/**
* 角色模型
* Class Role
* @package app\common\model
*/
class Role extends BaseModel
{
use SoftDelete;
protected $deleteTime = 'delete_time';
/**
* @notes 角色与菜单关联关系
* @return \think\model\relation\HasMany
* @author 段誉
* @date 2022/7/6 11:16
*/
public function roleMenuIndex()
{
return $this->hasMany(SystemRoleMenu::class, 'role_id');
}
}

View File

@@ -0,0 +1,28 @@
<?php
// +----------------------------------------------------------------------
// | likeadmin快速开发前后端分离管理后台PHP版
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | gitee下载https://gitee.com/likeshop_gitee/likeadmin
// | github下载https://github.com/likeshop-github/likeadmin
// | 访问官网https://www.likeadmin.cn
// | likeadmin团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeadminTeam
// +----------------------------------------------------------------------
namespace app\common\model\auth;
use app\common\model\BaseModel;
/**
* 角色与权限关系模型
* Class DevAuthRoleIndex
* @package app\common\model
*/
class RoleAuthIndex extends BaseModel
{
}

View File

@@ -0,0 +1,31 @@
<?php
// +----------------------------------------------------------------------
// | likeadmin快速开发前后端分离管理后台PHP版
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | gitee下载https://gitee.com/likeshop_gitee/likeadmin
// | github下载https://github.com/likeshop-github/likeadmin
// | 访问官网https://www.likeadmin.cn
// | likeadmin团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeadminTeam
// +----------------------------------------------------------------------
namespace app\common\model\auth;
use app\common\model\BaseModel;
/**
* 系统菜单
* Class SystemMenu
* @package app\common\model\auth
*/
class SystemMenu extends BaseModel
{
}

View File

@@ -0,0 +1,43 @@
<?php
// +----------------------------------------------------------------------
// | likeadmin快速开发前后端分离管理后台PHP版
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | gitee下载https://gitee.com/likeshop_gitee/likeadmin
// | github下载https://github.com/likeshop-github/likeadmin
// | 访问官网https://www.likeadmin.cn
// | likeadmin团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeadminTeam
// +----------------------------------------------------------------------
namespace app\common\model\auth;
use app\common\model\BaseModel;
use think\model\concern\SoftDelete;
/**
* 角色模型
* Class Role
* @package app\common\model
*/
class SystemRole extends BaseModel
{
use SoftDelete;
protected $deleteTime = 'delete_time';
protected $name = 'system_role';
/**
* @notes 角色与菜单关联关系
* @return \think\model\relation\HasMany
* @author 段誉
* @date 2022/7/6 11:16
*/
public function roleMenuIndex()
{
return $this->hasMany(SystemRoleMenu::class, 'role_id');
}
}

View File

@@ -0,0 +1,30 @@
<?php
// +----------------------------------------------------------------------
// | likeadmin快速开发前后端分离管理后台PHP版
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | gitee下载https://gitee.com/likeshop_gitee/likeadmin
// | github下载https://github.com/likeshop-github/likeadmin
// | 访问官网https://www.likeadmin.cn
// | likeadmin团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeadminTeam
// +----------------------------------------------------------------------
namespace app\common\model\auth;
use app\common\model\BaseModel;
/**
* 角色与菜单权限关系
* Class SystemRoleMenu
* @package app\common\model\auth
*/
class SystemRoleMenu extends BaseModel
{
}

View File

@@ -0,0 +1,28 @@
<?php
// +----------------------------------------------------------------------
// | likeadmin快速开发前后端分离管理后台PHP版
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | gitee下载https://gitee.com/likeshop_gitee/likeadmin
// | github下载https://github.com/likeshop-github/likeadmin
// | 访问官网https://www.likeadmin.cn
// | likeadmin团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeadminTeam
// +----------------------------------------------------------------------
namespace app\common\model\channel;
use app\common\model\BaseModel;
/**
* 微信公众号回复
* Class OfficialAccountReply
* @package app\common\model\channel
*/
class OfficialAccountReply extends BaseModel
{
}

View File

@@ -0,0 +1,29 @@
<?php
namespace app\common\model\city;
use app\common\model\BaseModel;
use think\model\concern\SoftDelete;
/**
* 城市关联类
* Class City
* @package app\common\model\city
*/
class City extends BaseModel
{
use SoftDelete;
protected $deleteTime = 'delete_time';
/**
* @notes 将距离转成km格式显示
* @param $value
* @param $data
* @return string
* @author cjhao
* @date 2024/9/3 22:56
*/
public function getDistanceDescAttr($value,$data){
return round($data['distance'],2).'km';
}
}

View File

@@ -0,0 +1,349 @@
<?php
namespace app\common\model\coach;
use app\common\enum\coach\CoachEnum;
use app\common\model\BaseModel;
use app\common\model\Region;
use app\common\model\skill\Skill;
use app\common\service\FileService;
use think\model\concern\SoftDelete;
/**
* 技师模型类
* Class Coach
* @package app\common\model\coach
*/
class Coach extends BaseModel
{
use SoftDelete;
protected $deleteTime = 'delete_time';
protected $json = ['location'];
// 设置JSON数据返回数组
protected $jsonAssoc = true;
public function lifePhoto()
{
return $this->hasMany(CoachLifePhoto::class,'coach_id')->field('uri,coach_id');
}
public function goodsIds()
{
return $this->hasMany(CoachGoodsIndex::class,'coach_id')->field('goods_id,coach_id');
}
public function goods()
{
return $this->hasMany(CoachGoodsIndex::class,'coach_id');
}
/**
* @notes 获取工作状态
* @param $value
* @param $data
* @return string|string[]
* @author cjhao
* @date 2024/8/21 17:48
*/
public function getWorkStatusDescAttr($value,$data){
return CoachEnum::getWorkStatusDesc($data['work_status']);
}
public function getServerStatusDescAttr($value,$data){
return CoachEnum::getServerStatusDesc($data['server_status']);
}
/**
* @notes 将距离转成km格式显示
* @param $value
* @param $data
* @return string
* @author cjhao
* @date 2024/9/3 22:56
*/
public function getDistanceDescAttr($value,$data){
return round($data['distance'],2).'km';
}
/**
* @notes 获取审核状态
* @param $value
* @param $data
* @return string|string[]
* @author cjhao
* @date 2024/8/21 17:48
*/
public function getAuditStatusDescAttr($value,$data){
return CoachEnum::getAuditStatusDesc($data['audit_status']);
}
// public function getWorkInfoAttr($value,$data)
// {
// return [
// 'take_order' => 22,
// 'total_order' => 22,
// ];
// }
/**
* @notes 补全图片路径
* @param $value
* @param $data
* @return string
* @author ljj
* @date 2022/2/17 6:11 下午
*/
public function getIdCardFrontAttr($value,$data)
{
return FileService::getFileUrl($value);
}
/**
* @notes 去掉图片路径
* @param $value
* @param $data
* @return string
* @author ljj
* @date 2022/2/17 6:11 下午
*/
public function setIdCardFrontAttr($value,$data)
{
return FileService::setFileUrl($value);
}
/**
* @notes 补全图片路径
* @param $value
* @param $data
* @return string
* @author ljj
* @date 2022/2/17 6:11 下午
*/
public function getIdCardBackAttr($value,$data)
{
return FileService::getFileUrl($value);
}
/**
* @notes 去掉图片路径
* @param $value
* @param $data
* @return string
* @author ljj
* @date 2022/2/17 6:11 下午
*/
public function setIdCardBackAttr($value,$data)
{
return FileService::setFileUrl($value);
}
/**
* @notes 补全图片路径
* @param $value
* @param $data
* @return string
* @author ljj
* @date 2022/2/17 6:11 下午
*/
public function getPortraitShootingAttr($value,$data)
{
return FileService::getFileUrl($value);
}
/**
* @notes 去掉图片路径
* @param $value
* @param $data
* @return string
* @author ljj
* @date 2022/2/17 6:11 下午
*/
public function setPortraitShootingAttr($value,$data)
{
return FileService::setFileUrl($value);
}
/**
* @notes 补全图片路径
* @param $value
* @param $data
* @return string
* @author ljj
* @date 2022/2/17 6:11 下午
*/
public function getWorkPhotoAttr($value,$data)
{
return FileService::getFileUrl($value);
}
/**
* @notes 去掉图片路径
* @param $value
* @param $data
* @return string
* @author ljj
* @date 2022/2/17 6:11 下午
*/
public function setWorkPhotoAttr($value,$data)
{
return FileService::setFileUrl($value);
}
/**
* @notes 补全图片路径
* @param $value
* @param $data
* @return string
* @author ljj
* @date 2022/2/17 6:11 下午
*/
public function getCertificationAttr($value,$data)
{
return FileService::getFileUrl($value);
}
/**
* @notes 去掉图片路径
* @param $value
* @param $data
* @return string
* @author ljj
* @date 2022/2/17 6:11 下午
*/
public function setCertificationAttr($value,$data)
{
return FileService::setFileUrl($value);
}
/**
* @notes 补全图片路径
* @param $value
* @param $data
* @return string
* @author ljj
* @date 2022/2/17 6:11 下午
*/
public function getHealthCertificateAttr($value,$data)
{
return FileService::getFileUrl($value);
}
/**
* @notes 去掉图片路径
* @param $value
* @param $data
* @return string
* @author ljj
* @date 2022/2/17 6:11 下午
*/
public function setHealthCertificateAttr($value,$data)
{
return FileService::setFileUrl($value);
}
/**
* @notes 获取技能名称
* @param $value
* @param $data
* @return void
* @author cjhao
* @date 2024/8/26 12:49
*/
public function getSkillDescAttr($value,$data)
{
return Skill::where(['id'=>$data['skill_id']])->value('name');
}
/**
* @notes 获取地区
* @param $value
* @param $data
* @return string
* @author cjhao
* @date 2024/8/26 12:52
*/
public function getRegionDescAttr($value,$data)
{
if($data){
$lists = Region::where(['id'=>[$data['province_id'],$data['city_id'],$data['region_id']]])->column('name');
return implode('',$lists);
}
return '';
}
/**
* @notes 获取地区
* @param $value
* @param $data
* @return string
* @author cjhao
* @date 2024/8/26 12:52
*/
public function getRegionNameAttr($value,$data)
{
if($data){
return Region::where(['id'=>$data['region_id']])->value('name');
}
return '';
}
/**
* @notes 省份id
* @param $value
* @param $data
* @return mixed
* @author cjhao
* @date 2024/11/26 14:47
*/
public function getProvinceNameAttr($value,$data)
{
if($data){
return Region::where(['id'=>$data['province_id']])->value('name');
}
return '';
}
/**
* @notes 省份id
* @param $value
* @param $data
* @return mixed
* @author cjhao
* @date 2024/11/26 14:47
*/
public function getCityNameAttr($value,$data)
{
if($data){
return Region::where(['id'=>$data['city_id']])->value('name');
}
return '';
}
/**
* @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,13 @@
<?php
namespace app\common\model\coach;
use app\common\model\BaseModel;
/**
* 技师服务关联模型类
* Class CoachGoodsIndex
* @package app\common\model\coach
*/
class CoachGoodsIndex extends BaseModel
{
}

View File

@@ -0,0 +1,39 @@
<?php
namespace app\common\model\coach;
use app\common\model\BaseModel;
use app\common\service\FileService;
/**
* 技师生活照模型类
* Class CoachLifePhoto
* @package app\common\model\coach
*/
class CoachLifePhoto 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,15 @@
<?php
namespace app\common\model\coach;
use app\common\model\BaseModel;
use app\common\service\FileService;
/**
* 技师服务时间
* Class UserCoach
* @package app\common\model\coach
*/
class CoachServerTime extends BaseModel
{
}

View File

@@ -0,0 +1,336 @@
<?php
namespace app\common\model\coach;
use app\common\enum\coach\CoachEnum;
use app\common\model\BaseModel;
use app\common\model\goods\Goods;
use app\common\model\Region;
use app\common\model\skill\Skill;
use app\common\service\FileService;
/**
* 技师更新模型类
* Class CoachUpdate
* @package app\common\model\coach
*/
class CoachUpdate extends BaseModel
{
/**
* @notes 获取生活照
* @param $value
* @param $data
* @return string[]
* @author cjhao
* @date 2024/8/28 10:43
*/
public function getLifePhotoAttr($value,$data)
{
$lists = explode(',',$value);
foreach ($lists as $key => $photo){
$lists[$key] = FileService::getFileUrl($photo);
}
return $lists;
}
/**
* @notes 获取服务ids
* @param $value
* @param $data
* @return string[]
* @author cjhao
* @date 2024/8/28 11:38
*/
public function getGoodsIdsAttr($value,$data){
return explode(',',$value);
}
/**
* @notes
* @param $value
* @param $data
* @return array
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
* @author cjhao
* @date 2024/8/28 10:50
*/
public function getGoodsListsAttr($value,$data){
$goodsLists = Goods::where(['id'=>explode(',',$data['goods_ids'])])
->field('id,name,image')
->select()
->toArray();
return $goodsLists;
}
/**
* @notes 获取工作状态
* @param $value
* @param $data
* @return string|string[]
* @author cjhao
* @date 2024/8/21 17:48
*/
public function getWorkStatusDescAttr($value,$data){
return CoachEnum::getWorkStatusDesc($data['work_status']);
}
/**
* @notes 获取审核状态
* @param $value
* @param $data
* @return string|string[]
* @author cjhao
* @date 2024/8/21 17:48
*/
public function getAuditStatusDescAttr($value,$data){
return CoachEnum::getAuditStatusDesc($data['audit_status']);
}
public function getWorkInfoAttr($value,$data)
{
return [
'take_order' => 22,
'total_order' => 22,
];
}
/**
* @notes 补全图片路径
* @param $value
* @param $data
* @return string
* @author ljj
* @date 2022/2/17 6:11 下午
*/
public function getIdCardFrontAttr($value,$data)
{
return FileService::getFileUrl($value);
}
/**
* @notes 去掉图片路径
* @param $value
* @param $data
* @return string
* @author ljj
* @date 2022/2/17 6:11 下午
*/
public function setIdCardFrontAttr($value,$data)
{
return FileService::setFileUrl($value);
}
/**
* @notes 补全图片路径
* @param $value
* @param $data
* @return string
* @author ljj
* @date 2022/2/17 6:11 下午
*/
public function getIdCardBackAttr($value,$data)
{
return FileService::getFileUrl($value);
}
/**
* @notes 去掉图片路径
* @param $value
* @param $data
* @return string
* @author ljj
* @date 2022/2/17 6:11 下午
*/
public function setIdCardBackAttr($value,$data)
{
return FileService::setFileUrl($value);
}
/**
* @notes 补全图片路径
* @param $value
* @param $data
* @return string
* @author ljj
* @date 2022/2/17 6:11 下午
*/
public function getPortraitShootingAttr($value,$data)
{
return FileService::getFileUrl($value);
}
/**
* @notes 去掉图片路径
* @param $value
* @param $data
* @return string
* @author ljj
* @date 2022/2/17 6:11 下午
*/
public function setPortraitShootingAttr($value,$data)
{
return FileService::setFileUrl($value);
}
/**
* @notes 补全图片路径
* @param $value
* @param $data
* @return string
* @author ljj
* @date 2022/2/17 6:11 下午
*/
public function getWorkPhotoAttr($value,$data)
{
return FileService::getFileUrl($value);
}
/**
* @notes 去掉图片路径
* @param $value
* @param $data
* @return string
* @author ljj
* @date 2022/2/17 6:11 下午
*/
public function setWorkPhotoAttr($value,$data)
{
return FileService::setFileUrl($value);
}
/**
* @notes 补全图片路径
* @param $value
* @param $data
* @return string
* @author ljj
* @date 2022/2/17 6:11 下午
*/
public function getCertificationAttr($value,$data)
{
return FileService::getFileUrl($value);
}
/**
* @notes 去掉图片路径
* @param $value
* @param $data
* @return string
* @author ljj
* @date 2022/2/17 6:11 下午
*/
public function setCertificationAttr($value,$data)
{
return FileService::setFileUrl($value);
}
/**
* @notes 补全图片路径
* @param $value
* @param $data
* @return string
* @author ljj
* @date 2022/2/17 6:11 下午
*/
public function getHealthCertificateAttr($value,$data)
{
return FileService::getFileUrl($value);
}
/**
* @notes 去掉图片路径
* @param $value
* @param $data
* @return string
* @author ljj
* @date 2022/2/17 6:11 下午
*/
public function setHealthCertificateAttr($value,$data)
{
return FileService::setFileUrl($value);
}
/**
* @notes 获取技能名称
* @param $value
* @param $data
* @return void
* @author cjhao
* @date 2024/8/26 12:49
*/
public function getSkillDescAttr($value,$data)
{
return Skill::where(['id'=>$data['skill_id']])->value('name');
}
/**
* @notes 获取地区
* @param $value
* @param $data
* @return string
* @author cjhao
* @date 2024/8/26 12:52
*/
public function getRegionDescAttr($value,$data)
{
$regionLists = Region::where(['id'=>[$data['province_id'],$data['city_id'],$data['region_id']]])->column('name');
return implode('',$regionLists);
}
/**
* @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\coach;
use app\common\model\BaseModel;
use app\common\service\FileService;
/**
* 技师账号逻辑类
* Class UserCoach
* @package app\common\model\coach
*/
class CoachUser 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\coach;
use app\common\model\BaseModel;
class CoachUserSession extends BaseModel
{
}

View File

@@ -0,0 +1,16 @@
<?php
namespace app\common\model\coach;
use app\common\model\BaseModel;
use app\common\service\FileService;
/**
* 技师收藏模型类
* Class CoachCollect
* @package app\common\model\coach
*/
class Collect extends BaseModel
{
}

View File

@@ -0,0 +1,28 @@
<?php
// +----------------------------------------------------------------------
// | likeadmin快速开发前后端分离管理后台PHP版
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | gitee下载https://gitee.com/likeshop_gitee/likeadmin
// | github下载https://github.com/likeshop-github/likeadmin
// | 访问官网https://www.likeadmin.cn
// | likeadmin团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeadminTeam
// +----------------------------------------------------------------------
namespace app\common\model\decorate;
use app\common\model\BaseModel;
/**
* 装修配置-页面
* Class DecorateTabbar
* @package app\common\model\decorate
*/
class DecoratePage extends BaseModel
{
}

View File

@@ -0,0 +1,28 @@
<?php
// +----------------------------------------------------------------------
// | likeadmin快速开发前后端分离管理后台PHP版
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | gitee下载https://gitee.com/likeshop_gitee/likeadmin
// | github下载https://github.com/likeshop-github/likeadmin
// | 访问官网https://www.likeadmin.cn
// | likeadmin团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeadminTeam
// +----------------------------------------------------------------------
namespace app\common\model\decorate;
use app\common\model\BaseModel;
/**
* 装修风格-页面
* Class DecorateStyle
* @package app\common\model\decorate
*/
class DecorateStyle extends BaseModel
{
}

View File

@@ -0,0 +1,63 @@
<?php
// +----------------------------------------------------------------------
// | likeadmin快速开发前后端分离管理后台PHP版
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | gitee下载https://gitee.com/likeshop_gitee/likeadmin
// | github下载https://github.com/likeshop-github/likeadmin
// | 访问官网https://www.likeadmin.cn
// | likeadmin团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeadminTeam
// +----------------------------------------------------------------------
namespace app\common\model\decorate;
use app\common\model\BaseModel;
use app\common\service\FileService;
/**
* 装修配置-底部导航
* Class DecorateTabbar
* @package app\common\model\decorate
*/
class DecorateTabbar extends BaseModel
{
// 设置json类型字段
protected $json = ['link'];
// 设置JSON数据返回数组
protected $jsonAssoc = true;
/**
* @notes 获取底部导航列表
* @return array
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
* @author 段誉
* @date 2022/9/23 12:07
*/
public static function getTabbarLists($source)
{
$tabbar = self::where(['source'=>$source])->select()->toArray();
if (empty($tabbar)) {
return $tabbar;
}
foreach ($tabbar as &$item) {
if (!empty($item['selected'])) {
$item['selected'] = FileService::getFileUrl($item['selected']);
}
if (!empty($item['unselected'])) {
$item['unselected'] = FileService::getFileUrl($item['unselected']);
}
}
return $tabbar;
}
}

View File

@@ -0,0 +1,13 @@
<?php
namespace app\common\model\deposit;
use app\common\model\BaseModel;
/**
* 保证金订单模型类
* Class CoachGoodsIndex
* @package app\common\model\coach
*/
class DepositOrder extends BaseModel
{
}

View File

@@ -0,0 +1,13 @@
<?php
namespace app\common\model\deposit;
use app\common\model\BaseModel;
/**
* 保证金套餐模型类
* Class CoachGoodsIndex
* @package app\common\model\coach
*/
class DepositPackage extends BaseModel
{
}

View File

@@ -0,0 +1,47 @@
<?php
// +----------------------------------------------------------------------
// | likeadmin快速开发前后端分离管理后台PHP版
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | gitee下载https://gitee.com/likeshop_gitee/likeadmin
// | github下载https://github.com/likeshop-github/likeadmin
// | 访问官网https://www.likeadmin.cn
// | likeadmin团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeadminTeam
// +----------------------------------------------------------------------
namespace app\common\model\dept;
use app\common\model\BaseModel;
use think\model\concern\SoftDelete;
/**
* 部门模型
* Class Dept
* @package app\common\model\article
*/
class Dept extends BaseModel
{
use SoftDelete;
protected $deleteTime = 'delete_time';
/**
* @notes 状态描述
* @param $value
* @param $data
* @return string
* @author 段誉
* @date 2022/5/25 18:03
*/
public function getStatusDescAttr($value, $data)
{
return $data['status'] ? '正常' : '停用';
}
}

View File

@@ -0,0 +1,45 @@
<?php
// +----------------------------------------------------------------------
// | likeadmin快速开发前后端分离管理后台PHP版
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | gitee下载https://gitee.com/likeshop_gitee/likeadmin
// | github下载https://github.com/likeshop-github/likeadmin
// | 访问官网https://www.likeadmin.cn
// | likeadmin团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeadminTeam
// +----------------------------------------------------------------------
namespace app\common\model\dept;
use app\common\model\BaseModel;
use think\model\concern\SoftDelete;
/**
* 岗位模型
* Class Jobs
* @package app\common\model\dept
*/
class Jobs extends BaseModel
{
use SoftDelete;
protected $deleteTime = 'delete_time';
/**
* @notes 状态描述
* @param $value
* @param $data
* @return string
* @author 段誉
* @date 2022/5/25 18:03
*/
public function getStatusDescAttr($value, $data)
{
return $data['status'] ? '正常' : '停用';
}
}

View File

@@ -0,0 +1,47 @@
<?php
// +----------------------------------------------------------------------
// | likeadmin快速开发前后端分离管理后台PHP版
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | gitee下载https://gitee.com/likeshop_gitee/likeadmin
// | github下载https://github.com/likeshop-github/likeadmin
// | 访问官网https://www.likeadmin.cn
// | likeadmin团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeadminTeam
// +----------------------------------------------------------------------
namespace app\common\model\dict;
use app\common\model\BaseModel;
use think\model\concern\SoftDelete;
/**
* 字典数据模型
* Class DictData
* @package app\common\model\dict
*/
class DictData extends BaseModel
{
use SoftDelete;
protected $deleteTime = 'delete_time';
/**
* @notes 状态描述
* @param $value
* @param $data
* @return string
* @author 段誉
* @date 2022/6/20 16:31
*/
public function getStatusDescAttr($value, $data)
{
return $data['status'] ? '正常' : '停用';
}
}

View File

@@ -0,0 +1,47 @@
<?php
// +----------------------------------------------------------------------
// | likeadmin快速开发前后端分离管理后台PHP版
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | gitee下载https://gitee.com/likeshop_gitee/likeadmin
// | github下载https://github.com/likeshop-github/likeadmin
// | 访问官网https://www.likeadmin.cn
// | likeadmin团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeadminTeam
// +----------------------------------------------------------------------
namespace app\common\model\dict;
use app\common\model\BaseModel;
use think\model\concern\SoftDelete;
/**
* 字典类型模型
* Class DictType
* @package app\common\model\dict
*/
class DictType extends BaseModel
{
use SoftDelete;
protected $deleteTime = 'delete_time';
/**
* @notes 状态描述
* @param $value
* @param $data
* @return string
* @author 段誉
* @date 2022/6/20 15:54
*/
public function getStatusDescAttr($value, $data)
{
return $data['status'] ? '正常' : '停用';
}
}

View File

@@ -0,0 +1,24 @@
<?php
// +----------------------------------------------------------------------
// | likeadmin快速开发前后端分离管理后台PHP版
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | gitee下载https://gitee.com/likeshop_gitee/likeadmin
// | github下载https://github.com/likeshop-github/likeadmin
// | 访问官网https://www.likeadmin.cn
// | likeadmin团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeadminTeam
// +----------------------------------------------------------------------
namespace app\common\model\file;
use app\common\model\BaseModel;
use think\model\concern\SoftDelete;
class File extends BaseModel
{
use SoftDelete;
protected $deleteTime = 'delete_time';
}

View File

@@ -0,0 +1,25 @@
<?php
// +----------------------------------------------------------------------
// | likeadmin快速开发前后端分离管理后台PHP版
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | gitee下载https://gitee.com/likeshop_gitee/likeadmin
// | github下载https://github.com/likeshop-github/likeadmin
// | 访问官网https://www.likeadmin.cn
// | likeadmin团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeadminTeam
// +----------------------------------------------------------------------
namespace app\common\model\file;
use app\common\model\BaseModel;
use think\model\concern\SoftDelete;
class FileCate extends BaseModel
{
use SoftDelete;
protected $deleteTime = 'delete_time';
}

View File

@@ -0,0 +1,214 @@
<?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\goods;
use app\common\enum\GoodsEnum;
use app\common\model\BaseModel;
use app\common\model\skill\Skill;
use think\model\concern\SoftDelete;
class Goods extends BaseModel
{
use SoftDelete;
protected $deleteTime = 'delete_time';
/**
* @notes 关联服务轮播图
* @return \think\model\relation\HasMany
* @author ljj
* @date 2022/2/9 3:37 下午
*/
public function goodsImage()
{
return $this->hasMany(GoodsImage::class, 'goods_id', 'id');
}
/**
* @notes 关联服务评价模型
* @return \think\model\relation\HasMany
* @author ljj
* @date 2022/2/17 6:15 下午
*/
public function goodsComment()
{
return $this->hasMany(GoodsComment::class, 'goods_id', 'id')->append(['goods_comment_image', 'user']);
}
public function goodsCity()
{
return $this->hasMany(GoodsCityIndex::class,'goods_id','id');
}
/**
* @notes 获取分类名称
* @param $value
* @param $data
* @return mixed|string
* @author ljj
* @date 2022/2/9 11:15 上午
*/
public function getCategoryDescAttr($value, $data)
{
$category_arr = (new GoodsCategory())->column('name,pid', 'id');
$category_name = '未知';
$category_first = $category_arr[$data['category_id']] ?? [];
if ($category_first) {
$category_name = $category_first['name'];
$category_second = $category_arr[$category_first['pid']] ?? [];
if ($category_second) {
$category_name = $category_second['name'] . '/' . $category_name;
$category_third = $category_arr[$category_second['pid']] ?? [];
if ($category_third) {
$category_name = $category_third['name'] . '/' . $category_name;
}
}
}
return $category_name;
}
/**
* @notes 获取状态
* @param $value
* @param $data
* @return string|string[]
* @author ljj
* @date 2022/2/9 11:22 上午
*/
public function getStatusDescAttr($value, $data)
{
return GoodsEnum::getShowDesc($data['status']);
}
/**
* @notes 分类搜索器
* @param $query
* @param $value
* @param $data
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
* @author ljj
* @date 2022/2/17 5:11 下午
*/
public function searchCategoryIdAttr($query, $value, $data)
{
if ($value) {
$goodsCategory = GoodsCategory::find($value);
$level = $goodsCategory['level'] ?? '';
$categoryIds = [];
switch ($level) {
case 1:
$categoryIds = GoodsCategory::where(['pid' => $value])
->column('id');
Array_push($categoryIds, $value);
break;
case 2:
$categoryIds = [$value];
break;
}
$goodsIds = Goods::where(['category_id' => $categoryIds])->column('id');
$query->where('id', 'in', $goodsIds);
}
}
public function getSkillDescAttr($value,$data){
$skillLists = Skill::alias('S')
->join('goods_skill_index GSI','S.id = GSI.skill_id')
->where(['GSI.goods_id'=>$data['id']])
->column('name');
if($skillLists){
return implode('、',$skillLists);
}
return '';
}
/**
* @notes 关键词搜索器
* @param $query
* @param $value
* @param $data
* @author ljj
* @date 2022/2/17 5:16 下午
*/
public function searchKeywordAttr($query, $value, $data)
{
if ($value) {
$query->where('name', 'like', '%' . $value . '%');
}
}
/**
* @notes 城市搜索
* @param $query
* @param $value
* @param $data
* @author ljj
* @date 2022/2/17 5:16 下午
*/
public function searchCityIdAttr($query, $value, $data)
{
$allCityGoodsIds = Goods::alias('G')
->leftjoin('goods_city_index GCI','G.id = GCI.goods_id')
->where(['GCI.id '=>null,'status'=>1])
->column('G.id');
$cityGoodsIds = Goods::alias('G')
->leftjoin('goods_city_index GCI','G.id = GCI.goods_id')
->where(['status'=>1,'city_id'=>$value])
->column('G.id');
$goodsIds = array_merge($allCityGoodsIds,$cityGoodsIds);
empty($goodsIds) && $goodsIds = [];
$query->where('id', 'in',implode(',',$goodsIds));
}
/**
* @notes 技能搜索
* @param $query
* @param $value
* @param $data
* @return void
* @author cjhao
* @date 2024/8/19 16:52
*/
public function searchSkillIdAttr($query, $value, $data)
{
if ($value) {
$goodsId = GoodsSkillIndex::where(['skill_id'=>$value])->column('goods_id');
$query->where('id','in',$goodsId);
}
}
/**
* @notes 获取审核状态
* @param $value
* @param $data
* @return string|string[]
* @author cjhao
* @date 2024/8/21 17:48
*/
public function getAuditStatusDescAttr($value,$data){
return GoodsEnum::getAuditStatusDesc($data['audit_status']);
}
}

View File

@@ -0,0 +1,70 @@
<?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\goods;
use app\common\enum\DefaultEnum;
use app\common\model\BaseModel;
use think\model\concern\SoftDelete;
class GoodsCategory extends BaseModel
{
use SoftDelete;
protected $deleteTime = 'delete_time';
public function son()
{
return $this->hasMany(self::class,'pid','id')->field('id,name,pid');
}
public function goods()
{
return $this->hasMany(Goods::class,'category_id');
}
/**
* @notes 首页显示状态
* @param $value
* @param $data
* @return string|string[]
* @author ljj
* @date 2022/2/8 3:58 下午
*/
public function getRecommendDescAttr($value,$data)
{
return DefaultEnum::getRecommendDesc($data['is_recommend']);
}
/**
* @notes 关联项目数量
* @param $value
* @param $data
* @return int
* @author ljj
* @date 2023/4/12 10:18 上午
*/
public function getRelevanceNumAttr($value,$data)
{
$category_ids = GoodsCategory::where(['pid'=>$data['id']])->column('id');
$category_ids[] = $data['id'];
$num = Goods::where(['category_id'=>$category_ids])->count('id');
return $num;
}
}

View File

@@ -0,0 +1,13 @@
<?php
namespace app\common\model\goods;
use app\common\model\BaseModel;
/**
* 服务城市关联模型类
* Class GoodsCityIndex
* @package app\common\model\city
*/
class GoodsCityIndex extends BaseModel
{
}

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\goods;
use app\common\model\BaseModel;
class GoodsCollect extends BaseModel
{
}

View File

@@ -0,0 +1,90 @@
<?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\goods;
use app\common\enum\GoodsCommentEnum;
use app\common\model\BaseModel;
use app\common\model\user\User;
use think\model\concern\SoftDelete;
class GoodsComment extends BaseModel
{
use SoftDelete;
protected $deleteTime = 'delete_time';
/**
* @notes 关联评论图片模型
* @return \think\model\relation\HasMany
* @author ljj
* @date 2022/2/9 5:51 下午
*/
public function goodsCommentImage()
{
return $this->hasMany(GoodsCommentImage::class,'comment_id','id');
}
/**
* @notes 关联用户模型
* @return \think\model\relation\HasOne
* @author ljj
* @date 2022/2/17 6:19 下午
*/
public function user()
{
return $this->hasOne(User::class,'id','user_id')->field('id,sn,nickname,avatar,mobile');
}
/**
* @notes 获取回复状态
* @param $value
* @param $data
* @return string|string[]
* @author ljj
* @date 2022/2/9 5:54 下午
*/
public function getStatusDescAttr($value,$data)
{
return GoodsCommentEnum::getStatusDesc($data['status']);
}
/**
* @notes 获取评价等级
* @param $value
* @param $data
* @return string
* @author ljj
* @date 2022/2/9 5:56 下午
*/
public function getCommentLevelAttr($value,$data)
{
if ($data['service_comment'] < 3) {
return '差评';
}
if ($data['service_comment'] == 3) {
return '中评';
}
if ($data['service_comment'] > 3) {
return '好评';
}
return '未知';
}
}

View File

@@ -0,0 +1,53 @@
<?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\goods;
use app\common\model\BaseModel;
use app\common\service\FileService;
class GoodsCommentImage extends BaseModel
{
/**
* @notes 补全图片路径
* @param $value
* @param $data
* @return string
* @author ljj
* @date 2022/2/18 2:47 下午
*/
public function getUriAttr($value,$data)
{
return FileService::getFileUrl($value);
}
/**
* @notes 补全图片路径
* @param $value
* @param $data
* @return string
* @author ljj
* @date 2022/2/18 2:47 下午
*/
public function setUriAttr($value,$data)
{
return FileService::setFileUrl($value);
}
}

View File

@@ -0,0 +1,40 @@
<?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\goods;
use app\common\model\BaseModel;
use app\common\service\FileService;
class GoodsImage 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);
}
}

View File

@@ -0,0 +1,27 @@
<?php
// +----------------------------------------------------------------------
// | likeadmin快速开发前后端分离管理后台PHP版
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | gitee下载https://gitee.com/likeshop_gitee/likeadmin
// | github下载https://github.com/likeshop-github/likeadmin
// | 访问官网https://www.likeadmin.cn
// | likeadmin团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeadminTeam
// +----------------------------------------------------------------------
namespace app\common\model\goods;
use app\common\model\BaseModel;
/**
* 搜索记录模型类
* Class GoodsSearchLog
* @package app\common\model\goods
*/
class GoodsSearchLog extends BaseModel
{
}

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\goods;
use app\common\model\BaseModel;
class GoodsSkillIndex extends BaseModel
{
}

View File

@@ -0,0 +1,47 @@
<?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团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | // +----------------------------------------------------------------------
// | likeadmin快速开发前后端分离管理后台PHP版
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | gitee下载https://gitee.com/likeshop_gitee/likeadmin
// | github下载https://github.com/likeshop-github/likeadmin
// | 访问官网https://www.likeadmin.cn
// | likeadmin团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeadminTeam
// +----------------------------------------------------------------------
// +----------------------------------------------------------------------
namespace app\common\model\notice;
use app\common\model\BaseModel;
use think\model\concern\SoftDelete;
/**
* 通知记录模型
* Class Notice
* @package app\common\model
*/
class NoticeRecord extends BaseModel
{
use SoftDelete;
protected $deleteTime = 'delete_time';
}

View File

@@ -0,0 +1,157 @@
<?php
// +----------------------------------------------------------------------
// | likeadmin快速开发前后端分离管理后台PHP版
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | gitee下载https://gitee.com/likeshop_gitee/likeadmin
// | github下载https://github.com/likeshop-github/likeadmin
// | 访问官网https://www.likeadmin.cn
// | likeadmin团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeadminTeam
// +----------------------------------------------------------------------
namespace app\common\model\notice;
use app\common\enum\DefaultEnum;
use app\common\enum\notice\NoticeEnum;
use app\common\model\BaseModel;
class NoticeSetting extends BaseModel
{
/**
* @notes 短信通知状态
* @param $value
* @param $data
* @return string|string[]
* @author ljj
* @date 2022/2/16 3:22 下午
*/
public function getSmsStatusDescAttr($value,$data)
{
if ($data['sms_notice']) {
$sms_text = json_decode($data['sms_notice'],true);
return DefaultEnum::getEnableDesc($sms_text['status']);
}else {
return '停用';
}
}
/**
* @notes 公众号通知状态
* @param $value
* @param $data
* @return string|string[]
* @author ljj
* @date 2022/2/16 3:22 下午
*/
public function getOaStatusDescAttr($value,$data)
{
if ($data['oa_notice']) {
$sms_text = json_decode($data['oa_notice'],true);
return DefaultEnum::getEnableDesc($sms_text['status']);
}else {
return '停用';
}
}
/**
* @notes 小程序通知状态
* @param $value
* @param $data
* @return string|string[]
* @author ljj
* @date 2022/2/16 3:22 下午
*/
public function getMnpStatusDescAttr($value,$data)
{
if ($data['mnp_notice']) {
$sms_text = json_decode($data['mnp_notice'],true);
return DefaultEnum::getEnableDesc($sms_text['status']);
}else {
return '停用';
}
}
/**
* @notes 通知类型
* @param $value
* @param $data
* @return string|string[]
* @author ljj
* @date 2022/2/17 2:50 下午
*/
public function getTypeDescAttr($value,$data)
{
return NoticeEnum::getTypeDesc($data['type']);
}
/**
* @notes 接收者描述获取器
* @param $value
* @return string
* @author Tab
* @date 2021/8/18 16:42
*/
public function getRecipientDescAttr($value)
{
$desc = [
1 => '用户',
2 => '平台',
3 => '师傅',
];
return $desc[$value] ?? '';
}
/**
* @notes 系统通知获取器
* @param $value
* @return array|mixed
* @author Tab
* @date 2021/8/18 19:11
*/
public function getSystemNoticeAttr($value)
{
return empty($value) ? [] : json_decode($value, true);
}
/**
* @notes 短信通知获取器
* @param $value
* @return array|mixed
* @author Tab
* @date 2021/8/18 19:12
*/
public function getSmsNoticeAttr($value)
{
return empty($value) ? [] : json_decode($value, true);
}
/**
* @notes 公众号通知获取器
* @param $value
* @return array|mixed
* @author Tab
* @date 2021/8/18 19:13
*/
public function getOaNoticeAttr($value)
{
return empty($value) ? [] : json_decode($value, true);
}
/**
* @notes 小程序通知获取器
* @param $value
* @return array|mixed
* @author Tab
* @date 2021/8/18 19:13
*/
public function getMnpNoticeAttr($value)
{
return empty($value) ? [] : json_decode($value, true);
}
}

View File

@@ -0,0 +1,30 @@
<?php
// +----------------------------------------------------------------------
// | likeadmin快速开发前后端分离管理后台PHP版
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | gitee下载https://gitee.com/likeshop_gitee/likeadmin
// | github下载https://github.com/likeshop-github/likeadmin
// | 访问官网https://www.likeadmin.cn
// | likeadmin团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeadminTeam
// +----------------------------------------------------------------------
namespace app\common\model\notice;
use app\common\model\BaseModel;
use think\model\concern\SoftDelete;
/**
* 短信记录模型
* Class SmsLog
* @package app\common\model
*/
class SmsLog extends BaseModel
{
use SoftDelete;
protected $deleteTime = 'delete_time';
}

View File

@@ -0,0 +1,660 @@
<?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\order;
use app\common\enum\OrderEnum;
use app\common\enum\PayEnum;
use app\common\enum\user\UserTerminalEnum;
use app\common\enum\YesNoEnum;
use app\common\model\BaseModel;
use app\common\model\coach\Coach;
use app\common\model\Region;
use app\common\model\shop\Shop;
use app\common\model\user\User;
use app\common\service\ConfigService;
use think\model\concern\SoftDelete;
/**
* 订单模型类
* Class Order
* @package app\common\model\order
*/
class Order extends BaseModel
{
use SoftDelete;
protected $json = ['extra','car_config_snap','address_snap'];
protected $deleteTime = 'delete_time';
// 设置JSON数据返回数组
protected $jsonAssoc = true;
/**
* 用户端显示按钮:取消订单;立即支付;加时(接单后就显示,到服务完成);补差价(接单完成后就显示,到服务完成);评论;查看评论
* 师傅端显示按钮:立即接单;立即出发;已达到(需要定位,上传图片);开始服务;服务完成(需要定位,上传图片)
*/
public function coachInfo()
{
return $this->hasOne(Coach::class,'id','coach_id')->field('id,sn,name,work_photo,mobile');
}
public function userInfo()
{
return $this->hasOne(User::class,'id','user_id')->field('id,sn,nickname,avatar');
}
/**
* @notes 指派技师
* @param $value
* @param $data
* @return int
* @author cjhao
* @date 2024/11/17 21:58
*/
public function getDispatchBtnAttr($value,$data)
{
$btn = 0;
if($data['order_status'] > OrderEnum::ORDER_STATUS_WAIT_PAY && $data['order_status'] < OrderEnum::ORDER_STATUS_DEPART){
$btn = 1;
}
return $btn;
}
/**
* 师傅端按钮-start
*/
/**
* @notes 待接单按钮
* @param $value
* @param $data
* @return int
* @author cjhao
* @date 2024/9/13 16:55
*/
public function getTakeOrderBtnAttr($value,$data)
{
$btn = 0;
if(OrderEnum::ORDER_STATUS_WAIT_RECEIVING == $data['order_status']){
$btn = 1;
}
return $btn;
}
/**
* @notes 出发按钮
* @param $value
* @param $data
* @return int
* @author cjhao
* @date 2024/9/13 16:59
*/
public function getDepartBtnAttr($value,$data)
{
$btn = 0;
if(OrderEnum::ORDER_STATUS_WAIT_DEPART == $data['order_status']){
$btn = 1;
}
return $btn;
}
/**
* @notes 到达按钮
* @param $value
* @param $data
* @return int
* @author cjhao
* @date 2024/9/13 17:04
*/
public function getArriveBtnAttr($value,$data)
{
$btn = 0;
if(OrderEnum::ORDER_STATUS_DEPART == $data['order_status']){
$btn = 1;
}
return $btn;
}
/**
* @notes 服务开始
* @param $value
* @param $data
* @return int
* @author cjhao
* @date 2024/9/13 17:05
*/
public function getServerStartBtnAttr($value,$data)
{
$btn = 0;
if(OrderEnum::ORDER_STATUS_ARRIVE == $data['order_status']){
$btn = 1;
}
return $btn;
}
/**
* @notes 服务完成按钮
* @param $value
* @param $data
* @return int
* @author cjhao
* @date 2024/9/13 17:07
*/
public function getServerFinishBtnAttr($value,$data)
{
$btn = 0;
if(OrderEnum::ORDER_STATUS_START_SERVER == $data['order_status']){
$btn = 1;
}
return $btn;
}
/**
* 师傅端按钮-end
*/
/**
* 用户端按钮-start
*/
/**
* @notes 差价按钮
* @param $value
* @param $data
* @return int
* @author cjhao
* @date 2024/9/20 01:40
*/
public function getGapBtnAttr($value,$data)
{
$btn = 0;
if( $data['order_status'] < OrderEnum::ORDER_STATUS_SERVER_FINISH && $data['order_status'] > OrderEnum::ORDER_STATUS_WAIT_RECEIVING){
$btn = 1;
}
return $btn;
}
/**
* @notes 加钟按钮
* @param $value
* @param $data
* @return int
* @author cjhao
* @date 2024/9/20 01:40
*/
public function getAppendBtnAttr($value,$data)
{
$btn = 0;
if( $data['order_status'] < OrderEnum::ORDER_STATUS_SERVER_FINISH && $data['order_status'] > OrderEnum::ORDER_STATUS_WAIT_RECEIVING){
$btn = 1;
}
return $btn;
}
/**
* @notes 取消按钮
* @param $value
* @param $data
* @return int
* @author ljj
* @date 2022/2/11 12:08 下午
*/
public function getCancelBtnAttr($value,$data)
{
$btn = YesNoEnum::NO;
//待支付或预约中的订单可以取消
if ($data['order_status'] < OrderEnum::ORDER_STATUS_SERVER_FINISH) {
$btn = YesNoEnum::YES;
}
return $btn;
}
/**
* @notes 取消按钮
* @param $value
* @param $data
* @return int
* @author ljj
* @date 2022/2/11 12:08 下午
*/
public function getUserCancelBtnAttr($value,$data)
{
$btn = YesNoEnum::NO;
//待支付或预约中的订单可以取消
if ($data['order_status'] < OrderEnum::ORDER_STATUS_WAIT_DEPART) {
$btn = YesNoEnum::YES;
}
return $btn;
}
/**
* @notes 退款按钮
* @param $value
* @param $data
* @return int
* @author ljj
* @date 2022/2/11 12:08 下午
*/
public function getRefundBtnAttr($value,$data)
{
$btn = YesNoEnum::NO;
//待支付或预约中的订单可以取消
if($data['order_status'] < OrderEnum::ORDER_STATUS_SERVER_FINISH){
return $btn;
}
if (PayEnum::ISPAID == $data['pay_status'] && $data['total_order_amount'] > $data['total_refund_amount']) {
$btn = YesNoEnum::YES;
}
return $btn;
}
/**
* @notes 删除按钮
* @param $value
* @param $data
* @return int
* @author ljj
* @date 2022/2/11 2:57 下午
*/
public function getDelBtnAttr($value,$data)
{
$btn = YesNoEnum::NO;
//已关闭的订单可以删除
if ($data['order_status'] == OrderEnum::ORDER_STATUS_CLOSE) {
$btn = YesNoEnum::YES;
}
return $btn;
}
/**
* @notes 支付按钮
* @param $value
* @param $data
* @return int
* @author ljj
* @date 2022/2/28 9:48 上午
*/
public function getPayBtnAttr($value,$data)
{
$btn = YesNoEnum::NO;
if ($data['order_status'] == OrderEnum::ORDER_STATUS_WAIT_PAY && $data['pay_status'] == PayEnum::UNPAID) {
$btn = YesNoEnum::YES;
}
return $btn;
}
/**
* @notes 评价按钮
* @param $value
* @param $data
* @return int
* @author ljj
* @date 2022/2/28 9:52 上午
*/
public function getCommentBtnAttr($value,$data)
{
$btn = YesNoEnum::NO;
if ($data['order_status'] == OrderEnum::ORDER_STATUS_SERVER_FINISH) {
$is_comment = OrderGoods::where(['order_id'=>$data['id']])->value('is_comment');
if ($is_comment == YesNoEnum::NO) {
$btn = YesNoEnum::YES;
}
}
return $btn;
}
public function getLookCommentBtnAttr($value,$data)
{
$btn = YesNoEnum::NO;
if ($data['order_status'] == OrderEnum::ORDER_STATUS_SERVER_FINISH) {
$isComment = OrderGoods::where(['order_id'=>$data['id']])->value('is_comment');
if ($isComment == YesNoEnum::YES) {
$btn = YesNoEnum::YES;
}
}
return $btn;
}
/**
* 用户端按钮-end
*/
/**
* @notes 关联用户模型
* @return \think\model\relation\HasOne
* @author ljj
* @date 2022/2/10 6:36 下午
*/
public function user()
{
return $this->hasOne(User::class,'id','user_id');
}
/**
* @notes 获取订单距离
* @param $value
* @param $data
* @return string
* @author cjhao
* @date 2024/9/13 16:30
*/
public function getOrderDistanceDescAttr($value,$data)
{
return $data['order_distance'].'km';
}
/**
* @notes 关联订单服务模型
* @return \think\model\relation\HasMany
* @author ljj
* @date 2022/2/10 6:52 下午
*/
public function orderGoods()
{
return $this->hasMany(OrderGoods::class,'order_id','id');
}
/**
* @notes 关联订单日志模型
* @return \think\model\relation\HasMany
* @author ljj
* @date 2022/2/10 6:53 下午
*/
public function orderLog()
{
return $this->hasMany(OrderLog::class,'order_id','id')->append(['operator']);
}
/**
* @notes 预约时间
* @param $value
* @param $data
* @return false|string
* @author ljj
* @date 2022/2/11 10:11 上午
*/
public function getAppointTimeAttr($value,$data)
{
return date('H:i',$data['appoint_time']);
}
/**
* @notes 预约时间
* @param $value
* @param $data
* @return false|string
* @author ljj
* @date 2022/2/11 10:11 上午
*/
public function getAppointTimeDescAttr($value,$data)
{
return date('Y-m-d H:i',$data['appoint_time']);
}
/**
* @notes 预约时间段
* @param $value
* @param $data
* @return string
* @author cjhao
* @date 2024/9/14 12:38
*/
public function getAppointDateAttr($value,$data)
{
return date('m-d',$data['appoint_time']);
}
/**
* @notes 预约日期
* @param $value
* @param $data
* @return string
* @author ljj
* @date 2022/2/11 10:09 上午
*/
public function getAppointWeekAttr($value,$data)
{
$weekarray = ['星期日','星期一','星期二','星期三','星期四','星期五','星期六'];
return $weekarray[date("w",$data['appoint_time'])];
}
/**
* @notes 上门时间
* @param $value
* @param $data
* @return string
* @author ljj
* @date 2022/2/11 10:54 上午
*/
public function getDoorTimeAttr($value,$data)
{
$appoint_time_start = date('H:i',$data['appoint_time_start']);
$appoint_time_end = date('H:i',$data['appoint_time_end']);
return $appoint_time_start.'-'.$appoint_time_end;
}
/**
* @notes 支付状态
* @param $value
* @param $data
* @return string|string[]
* @author ljj
* @date 2022/2/11 11:08 上午
*/
public function getPayStatusDescAttr($value,$data)
{
return PayEnum::getPayStatusDesc($data['pay_status']);
}
/**
* @notes 支付方式
* @param $value
* @param $data
* @return string|string[]
* @author ljj
* @date 2022/2/11 12:01 下午
*/
public function getPayWayDescAttr($value,$data)
{
return PayEnum::getPayTypeDesc($data['pay_way']);
}
/**
* @notes 订单状态
* @param $value
* @param $data
* @return string|string[]
* @author ljj
* @date 2022/2/11 11:59 上午
*/
public function getOrderStatusDescAttr($value,$data)
{
return OrderEnum::getOrderStatusDesc($data['order_status']);
}
/**
* @notes 核销状态
* @param $value
* @param $data
* @return string|string[]
* @author ljj
* @date 2022/2/11 12:02 下午
*/
public function getVerificationStatusDescAttr($value,$data)
{
return OrderEnum::getVerificationStatusDesc($data['verification_status']);
}
/**
* @notes 支付时间
* @param $value
* @param $data
* @author ljj
* @date 2022/2/28 11:02 上午
*/
public function getPayTimeAttr($value,$data)
{
return $value ? date('Y-m-d H:i:s',$value) : '-';
}
/**
* @notes
* @param $value
* @param $data
* @return string
* @author cjhao
* @date 2024/11/20 16:05
*/
public function getTrueServerFinishTimeAttr($value,$data){
return $value ? date('Y-m-d H:i:s',$value) : '-';
}
/**
* @notes 完成时间
* @param $value
* @param $data
* @author ljj
* @date 2022/2/28 11:02 上午
*/
public function getFinishTimeAttr($value,$data)
{
return $value ? date('Y-m-d H:i:s',$value) : '-';
}
/**
* @notes 未支付订单自动取消时间
* @param $value
* @param $data
* @return float|int|string
* @author ljj
* @date 2022/3/15 4:28 下午
*/
public function getOrderCancelTimeAttr($value, $data)
{
$end_time = 0;
$is_cancel = ConfigService::get('transaction', 'cancel_unpaid_orders',1);
if ($data['order_status'] == 0 && $data['pay_status'] == 0 && $is_cancel == 1) {
$order_cancel_time = ConfigService::get('transaction', 'cancel_unpaid_orders_times',30);
$end_time = $data['create_time'] + $order_cancel_time * 60;
}
return $end_time;
}
/**
* @notes 省
* @param $value
* @param $data
* @return mixed
* @author ljj
* @date 2022/4/6 6:57 下午
*/
public function getProvinceAttr($value,$data)
{
return Region::where(['id'=>$data['province_id']])->value('name');
}
/**
* @notes 市
* @param $value
* @param $data
* @return mixed
* @author ljj
* @date 2022/4/6 7:02 下午
*/
public function getCityAttr($value,$data)
{
return Region::where(['id'=>$data['city_id']])->value('name');
}
/**
* @notes 区
* @param $value
* @param $data
* @return mixed
* @author ljj
* @date 2022/4/6 7:02 下午
*/
public function getDistrictAttr($value,$data)
{
return Region::where(['id'=>$data['district_id']])->value('name');
}
/**
* @notes 派单状态
* @param $value
* @param $data
* @return string|string[]
* @author ljj
* @date 2022/8/29 4:57 下午
*/
public function getDispatchDescAttr($value,$data)
{
return OrderEnum::getDispatchDesc($data['is_dispatch']);
}
/**
* @notes 订单来源
* @param $value
* @param $data
* @return array|mixed|string|string[]
* @author cjhao
* @date 2024/9/21 23:49
*/
public function getOrderTerminalDescAttr($value,$data)
{
return UserTerminalEnum::getTermInalDesc($data['order_terminal']);
}
public function orderGap()
{
return $this->hasMany(OrderGap::class,'order_id','id')->where(['pay_status'=>PayEnum::ISPAID])->withoutField('create_time,update_time,delete_time');
}
public function orderAppend()
{
return $this->hasMany(OrderAppend::class,'order_id','id')->where(['pay_status'=>PayEnum::ISPAID])->field('sn,order_id,pay_status,goods_name,goods_id,duration,refund_amount,goods_num,pay_time,goods_price,order_amount');
}
}

View File

@@ -0,0 +1,76 @@
<?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\order;
use app\common\model\BaseModel;
use app\common\model\goods\GoodsComment;
use app\common\service\FileService;
class OrderAppend extends BaseModel
{
protected $json = ['goods_snap'];
// 设置JSON数据返回数组
protected $jsonAssoc = true;
/**
* @notes 订单服务图片
* @param $value
* @param $data
* @return string
* @author ljj
* @date 2022/2/11 10:37 上午
*/
public function getGoodsImageAttr($value,$data)
{
return empty($value) ? '' : FileService::getFileUrl($value);
}
/**
* @notes 订单服务图片
* @param $value
* @param $data
* @return string
* @author ljj
* @date 2022/2/11 10:37 上午
*/
public function setGoodsImageAttr($value,$data)
{
return empty($value) ?'' : FileService::setFileUrl($value);
}
/**
* @notes 支付时间
* @param $value
* @param $data
* @author ljj
* @date 2022/2/28 11:02 上午
*/
public function getPayTimeAttr($value,$data)
{
return $value ? date('Y-m-d H:i:s',$value) : '-';
}
}

View File

@@ -0,0 +1,41 @@
<?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\order;
use app\common\model\BaseModel;
use app\common\model\goods\GoodsComment;
use app\common\service\FileService;
class OrderGap extends BaseModel
{
/**
* @notes 支付时间
* @param $value
* @param $data
* @author ljj
* @date 2022/2/28 11:02 上午
*/
public function getPayTimeAttr($value,$data)
{
return $value ? date('Y-m-d H:i:s',$value) : '-';
}
}

View File

@@ -0,0 +1,57 @@
<?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\order;
use app\common\model\BaseModel;
use app\common\model\goods\GoodsComment;
use app\common\service\FileService;
class OrderGoods extends BaseModel
{
protected $json = ['goods_snap'];
// 设置JSON数据返回数组
protected $jsonAssoc = true;
/**
* @notes 关联服务评价模型
* @return \think\model\relation\HasOne
* @author ljj
* @date 2022/2/18 2:44 下午
*/
public function goodsComment()
{
return $this->hasOne(GoodsComment::class,'order_goods_id','id')->append(['goods_comment_image','comment_level']);
}
/**
* @notes 订单服务图片
* @param $value
* @param $data
* @return string
* @author ljj
* @date 2022/2/11 10:37 上午
*/
public function getGoodsImageAttr($value,$data)
{
return empty($value) ? '' : FileService::getFileUrl($value);
}
}

View File

@@ -0,0 +1,78 @@
<?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\order;
use app\common\enum\OrderLogEnum;
use app\common\model\auth\Admin;
use app\common\model\BaseModel;
use app\common\model\coach\Coach;
use app\common\model\user\User;
use app\common\service\FileService;
class OrderLog extends BaseModel
{
protected $json = ['extra','location'];
protected $deleteTime = 'delete_time';
protected $jsonAssoc = true;
/**
* @notes 操作事件
* @param $value
* @param $data
* @return string|string[]
* @author ljj
* @date 2022/2/11 2:21 下午
*/
public function getChannelDescAttr($value,$data)
{
return OrderLogEnum::getRecordDesc($data['channel']);
}
public function getOperatorAttr($value,$data)
{
$operator = '未知';
if ($data['type'] == OrderLogEnum::TYPE_SYSTEM) {
$operator = '系统';
}
if ($data['type'] == OrderLogEnum::TYPE_ADMIN) {
$operator = Admin::where('id',$data['operator_id'])->value('name');
}
if ($data['type'] == OrderLogEnum::TYPE_USER) {
$operator = User::where('id',$data['operator_id'])->value('nickname');
}
if ($data['type'] == OrderLogEnum::TYPE_COACH) {
$operator = Coach::where('id',$data['operator_id'])->value('name');
}
return $operator;
}
public function getExtraAttr($value,$data){
if($value){
foreach ($value as $key => $image){
$value[$key] = FileService::getFileUrl($image);
}
}
return $value;
}
}

View File

@@ -0,0 +1,75 @@
<?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\order;
use app\common\enum\OrderRefundEnum;
use app\common\model\BaseModel;
use app\common\model\user\User;
class OrderRefund extends BaseModel
{
/**
* @notes 管理用户模型
* @return \think\model\relation\HasOne
* @author ljj
* @date 2022/9/9 4:54 下午
*/
public function user()
{
return $this->hasOne(User::class,'id','user_id');
}
/**
* @notes 退款类型
* @param $value
* @param $data
* @return string|void
* @author ljj
* @date 2022/9/9 4:56 下午
*/
public function getTypeDescAttr($value,$data)
{
switch ($data['type']) {
case 1:
return '系统取消订单';
case 2:
return '后台取消订单';
case 3:
return '用户取消订单';
default :
return '';
}
}
/**
* @notes 退款状态
* @param $value
* @param $data
* @return string|string[]
* @author ljj
* @date 2022/9/9 4:59 下午
*/
public function getRefundStatusDescAttr($value,$data)
{
return OrderRefundEnum::getStatusDesc($data['refund_status']);
}
}

View File

@@ -0,0 +1,64 @@
<?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\order;
use app\common\enum\OrderRefundEnum;
use app\common\model\auth\Admin;
use app\common\model\BaseModel;
use app\common\model\user\User;
class OrderRefundLog extends BaseModel
{
/**
* @notes 退款状态
* @param $value
* @param $data
* @return string|string[]
* @author ljj
* @date 2022/9/9 4:59 下午
*/
public function getRefundStatusDescAttr($value,$data)
{
return OrderRefundEnum::getStatusDesc($data['refund_status']);
}
/**
* @notes 操作人
* @param $value
* @param $data
* @return mixed|string
* @author ljj
* @date 2022/9/9 5:59 下午
*/
public function getOperatorDescAttr($value,$data)
{
switch ($data['type']) {
case 1:
return '系统';
case 2:
return Admin::where('id',$data['operator_id'])->value('name');
case 3:
return User::where('id',$data['operator_id'])->value('nickname');
default:
return '';
}
}
}

View File

@@ -0,0 +1,44 @@
<?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\order;
use app\common\model\BaseModel;
use think\model\concern\SoftDelete;
class OrderTime extends BaseModel
{
use SoftDelete;
protected $deleteTime = 'delete_time';
/**
* @notes 时间段
* @param $value
* @param $data
* @return string
* @author ljj
* @date 2022/2/11 5:51 下午
*/
public function getTimeDescAttr($value,$data)
{
return $data['start_time'].'-'.$data['end_time'];
}
}

View File

@@ -0,0 +1,43 @@
<?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\pay;
use app\common\enum\PayEnum;
use app\common\model\BaseModel;
class PayConfig extends BaseModel
{
protected $name = 'dev_pay';
/**
* @notes 支付方式
* @param $value
* @param $data
* @return string|string[]
* @author ljj
* @date 2022/2/15 6:00 下午
*/
public function getPayWayDescAttr($value,$data)
{
return PayEnum::getPayTypeDesc($data['pay_way']);
}
}

View File

@@ -0,0 +1,58 @@
<?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\pay;
use app\common\enum\PayEnum;
use app\common\model\BaseModel;
use app\common\model\pay\PayConfig;
use app\common\service\FileService;
class PayWay extends BaseModel
{
protected $name = 'dev_pay_way';
/**
* @notes 支付方式
* @param $value
* @param $data
* @return string|string[]
* @author ljj
* @date 2022/2/15 6:00 下午
*/
public function getPayWayDescAttr($value,$data)
{
return PayConfig::where('id',$data['pay_id'])->value('name');
}
/**
* @notes 支付方式图标
* @param $value
* @param $data
* @return mixed|string
* @author ljj
* @date 2022/2/21 4:08 下午
*/
public function getIconAttr($value,$data)
{
return FileService::getFileUrl(PayConfig::where('id',$data['pay_id'])->value('image'));
}
}

View File

@@ -0,0 +1,36 @@
<?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\settle;
use app\common\model\BaseModel;
/**
* 结算模型类
* Class Settle
* @package app\common\model\settle
*/
class Settle extends BaseModel
{
protected $json = ['settle_config'];
// 设置JSON数据返回数组
protected $jsonAssoc = true;
}

View File

@@ -0,0 +1,31 @@
<?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\settle;
use app\common\model\BaseModel;
/**
* 结算模型类
* Class SettleOrder
* @package app\common\model\settle
*/
class SettleOrder extends BaseModel
{
}

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';
}

View File

@@ -0,0 +1,25 @@
<?php
namespace app\common\model\skill;
use app\common\model\BaseModel;
use app\common\model\coach\Coach;
use app\common\model\goods\GoodsSkillIndex;
/**
* 技能模型类
* Class Skill
* @package app\common\model\skill
*/
class Skill extends BaseModel
{
public function coach()
{
return $this->hasMany(Coach::class,'skill_id');
}
public function goods()
{
return $this->hasMany(GoodsSkillIndex::class,'skill_id');
}
}

View File

@@ -0,0 +1,39 @@
<?php
// +----------------------------------------------------------------------
// | likeadmin快速开发前后端分离管理后台PHP版
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | gitee下载https://gitee.com/likeshop_gitee/likeadmin
// | github下载https://github.com/likeshop-github/likeadmin
// | 访问官网https://www.likeadmin.cn
// | likeadmin团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeadminTeam
// +----------------------------------------------------------------------
namespace app\common\model\tools;
use app\common\model\BaseModel;
/**
* 代码生成器-数据表字段信息模型
* Class GenerateColumn
* @package app\common\model\tools
*/
class GenerateColumn extends BaseModel
{
/**
* @notes 关联table表
* @return \think\model\relation\BelongsTo
* @author 段誉
* @date 2022/6/15 18:59
*/
public function generateTable()
{
return $this->belongsTo(GenerateTable::class, 'id', 'table_id');
}
}

View File

@@ -0,0 +1,56 @@
<?php
// +----------------------------------------------------------------------
// | likeadmin快速开发前后端分离管理后台PHP版
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | gitee下载https://gitee.com/likeshop_gitee/likeadmin
// | github下载https://github.com/likeshop-github/likeadmin
// | 访问官网https://www.likeadmin.cn
// | likeadmin团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeadminTeam
// +----------------------------------------------------------------------
namespace app\common\model\tools;
use app\common\enum\GeneratorEnum;
use app\common\model\BaseModel;
/**
* 代码生成器-数据表信息模型
* Class GenerateTable
* @package app\common\model\tools
*/
class GenerateTable extends BaseModel
{
protected $json = ['menu'];
protected $jsonAssoc = true;
/**
* @notes 关联数据表字段
* @return \think\model\relation\HasMany
* @author 段誉
* @date 2022/6/15 10:46
*/
public function tableColumn()
{
return $this->hasMany(GenerateColumn::class, 'table_id', 'id');
}
/**
* @notes 模板类型描述
* @param $value
* @param $data
* @return string|string[]
* @author 段誉
* @date 2022/6/14 11:25
*/
public function getTemplateTypeDescAttr($value, $data)
{
return GeneratorEnum::getTemplateTypeDesc($data['template_type']);
}
}

View File

@@ -0,0 +1,106 @@
<?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\user;
use app\common\enum\user\UserEnum;
use app\common\enum\user\UserTerminalEnum;
use app\common\model\BaseModel;
use app\common\service\FileService;
use think\model\concern\SoftDelete;
class User extends BaseModel
{
use SoftDelete;
protected $deleteTime = 'delete_time';
//关联用户授权模型
public function userAuth()
{
return $this->hasOne(UserAuth::class, 'user_id');
}
/**
* @notes 不全用户头像路径
* @param $value
* @return string|null
* @author ljj
* @date 2022/2/7 6:45 下午
*/
public function getAvatarAttr($value)
{
return $value ? FileService::getFileUrl($value) : $value;
}
/**
* @notes 获取用户性别
* @param $value
* @return string|string[]
* @author ljj
* @date 2022/2/7 6:51 下午
*/
public function getSexDescAttr($value,$data)
{
return UserEnum::getSexDesc($data['sex']);
}
/**
* @notes 注册来源
* @param $value
* @param $data
* @return string|string[]
* @author ljj
* @date 2022/2/8 9:30 上午
*/
public function getSourceDescAttr($value,$data)
{
return UserTerminalEnum::getTermInalDesc($data['register_source']);
}
/**
* @notes 生成用户编码
* @param string $prefix
* @param int $length
* @return string
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
* @author 段誉
* @date 2022/9/16 10:33
*/
public static function createUserSn($prefix = '', $length = 8)
{
$rand_str = '';
for ($i = 0; $i < $length; $i++) {
$rand_str .= mt_rand(0, 9);
}
$sn = $prefix . $rand_str;
if (User::where(['sn' => $sn])->find()) {
return self::createUserSn($prefix, $length);
}
return $sn;
}
}

View File

@@ -0,0 +1,111 @@
<?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\user;
use app\common\model\BaseModel;
use app\common\model\Region;
use think\model\concern\SoftDelete;
class UserAddress extends BaseModel
{
use SoftDelete;
protected $deleteTime = 'delete_time';
/**
* @notes 获取用户地址
* @param $user_id
* @param int $address_id
* @return array
* @author ljj
* @date 2022/2/24 5:55 下午
*/
public static function getUserAddress($user_id,$address_id = 0)
{
$model = new self;
if ($address_id) {
$result = $model->where(['id' => $address_id])->append(['province','city','district','gender_desc'])->findOrEmpty()->toArray();
}else {
$result = $model->where(['user_id' => $user_id])
->append(['province','city','district','gender_desc'])
->where('is_default', 1)
->findOrEmpty()
->toArray();
}
return $result;
}
/**
* @notes 省
* @param $value
* @param $data
* @return mixed
* @author ljj
* @date 2022/4/6 6:57 下午
*/
public function getProvinceAttr($value,$data)
{
return Region::where(['id'=>$data['province_id']])->value('name');
}
/**
* @notes 市
* @param $value
* @param $data
* @return mixed
* @author ljj
* @date 2022/4/6 7:02 下午
*/
public function getCityAttr($value,$data)
{
return Region::where(['id'=>$data['city_id']])->value('name');
}
/**
* @notes 区
* @param $value
* @param $data
* @return mixed
* @author ljj
* @date 2022/4/6 7:02 下午
*/
public function getDistrictAttr($value,$data)
{
return Region::where(['id'=>$data['district_id']])->value('name');
}
/**
* @notes 获取性别
* @param $value
* @param $data
* @return string
* @author cjhao
* @date 2024/10/12 10:54
*/
public function getGenderDescAttr($value,$data){
$genderData = [
1 => '先生',
2 => '女士',
];
return $genderData[$data['gender']] ?? '';
}
}

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\user;
use app\common\model\BaseModel;
class UserAuth extends BaseModel
{
}

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\user;
use app\common\model\BaseModel;
class UserSession extends BaseModel
{
}

View File

@@ -0,0 +1,122 @@
<?php
namespace app\common\model\withdraw;
use app\common\model\BaseModel;
use app\common\service\FileService;
/**
* 提现配置表
* Class WithdrawApply
* @package app\common\model\withdraw
*/
class WithdrawApply extends BaseModel
{
protected $json = ['withdraw_config_snap'];
// 设置JSON数据返回数组
protected $jsonAssoc = true;
/**
* @notes 审核状态
* @param $value
* @param $data
* @return string
* @author cjhao
* @date 2024/9/27 01:44
*/
public function getStatusDescAttr($value,$data)
{
$status = [
1=>'待审核',
2=>'审核成功',
3=>'审核失败',
4=>'提现中',
5=>'转账成功',
6=>'转账失败',
];
return $status[$data['status']] ?? '';
}
/**
* @notes 获取提现类型
* @param $value
* @param $data
* @return string
* @author cjhao
* @date 2024/11/20 21:59
*/
public function getTypeDesc($value,$data)
{
$type = [
1 => '微信',
2 => '支付宝',
3 => '银行卡',
];
return $type[$data['type']] ?? '';
}
/**
* @notes 提现类型
* @param $value
* @param $data
* @return string
* @author cjhao
* @date 2024/10/31 15:54
*/
public function getApplyTypeDescAttr($value,$data)
{
$desc = [
1 => '技师佣金提现',
2 => '技师保证金提现',
];
if(2 == $data['source']){
$desc = [
1 => '店铺佣金提现',
2 => '店铺保证金提现',
];
}
return $desc[$data['apply_type']] ?? '';
}
public function getTypeDescAttr($value,$data)
{
$desc = [
1 => '微信',
2 => '支付宝',
3 => '银行卡',
];
return $desc[$data['type']] ?? '';
}
/**
* @notes 补全图片路径
* @param $value
* @param $data
* @return string
* @author ljj
* @date 2022/2/17 6:11 下午
*/
public function getTransferProofAttr($value,$data)
{
return FileService::getFileUrl($value);
}
/**
* @notes 去掉图片路径
* @param $value
* @param $data
* @return string
* @author ljj
* @date 2022/2/17 6:11 下午
*/
public function setTransferProofAttr($value,$data)
{
return FileService::setFileUrl($value);
}
}

View File

@@ -0,0 +1,21 @@
<?php
namespace app\common\model\withdraw;
use app\common\model\BaseModel;
/**
* 提现配置表
* Class WithdrawConfig
* @package app\common\model\withdraw
*/
class WithdrawConfig extends BaseModel
{
protected $json = ['config'];
// 设置JSON数据返回数组
protected $jsonAssoc = true;
}