first commit

This commit is contained in:
云泽网
2025-07-27 21:42:34 +08:00
commit c1cce5ccb4
2779 changed files with 340042 additions and 0 deletions
@@ -0,0 +1,27 @@
<?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\admin\model;
use think\Model;
class AdPosition extends Model
{
protected $name = 'ad_position';
}
@@ -0,0 +1,24 @@
<?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\admin\model;
use think\Model;
class Article extends Model {
}
@@ -0,0 +1,24 @@
<?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\admin\model;
use think\Model;
class ArticleCategory extends Model {
}
+176
View File
@@ -0,0 +1,176 @@
<?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\admin\model;
use think\Db;
use think\Model;
class Coupon extends Model{
protected $autoWriteTimestamp = true;
protected $updateTime = 'update_time';
protected $createTime = 'create_time';
//开始发放时间
public function setSendTimeStartAttr($value,$data){
if($value){
return strtotime($value);
}
return $value;
}
//结束发放时间
public function setSendTimeEndAttr($value,$data){
if($value){
return strtotime($value);
}
return $value;
}
//修改使用时间
public function setUseTimeStartAttr($value,$data){
if($value){
return strtotime($value);
}
return $value;
}
//修改结束时间
public function setUseTimeEndAttr($value,$data){
if($value){
return strtotime($value);
}
return $value;
}
//优惠券面额
public function getMoneyAttr($value,$data){
if($value){
return '¥'.$value;
}
return $value;
}
//使用场景
public function getSceneTypeAttr($value,$data){
switch ($value){
case 1:
return '全场通用券';
default:
return '';
}
}
//使用门槛
public function getConditionTypeAttr($value,$data){
if($value == 1){
return '无门槛';
}
if($value == 2){
return '订单满'.$data['condition_money'].'元可用';
}
}
//
public function getUseTimeStartAttr($value,$data){
if($value){
return date('Y-m-d H:i:s',$value);
}
return $value;
}
public function getUseTimeEndAttr($value,$data){
if($value){
return date('Y-m-d H:i:s',$value);
}
return $value;
}
//用券时间
public function getSendTimeAttr($value,$data){
return date('Y-m-d H:i:s',$data['send_time_start']).'至' .date('Y-m-d H:i:s',$data['send_time_end']);
}
//用券时间
public function getUseTimeTypeAttr($value,$data){
if($value == 1){
return date('Y-m-d H:i:s',$data['use_time_start']).'至' .date('Y-m-d H:i:s',$data['use_time_end']);
}
if($value == 2){
return '领取当天起'.$data['use_time'].'天内可用';
}
if($value == 3){
return '领取次日起'.$data['use_time'].'天内可用';
}
}
//领取方式
public function getGetTypeAttr($value,$data){
switch ($value){
case 1:
return '直接领取';
case 2:
return '平台赠送';
case 3:
return '活动赠送';
default:
return '';
}
}
// //优惠券状态
// public function getStatusAttr($value,$data){
// $status = '已关闭';
// if($value == 1){
// $status = '进行中';
// }
// return $status;
// }
public function getStatusDescAttr($value,$data){
$status = '已关闭';
if($data['status'] == 1){
$status = '进行中';
}
return $status;
}
//发放总量
public function getSendTotalTypeAttr($value,$data){
if($value == 1){
return '不限制数量';
}
if($value == 2){
return '订单满'.$data['condition_money'].'元可用';
}
}
public function getGetNumTypeAttr($value,$data){
if($value == 1){
return '不限制领取次数';
}
if($value == 2){
return '限制领取'.$data['use_time'].'次';
}
if($value == 3){
return '每天限制领取'.$data['use_time'].'次';
}
}
//已发放
public static function getSentTotalAttr($value,$data){
$send_total = Db::name('coupon_list')->where(['coupon_id'=>$data['id']])->count();
$tips = '已发放:'.$send_total.'<br>';
if($data['send_total_type'] == 1){
$tips .= '待发放:不限量'.'<br>'.'发放总量:不限量';
}else{
$residue = $data['send_total'] - $send_total;
$residue = $residue >=0 ? $residue : 0;
$tips .= '待发放:'.$residue.'张'.'<br>'.'发放总量:'.$data['send_total'];
}
return $tips;
}
}
@@ -0,0 +1,55 @@
<?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\admin\model;
use think\Model;
/**
* 分销会员申请
* Class DistributionMemberApply
* @package app\common\model
*/
class DistributionMemberApply extends Model
{
/**
* 分销会员申请状态
*/
const STATUS_WAIT_AUDIT = 0; //待审核
const STATUS_AUDIT_SUCCESS = 1; //审核通过
const STATUS_AUDIT_ERROR = 2; //审核拒绝
public function user()
{
return $this->hasOne('app\common\model\User', 'id', 'user_id');
}
public static function getApplyStatus($status = true)
{
$desc = [
self::STATUS_WAIT_AUDIT => '待审核',
self::STATUS_AUDIT_SUCCESS => '审核通过',
self::STATUS_AUDIT_ERROR => '审核拒绝',
];
if ($status === true) {
return $desc;
}
return $desc[$status] ?? '未知';
}
}
@@ -0,0 +1,72 @@
<?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\admin\model;
use think\Model;
class Freight extends Model
{
protected $name = 'freight';
protected $autoWriteTimestamp = true;
//配送地区类型
const TYPE_ALL = 0;//全国
const TYPE_SPEC = 1;//指定地区
//能否设置全国模板
const ABLE_SET = 1;//能设置
const UNABLE_SET = 2;//不能设置
//计费方式
const CHARGE_WAY_WEIGHT = 1;//按重量计费
const CHARGE_WAY_VOLUME = 2; //体积计费
const CHARGE_WAY_PIECE = 3;//按件计费
public static function getChargeWay($type)
{
$data = [
self::CHARGE_WAY_WEIGHT => '按重量计费',
self::CHARGE_WAY_VOLUME => '按体积计费',
self::CHARGE_WAY_PIECE => '按件计费',
];
if ($type === true) {
return $data;
}
return $data[$type] ?? '未知';
}
public function getChargeWayTextAttr($value, $data)
{
return self::getChargeWay($data['charge_way']);
}
public function configs()
{
return $this->hasMany('freight_config', 'freight_id', 'id');
}
}
@@ -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\admin\model;
use think\Model;
class FreightConfig extends Model
{
protected $name = 'freight_config';
}
@@ -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\admin\model;
use think\Model;
class GoodsCategory extends Model{
/**
* 获取商品分类子类
* @return \think\model\relation\HasMany
*/
public function sons()
{
return $this->hasMany(self::class, 'pid','id')->where(['del'=>'0']);
}
}
+24
View File
@@ -0,0 +1,24 @@
<?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\admin\model;
use think\Model;
class Help extends Model {
}
@@ -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\admin\model;
use think\Model;
class HelpCategory extends Model
{
protected $name = 'help_category';
public function getCreateTimeAttr($value, $data)
{
if($value){
return date('Y-m-d H:i:s', $value);
}
return $value;
}
public function getIsShowTextAttr($value, $data)
{
if ($data['is_show'] == 1){
return '启用';
}
return '停用';
}
}
+134
View File
@@ -0,0 +1,134 @@
<?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\admin\model;
use app\common\model\Distribution;
use app\common\server\UrlServer;
use think\Db;
use think\Model;
class User extends Model
{
//头像
public function getAvatarAttr($value,$data){
// if($value){
// return UrlServer::getFileUrl($value);
// }
return $value;
}
//加入时间
public function getCreateTimeAttr($value,$data)
{
return date('Y-m-d H:i:s',$value);
}
//性别转换
public function getSexAttr($value,$data){
switch ($value){
case 1:
return '男';
case 2:
return '女';
default:
return '未知';
}
}
public function getBirthdayAttr($value,$data){
if($value){
return date('Y-m-d',$value);
}
return $value;
}
public function getUserMoneyAttr($value,$data){
return '¥'.$value;
}
public function getTotalOrderAmountAttr($value,$data){
return '¥'.$value;
}
//最后登录时间
public function getLoginTimeAttr($value,$data){
return date('Y-m-d H:i:s',$value);
}
public function getLevelNameAttr($value,$data){
$leve_name = '-';
if($data['level']){
$leve_name = Db::name('user_level')->where(['id'=>$data['level']])->value('name');
}
return $leve_name;
}
public function getGroupNameAttr($value,$data){
$user_group = '-';
if($data['group_id']){
$user_group = Db::name('user_group')->where(['del'=>0,'id'=>$data['group_id']])->value('name');
}
return $user_group;
}
//获取粉丝
public function getFansAttr($value, $data)
{
$fans = Db::name('user')->where('find_in_set(' . $data['id'] . ', ancestor_relation)')->count();
return $fans;
}
//分销订单
public function getDistributionOrderAttr($value, $data)
{
$info = Db::name('distribution_order_goods d')
->join('order_goods g', 'g.id = d.order_goods_id')
->join('order o', 'o.id = g.order_id')
->field('count(d.id) as num, sum(money) as money, sum(order_amount) as amount')
->where(['d.user_id' => $data['id'], 'd.status' => 2])
->find();
return $info;
}
public function getDistributionAttr($value)
{
$distribution = Distribution::where('user_id', $value)->findOrEmpty()->toArray();
if (!empty($distribution) && $distribution['is_distribution'] == 1) {
return '是';
}
return '否';
}
/**
* @notes 获取用户数量
* @param null $condition
* @return User
* @author 段誉
* @date 2022/4/27 11:24
*/
public static function getUserCount($condition = null)
{
$where[] = ['del', '=', 0];
if (!is_null($condition)) {
$where[] = $condition;
}
return self::where($where)->count('id');
}
}
@@ -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\admin\model;
use think\Model;
class WithdrawApply extends Model
{
protected $name = 'withdraw_apply';
}