init commit
This commit is contained in:
78
application/admin/model/wdsxh/Album.php
Normal file
78
application/admin/model/wdsxh/Album.php
Normal file
@@ -0,0 +1,78 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | 麦沃德科技赋能开发者,助力商协会发展
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2017~2024 www.wdsxh.cn All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | 沃德商协会系统并不是自由软件,不加密,并不代表开源,未经许可不可自由转售和商用
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: MY WORLD Team <bd@maiwd.cn> www.maiwd.cn
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\admin\model\wdsxh;
|
||||
|
||||
use think\Model;
|
||||
use traits\model\SoftDelete;
|
||||
|
||||
class Album extends Model
|
||||
{
|
||||
|
||||
use SoftDelete;
|
||||
|
||||
|
||||
|
||||
// 表名
|
||||
protected $name = 'wdsxh_album';
|
||||
|
||||
// 自动写入时间戳字段
|
||||
protected $autoWriteTimestamp = 'integer';
|
||||
|
||||
// 定义时间戳字段名
|
||||
protected $createTime = 'createtime';
|
||||
protected $updateTime = 'updatetime';
|
||||
protected $deleteTime = 'deletetime';
|
||||
|
||||
// 追加属性
|
||||
protected $append = [
|
||||
'type_text',
|
||||
'status_text'
|
||||
];
|
||||
|
||||
|
||||
protected static function init()
|
||||
{
|
||||
self::afterInsert(function ($row) {
|
||||
$pk = $row->getPk();
|
||||
$row->getQuery()->where($pk, $row[$pk])->update(['weigh' => $row[$pk]]);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
public function getTypeList()
|
||||
{
|
||||
return ['1' => __('Type 1'), '2' => __('Type 2')];
|
||||
}
|
||||
|
||||
public function getStatusList()
|
||||
{
|
||||
return ['normal' => __('Status normal'), 'hidden' => __('Status hidden')];
|
||||
}
|
||||
|
||||
public function getTypeTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : (isset($data['type']) ? $data['type'] : '');
|
||||
$list = $this->getTypeList();
|
||||
return isset($list[$value]) ? $list[$value] : '';
|
||||
}
|
||||
|
||||
|
||||
public function getStatusTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : (isset($data['status']) ? $data['status'] : '');
|
||||
$list = $this->getStatusList();
|
||||
return isset($list[$value]) ? $list[$value] : '';
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
50
application/admin/model/wdsxh/AlbumConfig.php
Normal file
50
application/admin/model/wdsxh/AlbumConfig.php
Normal file
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | 麦沃德科技赋能开发者,助力商协会发展
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2017~2024 www.wdsxh.cn All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | 沃德商协会系统并不是自由软件,不加密,并不代表开源,未经许可不可自由转售和商用
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: MY WORLD Team <bd@maiwd.cn> www.maiwd.cn
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\admin\model\wdsxh;
|
||||
|
||||
use think\Model;
|
||||
|
||||
class AlbumConfig extends Model
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
// 表名
|
||||
protected $name = 'wdsxh_album_config';
|
||||
|
||||
// 自动写入时间戳字段
|
||||
protected $autoWriteTimestamp = 'integer';
|
||||
|
||||
// 定义时间戳字段名
|
||||
protected $createTime = 'createtime';
|
||||
protected $updateTime = 'updatetime';
|
||||
|
||||
public function getIsStatusList()
|
||||
{
|
||||
return ['1' => __('全部开放'), '2' => __('部分开放'), '3' => __('会员专属(只有会员才能查看)')];
|
||||
}
|
||||
|
||||
public function getIsStateTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : (isset($data['is_status']) ? $data['is_status'] : '');
|
||||
$list = $this->getIsStatusList();
|
||||
return isset($list[$value]) ? $list[$value] : '';
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
83
application/admin/model/wdsxh/Banner.php
Normal file
83
application/admin/model/wdsxh/Banner.php
Normal file
@@ -0,0 +1,83 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | 麦沃德科技赋能开发者,助力商协会发展
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2017~2024 www.wdsxh.cn All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | 沃德商协会系统并不是自由软件,不加密,并不代表开源,未经许可不可自由转售和商用
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: MY WORLD Team <bd@maiwd.cn> www.maiwd.cn
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\admin\model\wdsxh;
|
||||
|
||||
use think\Model;
|
||||
|
||||
|
||||
class Banner extends Model
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// 表名
|
||||
protected $name = 'wdsxh_banner';
|
||||
|
||||
// 自动写入时间戳字段
|
||||
protected $autoWriteTimestamp = 'integer';
|
||||
|
||||
// 定义时间戳字段名
|
||||
protected $createTime = 'createtime';
|
||||
protected $updateTime = false;
|
||||
protected $deleteTime = false;
|
||||
|
||||
// 追加属性
|
||||
protected $append = [
|
||||
'jump_type_text',
|
||||
'status_text'
|
||||
];
|
||||
|
||||
|
||||
protected static function init()
|
||||
{
|
||||
self::afterInsert(function ($row) {
|
||||
$pk = $row->getPk();
|
||||
$row->getQuery()->where($pk, $row[$pk])->update(['weigh' => $row[$pk]]);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
public function getJumpTypeList()
|
||||
{
|
||||
return ['1' => __('Jump_type 1'), '2' => __('Jump_type 2'), '3' => __('Jump_type 3'), '4' => __('Jump_type 4')];
|
||||
}
|
||||
|
||||
public function getStatusList()
|
||||
{
|
||||
return ['0' => __('Status 0'), '1' => __('Status 1')];
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public function getJumpTypeTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : (isset($data['jump_type']) ? $data['jump_type'] : '');
|
||||
$list = $this->getJumpTypeList();
|
||||
return isset($list[$value]) ? $list[$value] : '';
|
||||
}
|
||||
|
||||
|
||||
public function getStatusTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : (isset($data['status']) ? $data['status'] : '');
|
||||
$list = $this->getStatusList();
|
||||
return isset($list[$value]) ? $list[$value] : '';
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
40
application/admin/model/wdsxh/CompanyGoods.php
Normal file
40
application/admin/model/wdsxh/CompanyGoods.php
Normal file
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
namespace app\admin\model\wdsxh;
|
||||
|
||||
use think\Model;
|
||||
|
||||
|
||||
class CompanyGoods extends Model
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// 表名
|
||||
protected $name = 'wdsxh_company_goods';
|
||||
|
||||
// 自动写入时间戳字段
|
||||
protected $autoWriteTimestamp = 'integer';
|
||||
|
||||
// 定义时间戳字段名
|
||||
protected $createTime = 'createtime';
|
||||
protected $updateTime = 'updatetime';
|
||||
protected $deleteTime = false;
|
||||
|
||||
// 追加属性
|
||||
protected $append = [
|
||||
|
||||
];
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
74
application/admin/model/wdsxh/Config.php
Normal file
74
application/admin/model/wdsxh/Config.php
Normal file
@@ -0,0 +1,74 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | 麦沃德科技赋能开发者,助力商协会发展
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2017~2024 www.wdsxh.cn All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | 沃德商协会系统并不是自由软件,不加密,并不代表开源,未经许可不可自由转售和商用
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: MY WORLD Team <bd@maiwd.cn> www.maiwd.cn
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\admin\model\wdsxh;
|
||||
|
||||
use think\Model;
|
||||
|
||||
|
||||
class Config extends Model
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// 表名
|
||||
protected $name = 'wdsxh_config';
|
||||
|
||||
// 自动写入时间戳字段
|
||||
protected $autoWriteTimestamp = false;
|
||||
|
||||
// 定义时间戳字段名
|
||||
protected $createTime = false;
|
||||
protected $updateTime = false;
|
||||
protected $deleteTime = false;
|
||||
|
||||
// 追加属性
|
||||
protected $append = [
|
||||
'organize_text',
|
||||
'applet_member_expiretime_text',
|
||||
'wananchi_member_expiretime_text'
|
||||
];
|
||||
|
||||
|
||||
|
||||
public function getOrganizeList()
|
||||
{
|
||||
return ['1' => __('Organize 1'), '2' => __('Organize 2')];
|
||||
}
|
||||
|
||||
|
||||
public function getOrganizeTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : (isset($data['organize']) ? $data['organize'] : '');
|
||||
$list = $this->getOrganizeList();
|
||||
return isset($list[$value]) ? $list[$value] : '';
|
||||
}
|
||||
|
||||
public function getJumpTypeList()
|
||||
{
|
||||
return ['1' => __('Jump_type 1'), '2' => __('Jump_type 2'), '3' => __('Jump_type 3')];
|
||||
}
|
||||
|
||||
public function getSecurityTextSwitchList(){//todo 腾讯校验增加开关
|
||||
return ['1' => '打开', '2' => '关闭'];
|
||||
}
|
||||
|
||||
public function getDeliveryManagementList(){
|
||||
return ['1' => __('开启'), '2' => __('关闭')];
|
||||
}
|
||||
|
||||
public function getDataScreenPasswordSwitchList(){
|
||||
return ['1' => __('开启'), '2' => __('关闭')];
|
||||
}
|
||||
|
||||
}
|
||||
64
application/admin/model/wdsxh/Demand.php
Normal file
64
application/admin/model/wdsxh/Demand.php
Normal file
@@ -0,0 +1,64 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | 麦沃德科技赋能开发者,助力商协会发展
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2017~2024 www.wdsxh.cn All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | 沃德商协会系统并不是自由软件,不加密,并不代表开源,未经许可不可自由转售和商用
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: MY WORLD Team <bd@maiwd.cn> www.maiwd.cn
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\admin\model\wdsxh;
|
||||
|
||||
use think\Model;
|
||||
use traits\model\SoftDelete;
|
||||
|
||||
class Demand extends Model
|
||||
{
|
||||
|
||||
use SoftDelete;
|
||||
|
||||
|
||||
|
||||
// 表名
|
||||
protected $name = 'wdsxh_demand';
|
||||
|
||||
// 自动写入时间戳字段
|
||||
protected $autoWriteTimestamp = 'integer';
|
||||
|
||||
// 定义时间戳字段名
|
||||
protected $createTime = 'createtime';
|
||||
protected $updateTime = 'updatetime';
|
||||
protected $deleteTime = 'deletetime';
|
||||
|
||||
// 追加属性
|
||||
protected $append = [
|
||||
'is_anonymity_text'
|
||||
];
|
||||
|
||||
protected $type = [
|
||||
'processing_time' => 'timestamp:Y-m-d H:i:s',
|
||||
];
|
||||
|
||||
public function getIsAnonymityList()
|
||||
{
|
||||
return ['1' => __('Is_anonymity 1'), '2' => __('Is_anonymity 2')];
|
||||
}
|
||||
|
||||
|
||||
public function getIsAnonymityTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : (isset($data['is_anonymity']) ? $data['is_anonymity'] : '');
|
||||
$list = $this->getIsAnonymityList();
|
||||
return isset($list[$value]) ? $list[$value] : '';
|
||||
}
|
||||
|
||||
public function wechat()
|
||||
{
|
||||
return $this->belongsTo('app\admin\model\wdsxh\user\UserWechat','wechat_id','id')->setEagerlyType(0);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
902
application/admin/model/wdsxh/DiyPage.php
Normal file
902
application/admin/model/wdsxh/DiyPage.php
Normal file
@@ -0,0 +1,902 @@
|
||||
<?php
|
||||
|
||||
namespace app\admin\model\wdsxh;
|
||||
|
||||
use app\admin\model\wdsxh\article\ArticleCat;
|
||||
|
||||
use think\Model;
|
||||
use traits\model\SoftDelete;
|
||||
use think\Db;
|
||||
|
||||
class DiyPage extends Model
|
||||
{
|
||||
|
||||
use SoftDelete;
|
||||
|
||||
|
||||
|
||||
// 表名
|
||||
protected $name = 'wdsxh_diy_page';
|
||||
|
||||
// 自动写入时间戳字段
|
||||
protected $autoWriteTimestamp = 'integer';
|
||||
|
||||
// 定义时间戳字段名
|
||||
protected $createTime = 'createtime';
|
||||
protected $updateTime = 'updatetime';
|
||||
protected $deleteTime = 'deletetime';
|
||||
|
||||
// 追加属性
|
||||
protected $append = [
|
||||
'status_text'
|
||||
];
|
||||
|
||||
|
||||
|
||||
public function getStatusList()
|
||||
{
|
||||
return ['home' => __('Status home'), 'custom' => __('Status custom')];
|
||||
}
|
||||
|
||||
|
||||
public function getStatusTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : (isset($data['status']) ? $data['status'] : '');
|
||||
$list = $this->getStatusList();
|
||||
return isset($list[$value]) ? $list[$value] : '';
|
||||
}
|
||||
|
||||
/**
|
||||
* 页面默认样式数据
|
||||
*/
|
||||
public function getDefaultStyle($url)
|
||||
{
|
||||
return [
|
||||
// 轮播图
|
||||
'carouselDiy' => [
|
||||
'name' => '轮播图',
|
||||
'type' => 'carouselDiy',
|
||||
'style' => [
|
||||
'background' => '',
|
||||
'itemBorderRadius' => 0,
|
||||
'dotColor' => '#409EFF',
|
||||
'height' => 180,
|
||||
'paddingTop' => 0,
|
||||
'paddingLeft' => 0,
|
||||
'borderRadius' => 0,
|
||||
],
|
||||
'params' => [
|
||||
'type' => 'normal',
|
||||
'interval' => 3000,
|
||||
],
|
||||
'data' => [
|
||||
[
|
||||
'imgUrl' => '/assets/addons/wdsxh/img/banner.png',
|
||||
'link' => null
|
||||
],
|
||||
[
|
||||
'imgUrl' => '/assets/addons/wdsxh/img/banner.png',
|
||||
'link' => null
|
||||
]
|
||||
]
|
||||
],
|
||||
// 单图组
|
||||
'imagesDiy' => [
|
||||
'name' => '单图组',
|
||||
'type' => 'imagesDiy',
|
||||
'style' => [
|
||||
'background' => '',
|
||||
'itemBorderRadius' => 0,
|
||||
'borderRadius' => 0,
|
||||
'paddingTop' => 0,
|
||||
'paddingLeft' => 0,
|
||||
'itemSpace' => 0,
|
||||
],
|
||||
'data' => [
|
||||
[
|
||||
'imgUrl' => '/assets/addons/wdsxh/img/image.png',
|
||||
'link' => null
|
||||
]
|
||||
]
|
||||
],
|
||||
// 导航组
|
||||
'navDiy' => [
|
||||
'name' => '导航组',
|
||||
'type' => 'navDiy',
|
||||
'style' => [
|
||||
'background' => '',
|
||||
'itemBorderRadius' => 0,
|
||||
'rowsLimit' => -1,
|
||||
'dotColor' => '#409EFF',
|
||||
'rowsNum' => 4,
|
||||
'iconSize' => 44,
|
||||
'borderRadius' => 0,
|
||||
'fontSize' => 14,
|
||||
'textColor' => '#666666',
|
||||
'paddingTop' => 16,
|
||||
'paddingLeft' => 0,
|
||||
'itemSpace' => 16,
|
||||
],
|
||||
'data' => [
|
||||
[
|
||||
'imgUrl' => '/assets/addons/wdsxh/img/menu.png',
|
||||
'link' => null,
|
||||
'text' => '导航标题',
|
||||
],
|
||||
[
|
||||
'imgUrl' => '/assets/addons/wdsxh/img/menu.png',
|
||||
'link' => null,
|
||||
'text' => '导航标题',
|
||||
],
|
||||
[
|
||||
'imgUrl' => '/assets/addons/wdsxh/img/menu.png',
|
||||
'link' => null,
|
||||
'text' => '导航标题',
|
||||
],
|
||||
[
|
||||
'imgUrl' => '/assets/addons/wdsxh/img/menu.png',
|
||||
'link' => null,
|
||||
'text' => '导航标题',
|
||||
],
|
||||
[
|
||||
'imgUrl' => '/assets/addons/wdsxh/img/menu.png',
|
||||
'link' => null,
|
||||
'text' => '导航标题',
|
||||
],
|
||||
[
|
||||
'imgUrl' => '/assets/addons/wdsxh/img/menu.png',
|
||||
'link' => null,
|
||||
'text' => '导航标题',
|
||||
],
|
||||
[
|
||||
'imgUrl' => '/assets/addons/wdsxh/img/menu.png',
|
||||
'link' => null,
|
||||
'text' => '导航标题',
|
||||
],
|
||||
[
|
||||
'imgUrl' => '/assets/addons/wdsxh/img/menu.png',
|
||||
'link' => null,
|
||||
'text' => '导航标题',
|
||||
]
|
||||
]
|
||||
],
|
||||
// 图片魔方
|
||||
'cubeDiy' => [
|
||||
'name' => '图片魔方',
|
||||
'type' => 'cubeDiy',
|
||||
'style' => [
|
||||
'background' => '',
|
||||
'itemBorderRadius' => 0,
|
||||
'layout' => 2,
|
||||
'model' => 1,
|
||||
'imgWidth' => 60,
|
||||
'imgFloat' => "left",
|
||||
'borderRadius' => 0,
|
||||
'paddingTop' => 0,
|
||||
'paddingLeft' => 0,
|
||||
'itemSpace' => 0,
|
||||
],
|
||||
'data' => [
|
||||
[
|
||||
'imgUrl' => '/assets/addons/wdsxh/img/cube.png',
|
||||
'link' => null
|
||||
],
|
||||
[
|
||||
'imgUrl' => '/assets/addons/wdsxh/img/cube.png',
|
||||
'link' => null
|
||||
],
|
||||
[
|
||||
'imgUrl' => '/assets/addons/wdsxh/img/cube.png',
|
||||
'link' => null
|
||||
],
|
||||
[
|
||||
'imgUrl' => '/assets/addons/wdsxh/img/cube.png',
|
||||
'link' => null
|
||||
]
|
||||
],
|
||||
],
|
||||
// 信息卡片
|
||||
'infoCardDiy' => [
|
||||
'name' => '信息卡片',
|
||||
'type' => 'infoCardDiy',
|
||||
'params' => [
|
||||
'title' => '此处是信息卡片标题',
|
||||
'image' => '/assets/addons/wdsxh/img/menu.png',
|
||||
'content' => '此处是信息卡片内容',
|
||||
'btnTxt' => '查看详情',
|
||||
'link' => null
|
||||
],
|
||||
'style' => [
|
||||
'background' => '',
|
||||
'itemBorderRadius' => 0,
|
||||
'borderRadius' => 0,
|
||||
'btnBorderRadius' => 0,
|
||||
'btnBackground' => '#409EFF',
|
||||
'btnColor' => '#FFFFFF',
|
||||
'paddingTop' => 0,
|
||||
'paddingLeft' => 0,
|
||||
]
|
||||
],
|
||||
// 按钮组
|
||||
'textButtonDiy' => [
|
||||
'name' => '按钮组',
|
||||
'type' => 'textButtonDiy',
|
||||
'style' => [
|
||||
'background' => '',
|
||||
'itemBorderRadius' => 0,
|
||||
'fontSize' => 14,
|
||||
'textColor' => '#666666',
|
||||
'paddingTop' => 0,
|
||||
'paddingLeft' => 0,
|
||||
],
|
||||
'data' => [
|
||||
[
|
||||
'link' => null,
|
||||
'text' => '按钮文字1',
|
||||
],
|
||||
[
|
||||
'link' => null,
|
||||
'text' => '按钮文字2',
|
||||
],
|
||||
[
|
||||
'link' => null,
|
||||
'text' => '按钮文字3',
|
||||
]
|
||||
]
|
||||
],
|
||||
// 标题
|
||||
'titleDiy' => [
|
||||
'name' => '标题',
|
||||
'type' => 'titleDiy',
|
||||
'style' => [
|
||||
'background' => '',
|
||||
'itemBorderRadius' => 0,
|
||||
'color' => "#000000",
|
||||
'fontSize' => 14,
|
||||
'fontStyle' => "normal",
|
||||
'btnSize' => 12,
|
||||
'iconSize' => 16,
|
||||
'btnColor' => "#888888",
|
||||
'paddingTop' => 10,
|
||||
'paddingLeft' => 0,
|
||||
],
|
||||
'params' => [
|
||||
'title' => "标题文字",
|
||||
'btnType' => "text",
|
||||
'btnText' => "查看更多",
|
||||
'link' => null,
|
||||
]
|
||||
],
|
||||
// 视频
|
||||
'videoDiy' => [
|
||||
'name' => '视频',
|
||||
'type' => 'videoDiy',
|
||||
'params' => [
|
||||
'videoUrl' => 'https://qiniu-web-assets.dcloud.net.cn/unidoc/zh/uni-app-video-courses.mp4',
|
||||
'poster' => 'https://qiniu-web-assets.dcloud.net.cn/unidoc/zh/dcloudPoster.jpg',
|
||||
'autoplay' => '2'
|
||||
],
|
||||
'style' => [
|
||||
'background' => '',
|
||||
'itemBorderRadius' => 0,
|
||||
'paddingTop' => 0,
|
||||
'paddingLeft' => 0,
|
||||
]
|
||||
],
|
||||
// 地图
|
||||
'mapDiy' => [
|
||||
'name' => '地图',
|
||||
'type' => 'mapDiy',
|
||||
'params' => [
|
||||
'latitude' => 36.04,
|
||||
'longitude' => 120.2,
|
||||
],
|
||||
'style' => [
|
||||
'background' => '',
|
||||
'itemBorderRadius' => 0,
|
||||
'height' => 160,
|
||||
'borderRadius' => 0,
|
||||
'paddingTop' => 0,
|
||||
'paddingLeft' => 0,
|
||||
]
|
||||
],
|
||||
// 新闻资讯
|
||||
'articleDiy' => [
|
||||
'name' => '新闻资讯',
|
||||
'type' => 'articleDiy',
|
||||
'params' => [
|
||||
'showTitle' => true,
|
||||
'titleText' => "新闻资讯",
|
||||
'titleBtnType' => "text",
|
||||
'titleBtnText' => "more+",
|
||||
'showImg' => true,
|
||||
'category' => '',
|
||||
'categoryName' => '',
|
||||
'count' => 3,
|
||||
'showReadNum' => true,
|
||||
],
|
||||
'style' => [
|
||||
'titleColor' => "#000000",
|
||||
'titleFontSize' => 16,
|
||||
'titleFontStyle' => "normal",
|
||||
'titleBtnSize' => 12,
|
||||
'titleBtnColor' => "#888888",
|
||||
'titleIconSize' => 16,
|
||||
'titleSpace' => 16,
|
||||
'background' => '',
|
||||
'itemBorderRadius' => 0,
|
||||
'imgWidth' => 110,
|
||||
'imgHeight' => 96,
|
||||
'imgFloat' => 'left',
|
||||
'borderRadius' => 5,
|
||||
'nameSize' => 14,
|
||||
'nameWeight' => 'normal',
|
||||
'dateSize' => 12,
|
||||
'paddingTop' => 0,
|
||||
'paddingLeft' => 0,
|
||||
'itemSpace' => 16,
|
||||
]
|
||||
],
|
||||
// 商会介绍
|
||||
'introduceDiy' => [
|
||||
'name' => '商会介绍',
|
||||
'type' => 'introduceDiy',
|
||||
'params' => [
|
||||
'showImg' => true,
|
||||
'imgUrl' => '/assets/addons/wdsxh/img/menu.png',
|
||||
'name' => '沃德商协会',
|
||||
'btnName' => '商会介绍',
|
||||
],
|
||||
'style' => [
|
||||
'background' => '',
|
||||
'itemBorderRadius' => 0,
|
||||
'borderRadius' => 0,
|
||||
'iconSize' => 40,
|
||||
'btnBorderRadius' => 8,
|
||||
'btnSize' => 14,
|
||||
'btnColor1' => '#325DFF',
|
||||
'btnColor2' => '#489FFF',
|
||||
'nameSize' => 16,
|
||||
'nameWeight' => 'normal',
|
||||
'paddingTop' => 0,
|
||||
'paddingLeft' => 0,
|
||||
]
|
||||
],
|
||||
// 会员列表
|
||||
'memberDiy' => [
|
||||
'name' => '会员列表',
|
||||
'type' => 'memberDiy',
|
||||
'params' => [
|
||||
'showTitle' => true,
|
||||
'titleText' => "会员列表",
|
||||
'titleBtnType' => "text",
|
||||
'titleBtnText' => "more+",
|
||||
'count' => 5
|
||||
],
|
||||
'style' => [
|
||||
'titleColor' => "#000000",
|
||||
'titleFontSize' => 16,
|
||||
'titleFontStyle' => "normal",
|
||||
'titleBtnSize' => 12,
|
||||
'titleBtnColor' => "#888888",
|
||||
'titleIconSize' => 16,
|
||||
'titleSpace' => 16,
|
||||
'background' => '',
|
||||
'itemBorderRadius' => 0,
|
||||
'isAutoRoll'=> false,
|
||||
'rollDelay'=> 2000,
|
||||
'rollSpeed'=> 1000,
|
||||
'iconSize' => 64,
|
||||
'iconRadius' => 50,
|
||||
'pSize' => 12,
|
||||
'pRadiusType' => 'half',
|
||||
'pRadius' => 12,
|
||||
'pColor' => '#fff',
|
||||
'pBackground' => '#325DFF',
|
||||
'nameSize' => 14,
|
||||
'nameColor' => "#333333",
|
||||
'paddingTop' => 0,
|
||||
'paddingLeft' => 0,
|
||||
'itemSpace' => 16,
|
||||
],
|
||||
],
|
||||
// 商会活动
|
||||
'activityDiy' => [
|
||||
'name' => '商会活动',
|
||||
'type' => 'activityDiy',
|
||||
'params' => [
|
||||
'showTitle' => true,
|
||||
'titleText' => "商会活动",
|
||||
'titleBtnType' => "text",
|
||||
'titleBtnText' => "more+",
|
||||
'showImg' => true,
|
||||
'count' => 3
|
||||
],
|
||||
'style' => [
|
||||
'titleColor' => "#000000",
|
||||
'titleFontSize' => 16,
|
||||
'titleFontStyle' => "normal",
|
||||
'titleBtnSize' => 12,
|
||||
'titleBtnColor' => "#888888",
|
||||
'titleIconSize' => 16,
|
||||
'titleSpace' => 16,
|
||||
'background' => '',
|
||||
'itemBorderRadius' => 0,
|
||||
'imgWidth' => 110,
|
||||
'imgHeight' => 80,
|
||||
'borderRadius' => 8,
|
||||
'nameSize' => 14,
|
||||
'nameWeight' => 'normal',
|
||||
'showIcon' => true,
|
||||
'iconSize' => 16,
|
||||
'iconColor' => '#325DFF',
|
||||
'contentSize' => 12,
|
||||
'paddingTop' => 0,
|
||||
'paddingLeft' => 0,
|
||||
'itemSpace' => 16,
|
||||
],
|
||||
],
|
||||
// 活动接龙
|
||||
'chainsDiy' => [
|
||||
'name' => '活动接龙',
|
||||
'type' => 'chainsDiy',
|
||||
'params' => [
|
||||
'showTitle' => true,
|
||||
'titleText' => "活动接龙",
|
||||
'titleBtnType' => "text",
|
||||
'titleBtnText' => "more+",
|
||||
'count' => 2
|
||||
],
|
||||
'style' => [
|
||||
'titleColor' => "#000000",
|
||||
'titleFontSize' => 16,
|
||||
'titleFontStyle' => "normal",
|
||||
'titleBtnSize' => 12,
|
||||
'titleBtnColor' => "#888888",
|
||||
'titleIconSize' => 16,
|
||||
'titleSpace' => 16,
|
||||
'background' => '',
|
||||
'itemBorderRadius' => 0,
|
||||
'nameSize' => 14,
|
||||
'nameWeight' => 'normal',
|
||||
'contentSize' => 12,
|
||||
'showIcon' => true,
|
||||
'iconSize' => 16,
|
||||
'iconColor' => '#325DFF',
|
||||
'btnSize' => 14,
|
||||
'paddingTop' => 0,
|
||||
'paddingLeft' => 0,
|
||||
'itemSpace' => 16,
|
||||
],
|
||||
],
|
||||
// 活动相册
|
||||
'albumDiy' => [
|
||||
'name' => '活动相册',
|
||||
'type' => 'albumDiy',
|
||||
'params' => [
|
||||
'showTitle' => true,
|
||||
'titleText' => "活动相册",
|
||||
'titleBtnType' => "text",
|
||||
'titleBtnText' => "more+",
|
||||
'count' => 2
|
||||
],
|
||||
'style' => [
|
||||
'titleColor' => "#000000",
|
||||
'titleFontSize' => 16,
|
||||
'titleFontStyle' => "normal",
|
||||
'titleBtnSize' => 12,
|
||||
'titleBtnColor' => "#888888",
|
||||
'titleIconSize' => 16,
|
||||
'titleSpace' => 16,
|
||||
'background' => '',
|
||||
'itemBorderRadius' => 0,
|
||||
'timeSize' =>16,
|
||||
'iconColor' => '#325DFF',
|
||||
'nameSize' => 14,
|
||||
'nameWeight' => 'normal',
|
||||
'borderRadius' => 8,
|
||||
'paddingTop' => 0,
|
||||
'paddingLeft' => 0,
|
||||
'itemSpace' => 16,
|
||||
],
|
||||
],
|
||||
// 商城商品
|
||||
'goodsDiy' => [
|
||||
'name' => '商城商品',
|
||||
'type' => 'goodsDiy',
|
||||
'params' => [
|
||||
'showTitle' => true,
|
||||
'titleText' => "商城商品",
|
||||
'titleBtnType' => "text",
|
||||
'titleBtnText' => "more+",
|
||||
'count' => 4
|
||||
],
|
||||
'style' => [
|
||||
'titleColor' => "#000000",
|
||||
'titleFontSize' => 16,
|
||||
'titleFontStyle' => "normal",
|
||||
'titleBtnSize' => 12,
|
||||
'titleBtnColor' => "#888888",
|
||||
'titleIconSize' => 16,
|
||||
'titleSpace' => 16,
|
||||
'background' => '',
|
||||
'itemBorderRadius' => 0,
|
||||
'imgHeight' => 148,
|
||||
'borderRadius' => 10,
|
||||
'nameSize' => 14,
|
||||
'nameWeight' => 'normal',
|
||||
'priceSize' => 14,
|
||||
'priceColor' => '#325DFF',
|
||||
'paddingTop' => 0,
|
||||
'paddingLeft' => 0,
|
||||
'itemSpace' => 16,
|
||||
],
|
||||
],
|
||||
// 会员供需
|
||||
'demandDiy' => [
|
||||
'name' => '会员供需',
|
||||
'type' => 'demandDiy',
|
||||
'params' => [
|
||||
'showTitle' => true,
|
||||
'titleText' => "会员供需",
|
||||
'titleBtnType' => "text",
|
||||
'titleBtnText' => "more+",
|
||||
'showContact' => true,
|
||||
'category' => '',
|
||||
'categoryName' => '',
|
||||
'count' => 2,
|
||||
],
|
||||
'style' => [
|
||||
'titleColor' => "#000000",
|
||||
'titleFontSize' => 16,
|
||||
'titleFontStyle' => "normal",
|
||||
'titleBtnSize' => 12,
|
||||
'titleBtnColor' => "#888888",
|
||||
'titleIconSize' => 16,
|
||||
'titleSpace' => 16,
|
||||
'background' => '',
|
||||
'itemBorderRadius' => 0,
|
||||
'btnColor' => '#325DFF',
|
||||
'btnTextColor' => '#ffffff',
|
||||
'nameSize' => 16,
|
||||
'nameWeight' => 'bold',
|
||||
'contentSize' => 14,
|
||||
'addressColor' => '#325DFF',
|
||||
'paddingTop' => 0,
|
||||
'paddingLeft' => 0,
|
||||
'itemSpace' => 16,
|
||||
],
|
||||
],
|
||||
// 会员地图
|
||||
'memberMapDiy' => [
|
||||
'name' => '会员地图',
|
||||
'type' => 'memberMapDiy',
|
||||
'map' => [
|
||||
'background' => '',
|
||||
'itemBorderRadius' => 0,
|
||||
'heightType' => 1,
|
||||
'height' => 200,
|
||||
'borderRadius' => 0,
|
||||
'paddingTop' => 0,
|
||||
'paddingLeft' => 0,
|
||||
],
|
||||
'category' => [
|
||||
'type' => 1,
|
||||
'background' => '#FFFFFF',
|
||||
'styleMode' => 1,
|
||||
'position' => 'left',
|
||||
'borderRadius' => 8,
|
||||
'widthType' => 1,
|
||||
'widthNumber' => 32,
|
||||
'marginTop' => 16,
|
||||
'marginLeft' => 16,
|
||||
'expandColor' => '#325DFF',
|
||||
'paddingTop' => 8,
|
||||
'paddingLeft' => 8,
|
||||
'itemSpace' => 8,
|
||||
'btnBackground' => '#F6F7FB',
|
||||
'btnActiveBackground' => '#325DFF',
|
||||
'btnColor' => '#5A5B6E',
|
||||
'btnActiveColor' => '#FFFFFF',
|
||||
'btnBorderRadius' => 8,
|
||||
'btnPaddingTop' => 8,
|
||||
'btnPaddingLeft' => 16,
|
||||
],
|
||||
],
|
||||
// 搜索
|
||||
'searchDiy' => [
|
||||
'name' => '搜索',
|
||||
'type' => 'searchDiy',
|
||||
'params' => [
|
||||
'placeholder' => '请输入关键词搜索',
|
||||
],
|
||||
'style' => [
|
||||
'background' => '',
|
||||
'itemBorderRadius' => 0,
|
||||
'iconColor' => '#BBBBBB',
|
||||
'iconSize' => 20,
|
||||
'placeholderColor' => '#BBBBBB',
|
||||
'inputColor' => '#5A5B6E',
|
||||
'fontSize' => 14,
|
||||
'inputBackground' => '#FFFFFF',
|
||||
'inputBorderRadius' => 5,
|
||||
'inputPaddingTop' => 10,
|
||||
'inputPaddingLeft' => 16,
|
||||
'paddingTop' => 8,
|
||||
'paddingLeft' => 16,
|
||||
]
|
||||
],
|
||||
// 辅助线条
|
||||
'lineDiy' => [
|
||||
'name' => '辅助线条',
|
||||
'type' => 'lineDiy',
|
||||
'style' => [
|
||||
'background' => '',
|
||||
'itemBorderRadius' => 0,
|
||||
'lineStyle' => 'solid',
|
||||
'lineHeight' => '1',
|
||||
'lineColor' => "#000000",
|
||||
'paddingTop' => 10,
|
||||
'paddingLeft' => 0,
|
||||
]
|
||||
],
|
||||
// 辅助空白
|
||||
'blankDiy' => [
|
||||
'name' => '辅助空白',
|
||||
'type' => 'blankDiy',
|
||||
'style' => [
|
||||
'background' => '',
|
||||
'itemBorderRadius' => 0,
|
||||
'height' => 12,
|
||||
]
|
||||
],
|
||||
// 消息通知
|
||||
'noticeDiy' => [
|
||||
'name' => '消息通知',
|
||||
'type' => 'noticeDiy',
|
||||
'params' => [
|
||||
'text' => '这里是第一条来自后台自定义消息通知的信息',
|
||||
'icon' => '/assets/addons/wdsxh/img/notice.png',
|
||||
'showImg' => true,
|
||||
],
|
||||
'style' => [
|
||||
'background' => '',
|
||||
'itemBorderRadius' => 0,
|
||||
'textColor' => '#000000',
|
||||
'fontSize' => 14,
|
||||
'iconSize' => 16,
|
||||
'paddingTop' => 0,
|
||||
'paddingLeft' => 0,
|
||||
]
|
||||
],
|
||||
// 文本组
|
||||
'textDiy' => [
|
||||
'name' => '文本组',
|
||||
'type' => 'textDiy',
|
||||
'style' => [
|
||||
'text' => '这里是文本的内容',
|
||||
'background' => '',
|
||||
'itemBorderRadius' => 0,
|
||||
'textColor' => '#000000',
|
||||
'fontSize' => 14,
|
||||
'fontStyle' => 'normal',
|
||||
'textAlign' => 'left',
|
||||
'paddingTop' => 0,
|
||||
'paddingLeft' => 0,
|
||||
]
|
||||
],
|
||||
// 富文本
|
||||
'richTextDiy' => [
|
||||
'name' => '富文本',
|
||||
'type' => 'richTextDiy',
|
||||
'params' => [
|
||||
'content' => '<span>这里是富文本的内容</span>',
|
||||
],
|
||||
'style' => [
|
||||
'background' => '',
|
||||
'itemBorderRadius' => 0,
|
||||
'paddingTop' => 0,
|
||||
'paddingLeft' => 0,
|
||||
]
|
||||
],
|
||||
// 警告提示
|
||||
'warnDiy' => [
|
||||
'name' => '警告提示',
|
||||
'type' => 'warnDiy',
|
||||
'params' => [
|
||||
'type' => 'success',
|
||||
'title' => '提示标题',
|
||||
'description' => '提示内容1,提示内容2,提示内容3,提示内容4,提示内容5',
|
||||
'closable' => true,
|
||||
'showIcon' => true,
|
||||
'effect' => "light",
|
||||
],
|
||||
'style' => [
|
||||
'background' => '',
|
||||
'itemBorderRadius' => 0,
|
||||
'paddingTop' => 0,
|
||||
'paddingLeft' => 0,
|
||||
],
|
||||
],
|
||||
// 时间线
|
||||
'timelineDiy' => [
|
||||
'name' => '时间线',
|
||||
'type' => 'timelineDiy',
|
||||
'style' => [
|
||||
'background' => '',
|
||||
'itemBorderRadius' => 0,
|
||||
'paddingTop' => 0,
|
||||
'paddingLeft' => 0,
|
||||
],
|
||||
'data' => [
|
||||
[
|
||||
'time' => date('Y-m-d'),
|
||||
'color' => '#0FAFFF',
|
||||
'hide' => true,
|
||||
'content' => '时间节点1',
|
||||
],
|
||||
[
|
||||
'time' => date('Y-m-d'),
|
||||
'color' => '#0FAFFF',
|
||||
'hide' => true,
|
||||
'content' => '时间节点2',
|
||||
],
|
||||
[
|
||||
'time' => date('Y-m-d'),
|
||||
'color' => '#0FAFFF',
|
||||
'hide' => true,
|
||||
'content' => '时间节点3',
|
||||
],
|
||||
],
|
||||
],
|
||||
// 悬浮按钮
|
||||
'floatDiy' => [
|
||||
'name' => '悬浮按钮',
|
||||
'type' => 'floatDiy',
|
||||
'params' => [
|
||||
'image' => '/assets/addons/wdsxh/img/service.png',
|
||||
'link' => null
|
||||
],
|
||||
'style' => [
|
||||
'btnSize' => 40,
|
||||
'right' => 2,
|
||||
'bottom' => 10,
|
||||
'opacity' => 100
|
||||
]
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* 页面默认数据
|
||||
*/
|
||||
public function getDefaultPageData()
|
||||
{
|
||||
static $defaultPage = [];
|
||||
if (!empty($defaultPage))
|
||||
return $defaultPage;
|
||||
return [
|
||||
'type' => -1,
|
||||
'name' => '页面设置',
|
||||
'params' => [
|
||||
'name' => '模板名称',
|
||||
'title' => '首页',
|
||||
],
|
||||
'style' => [
|
||||
'titleTextColor' => 'black',
|
||||
'titleBackgroundColor' => '#fff',
|
||||
'backgroundColor' => '#F6F7FB',
|
||||
'backgroundImage' => '',
|
||||
'paddingTop' => 0,
|
||||
'paddingLeft' => 0,
|
||||
]
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取内置链接列表
|
||||
*/
|
||||
public function getLinkUrl()
|
||||
{
|
||||
return [
|
||||
'Custom' => ['type' => 'Custom', 'name' => '内部页面', 'list' => $this->getCustomList()],
|
||||
'Inlay' => ['type' => 'Inlay', 'name' => '自定义页面', 'list' => $this->getInlayList()],
|
||||
'Editor' => ['type' => 'Editor', 'name' => '图文'],
|
||||
'WXMp' => ['type' => 'WXMp', 'name' => '微信小程序'],
|
||||
'Outside' => ['type' => 'Outside', 'name' => '外部链接'],
|
||||
'Phone' => ['type' => 'Phone', 'name' => '拨打电话'],
|
||||
'Service' => ['type' => 'Service', 'name' => '小程序客服'],
|
||||
'Member' => ['type' => 'Member', 'name' => '会员列表', 'list' => $this->getMemberList()],
|
||||
'Article' => ['type' => 'Article', 'name' => '文章列表', 'list' => $this->getArticleList()],
|
||||
'Activity' => ['type' => 'Activity', 'name' => '活动列表', 'list' => $this->getActivityList()],
|
||||
'Goods' => ['type' => 'Goods', 'name' => '商品列表', 'list' => $this->getGoodsList()],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取自定义页面列表
|
||||
*/
|
||||
public function getInlayList()
|
||||
{
|
||||
return $this->where('status', 'custom')->order(['id' => 'desc'])->select();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取内部页面列表
|
||||
*/
|
||||
public function getCustomList()
|
||||
{
|
||||
$data = Db::name('wdsxh_link')
|
||||
->where('status', '1')
|
||||
->field('name title,url path')
|
||||
->order('weigh desc')
|
||||
->select();
|
||||
return $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取文章分类
|
||||
*/
|
||||
public function getArticleCategory()
|
||||
{
|
||||
$data = (new ArticleCat())->field('id,name')
|
||||
->order('weigh desc,id desc')
|
||||
->select();
|
||||
return $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取供需分类
|
||||
*/
|
||||
public function getDemandCategory()
|
||||
{
|
||||
$data = (new \app\admin\model\wdsxh\business\Category())->field('id,name')
|
||||
->order('weigh desc,id desc')
|
||||
->select();
|
||||
return $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* 选择会员列表
|
||||
*/
|
||||
public function getMemberList()
|
||||
{
|
||||
$list = (new \app\admin\model\wdsxh\member\Member)->field('id,name,mobile,member_level_name,type')
|
||||
->order('id desc')
|
||||
->select();
|
||||
return $list;
|
||||
}
|
||||
|
||||
/**
|
||||
* 选择文章列表
|
||||
*/
|
||||
public function getArticleList()
|
||||
{
|
||||
$list = (new \app\admin\model\wdsxh\article\Article)->field('id,title,type,link')
|
||||
->order('id desc')
|
||||
->select();
|
||||
return $list;
|
||||
}
|
||||
|
||||
/**
|
||||
* 选择活动列表
|
||||
*/
|
||||
public function getActivityList()
|
||||
{
|
||||
$list = (new \app\admin\model\wdsxh\activity\Activity)->field('id,name')
|
||||
->order('id desc')
|
||||
->select();
|
||||
return $list;
|
||||
}
|
||||
|
||||
/**
|
||||
* 选择商品列表
|
||||
*/
|
||||
public function getGoodsList()
|
||||
{
|
||||
$list = (new \app\admin\model\wdsxh\mall\Goods)->field('id,name,price')
|
||||
->order('id desc')
|
||||
->select();
|
||||
return $list;
|
||||
}
|
||||
}
|
||||
65
application/admin/model/wdsxh/Faq.php
Normal file
65
application/admin/model/wdsxh/Faq.php
Normal file
@@ -0,0 +1,65 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | 麦沃德科技赋能开发者,助力商协会发展
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2017~2024 www.wdsxh.cn All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | 沃德商协会系统并不是自由软件,不加密,并不代表开源,未经许可不可自由转售和商用
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: MY WORLD Team <bd@maiwd.cn> www.maiwd.cn
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\admin\model\wdsxh;
|
||||
|
||||
use think\Model;
|
||||
|
||||
|
||||
class Faq extends Model
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// 表名
|
||||
protected $name = 'wdsxh_faq';
|
||||
|
||||
// 自动写入时间戳字段
|
||||
protected $autoWriteTimestamp = 'integer';
|
||||
|
||||
// 定义时间戳字段名
|
||||
protected $createTime = 'createtime';
|
||||
protected $updateTime = false;
|
||||
protected $deleteTime = false;
|
||||
|
||||
// 追加属性
|
||||
protected $append = [
|
||||
'status_text'
|
||||
];
|
||||
|
||||
|
||||
protected static function init()
|
||||
{
|
||||
self::afterInsert(function ($row) {
|
||||
$pk = $row->getPk();
|
||||
$row->getQuery()->where($pk, $row[$pk])->update(['weigh' => $row[$pk]]);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
public function getStatusList()
|
||||
{
|
||||
return ['0' => __('Status 0'), '1' => __('Status 1')];
|
||||
}
|
||||
|
||||
|
||||
public function getStatusTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : (isset($data['status']) ? $data['status'] : '');
|
||||
$list = $this->getStatusList();
|
||||
return isset($list[$value]) ? $list[$value] : '';
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
137
application/admin/model/wdsxh/Jielong.php
Normal file
137
application/admin/model/wdsxh/Jielong.php
Normal file
@@ -0,0 +1,137 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | 麦沃德科技赋能开发者,助力商协会发展
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2017~2024 www.wdsxh.cn All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | 沃德商协会系统并不是自由软件,不加密,并不代表开源,未经许可不可自由转售和商用
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: MY WORLD Team <bd@maiwd.cn> www.maiwd.cn
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\admin\model\wdsxh;
|
||||
|
||||
use EasyWeChat\Factory;
|
||||
use think\Model;
|
||||
use traits\model\SoftDelete;
|
||||
|
||||
class Jielong extends Model
|
||||
{
|
||||
|
||||
use SoftDelete;
|
||||
|
||||
|
||||
|
||||
// 表名
|
||||
protected $name = 'wdsxh_jielong';
|
||||
|
||||
// 自动写入时间戳字段
|
||||
protected $autoWriteTimestamp = 'integer';
|
||||
|
||||
// 定义时间戳字段名
|
||||
protected $createTime = 'createtime';
|
||||
protected $updateTime = 'updatetime';
|
||||
protected $deleteTime = 'deletetime';
|
||||
|
||||
// 追加属性
|
||||
protected $append = [
|
||||
'type_text',
|
||||
'expire_time_text',
|
||||
'status_text',
|
||||
'applet_jielong_qrcode_path'
|
||||
];
|
||||
|
||||
|
||||
protected static function init()
|
||||
{
|
||||
self::afterInsert(function ($row) {
|
||||
$pk = $row->getPk();
|
||||
$row->getQuery()->where($pk, $row[$pk])->update(['weigh' => $row[$pk]]);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
public function getTypeList()
|
||||
{
|
||||
return ['1' => __('Type 1'), '2' => __('Type 2')];
|
||||
}
|
||||
|
||||
public function getStatusList()
|
||||
{
|
||||
return ['normal' => __('Status normal'), 'hidden' => __('Status hidden')];
|
||||
}
|
||||
|
||||
|
||||
public function getTypeTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : (isset($data['type']) ? $data['type'] : '');
|
||||
$list = $this->getTypeList();
|
||||
return isset($list[$value]) ? $list[$value] : '';
|
||||
}
|
||||
|
||||
|
||||
public function getExpireTimeTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : (isset($data['expire_time']) ? $data['expire_time'] : '');
|
||||
return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
|
||||
}
|
||||
|
||||
|
||||
public function getStatusTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : (isset($data['status']) ? $data['status'] : '');
|
||||
$list = $this->getStatusList();
|
||||
return isset($list[$value]) ? $list[$value] : '';
|
||||
}
|
||||
|
||||
protected function setExpireTimeAttr($value)
|
||||
{
|
||||
return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
|
||||
}
|
||||
|
||||
public function getJielongAuthList()
|
||||
{
|
||||
return ['1' => __('Jielong_auth 1'), '2' => __('Jielong_auth 2')];
|
||||
}
|
||||
|
||||
public function getAppletJielongQrcodePathAttr($value, $data)
|
||||
{
|
||||
$row = $data;
|
||||
$save_path = '/uploads/wdsxh/applet_jielong_qrcode/'.$row['id'].'/'.$row['createtime'].'.png';
|
||||
if (is_file(ROOT_PATH."public".$save_path)) {
|
||||
$value = $save_path;
|
||||
} else {
|
||||
$ids = $row['id'];
|
||||
$configObj = (new \app\admin\model\wdsxh\Config())->where('id',1)->find();
|
||||
if (!empty($configObj['applet_appid']) && !empty($configObj['applet_secret'])) {
|
||||
$path = 'pagesTools/sequence/details';
|
||||
$config = [
|
||||
'app_id' => $configObj['applet_appid'],
|
||||
'secret' => $configObj['applet_secret'],
|
||||
'response_type' => 'array',
|
||||
'log' => [
|
||||
'level' => 'debug',
|
||||
],
|
||||
];
|
||||
|
||||
$app = Factory::miniProgram($config);
|
||||
|
||||
$response = $app->app_code->getUnlimit($ids, [
|
||||
'page' => $path,
|
||||
'check_path' => false,
|
||||
]);
|
||||
|
||||
if ($response instanceof \EasyWeChat\Kernel\Http\StreamResponse) {
|
||||
$response->saveAs('uploads/wdsxh/applet_jielong_qrcode/'.$row['id'], $row['createtime'].'.png');
|
||||
$value = $save_path;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!empty($value)) {
|
||||
$value = request()->domain().$value;
|
||||
}
|
||||
return $value;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
35
application/admin/model/wdsxh/JielongFeedback.php
Normal file
35
application/admin/model/wdsxh/JielongFeedback.php
Normal file
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | 麦沃德科技赋能开发者,助力商协会发展
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2017~2024 www.wdsxh.cn All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | 沃德商协会系统并不是自由软件,不加密,并不代表开源,未经许可不可自由转售和商用
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: MY WORLD Team <bd@maiwd.cn> www.maiwd.cn
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\admin\model\wdsxh;
|
||||
|
||||
use think\Model;
|
||||
use traits\model\SoftDelete;
|
||||
|
||||
class JielongFeedback extends Model
|
||||
{
|
||||
|
||||
use SoftDelete;
|
||||
|
||||
// 表名
|
||||
protected $name = 'wdsxh_jielong_feedback';
|
||||
|
||||
// 自动写入时间戳字段
|
||||
protected $autoWriteTimestamp = 'integer';
|
||||
|
||||
// 定义时间戳字段名
|
||||
protected $createTime = 'createtime';
|
||||
protected $updateTime = 'updatetime';
|
||||
protected $deleteTime = 'deletetime';
|
||||
|
||||
|
||||
|
||||
}
|
||||
65
application/admin/model/wdsxh/Link.php
Normal file
65
application/admin/model/wdsxh/Link.php
Normal file
@@ -0,0 +1,65 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | 麦沃德科技赋能开发者,助力商协会发展
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2017~2024 www.wdsxh.cn All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | 沃德商协会系统并不是自由软件,不加密,并不代表开源,未经许可不可自由转售和商用
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: MY WORLD Team <bd@maiwd.cn> www.maiwd.cn
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\admin\model\wdsxh;
|
||||
|
||||
use think\Model;
|
||||
|
||||
|
||||
class Link extends Model
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// 表名
|
||||
protected $name = 'wdsxh_link';
|
||||
|
||||
// 自动写入时间戳字段
|
||||
protected $autoWriteTimestamp = false;
|
||||
|
||||
// 定义时间戳字段名
|
||||
protected $createTime = false;
|
||||
protected $updateTime = false;
|
||||
protected $deleteTime = false;
|
||||
|
||||
// 追加属性
|
||||
protected $append = [
|
||||
'status_text'
|
||||
];
|
||||
|
||||
|
||||
protected static function init()
|
||||
{
|
||||
self::afterInsert(function ($row) {
|
||||
$pk = $row->getPk();
|
||||
$row->getQuery()->where($pk, $row[$pk])->update(['weigh' => $row[$pk]]);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
public function getStatusList()
|
||||
{
|
||||
return ['0' => __('Status 0'), '1' => __('Status 1')];
|
||||
}
|
||||
|
||||
|
||||
public function getStatusTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : (isset($data['status']) ? $data['status'] : '');
|
||||
$list = $this->getStatusList();
|
||||
return isset($list[$value]) ? $list[$value] : '';
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
21
application/admin/model/wdsxh/Member.php
Normal file
21
application/admin/model/wdsxh/Member.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | 麦沃德科技赋能开发者,助力商协会发展
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2017~2024 www.wdsxh.cn All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | 沃德商协会系统并不是自由软件,不加密,并不代表开源,未经许可不可自由转售和商用
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: MY WORLD Team <bd@maiwd.cn> www.maiwd.cn
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\admin\model\wdsxh;
|
||||
|
||||
use think\Model;
|
||||
|
||||
class Member extends Model
|
||||
{
|
||||
// 表名
|
||||
protected $name = 'wdsxh_member';
|
||||
|
||||
}
|
||||
66
application/admin/model/wdsxh/PcBanner.php
Normal file
66
application/admin/model/wdsxh/PcBanner.php
Normal file
@@ -0,0 +1,66 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | 麦沃德科技赋能开发者,助力商协会发展
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2017~2024 www.wdsxh.cn All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | 沃德商协会系统并不是自由软件,不加密,并不代表开源,未经许可不可自由转售和商用
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: MY WORLD Team <bd@maiwd.cn> www.maiwd.cn
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\admin\model\wdsxh;
|
||||
|
||||
use think\Model;
|
||||
|
||||
|
||||
class PcBanner extends Model
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// 表名
|
||||
protected $name = 'wdsxh_pc_banner';
|
||||
|
||||
// 自动写入时间戳字段
|
||||
protected $autoWriteTimestamp = 'integer';
|
||||
|
||||
// 定义时间戳字段名
|
||||
protected $createTime = 'createtime';
|
||||
protected $updateTime = false;
|
||||
protected $deleteTime = false;
|
||||
|
||||
// 追加属性
|
||||
protected $append = [
|
||||
'status_text'
|
||||
];
|
||||
|
||||
|
||||
protected static function init()
|
||||
{
|
||||
self::afterInsert(function ($row) {
|
||||
$pk = $row->getPk();
|
||||
$row->getQuery()->where($pk, $row[$pk])->update(['weigh' => $row[$pk]]);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
public function getStatusList()
|
||||
{
|
||||
return ['0' => __('Status 0'), '1' => __('Status 1')];
|
||||
}
|
||||
|
||||
|
||||
public function getStatusTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : (isset($data['status']) ? $data['status'] : '');
|
||||
$list = $this->getStatusList();
|
||||
return isset($list[$value]) ? $list[$value] : '';
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
49
application/admin/model/wdsxh/PcBusinessAssociation.php
Normal file
49
application/admin/model/wdsxh/PcBusinessAssociation.php
Normal file
@@ -0,0 +1,49 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | 麦沃德科技赋能开发者,助力商协会发展
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2017~2024 www.wdsxh.cn All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | 沃德商协会系统并不是自由软件,不加密,并不代表开源,未经许可不可自由转售和商用
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: MY WORLD Team <bd@maiwd.cn> www.maiwd.cn
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\admin\model\wdsxh;
|
||||
|
||||
use think\Model;
|
||||
|
||||
|
||||
class PcBusinessAssociation extends Model
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// 表名
|
||||
protected $name = 'wdsxh_pc_business_association';
|
||||
|
||||
// 自动写入时间戳字段
|
||||
protected $autoWriteTimestamp = false;
|
||||
|
||||
// 定义时间戳字段名
|
||||
protected $createTime = false;
|
||||
protected $updateTime = false;
|
||||
protected $deleteTime = false;
|
||||
|
||||
// 追加属性
|
||||
protected $append = [
|
||||
|
||||
];
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
300
application/admin/model/wdsxh/PersonCenterDiyPage.php
Normal file
300
application/admin/model/wdsxh/PersonCenterDiyPage.php
Normal file
@@ -0,0 +1,300 @@
|
||||
<?php
|
||||
|
||||
namespace app\admin\model\wdsxh;
|
||||
|
||||
use think\Model;
|
||||
use traits\model\SoftDelete;
|
||||
use think\Db;
|
||||
|
||||
class PersonCenterDiyPage extends Model
|
||||
{
|
||||
|
||||
use SoftDelete;
|
||||
|
||||
|
||||
|
||||
// 表名
|
||||
protected $name = 'wdsxh_person_center_diy_page';
|
||||
|
||||
// 自动写入时间戳字段
|
||||
protected $autoWriteTimestamp = 'integer';
|
||||
|
||||
// 定义时间戳字段名
|
||||
protected $createTime = 'createtime';
|
||||
protected $updateTime = 'updatetime';
|
||||
protected $deleteTime = 'deletetime';
|
||||
|
||||
// 追加属性
|
||||
protected $append = [
|
||||
'status_text'
|
||||
];
|
||||
|
||||
|
||||
|
||||
public function getStatusList()
|
||||
{
|
||||
return ['home' => __('Status home'), 'custom' => __('Status custom')];
|
||||
}
|
||||
|
||||
|
||||
public function getStatusTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : (isset($data['status']) ? $data['status'] : '');
|
||||
$list = $this->getStatusList();
|
||||
return isset($list[$value]) ? $list[$value] : '';
|
||||
}
|
||||
|
||||
/**
|
||||
* 页面默认数据
|
||||
*/
|
||||
public function getDefaultPageData()
|
||||
{
|
||||
static $defaultPage = [];
|
||||
if (!empty($defaultPage)) return $defaultPage;
|
||||
return [
|
||||
'pageTitle' => '个人中心',
|
||||
'pageLayout' => 1,
|
||||
'pageStyle' => [
|
||||
[
|
||||
'layout' => 1,
|
||||
'titleTextColor' => 'black',
|
||||
'backgroundColor' => '#F6F7FB',
|
||||
'backgroundImage' => '/assets/addons/wdsxh/img/mine/bg1.png',
|
||||
'hideMember' => false,
|
||||
'hideApply' => false,
|
||||
'hideNotice' => false,
|
||||
],
|
||||
[
|
||||
'layout' => 2,
|
||||
'titleTextColor' => 'white',
|
||||
'backgroundColor' => '#F6F7FB',
|
||||
'backgroundImage' => '/assets/addons/wdsxh/img/mine/bg2.png',
|
||||
'hideMember' => false,
|
||||
'hideApply' => false,
|
||||
'hideNotice' => false,
|
||||
],
|
||||
[
|
||||
'layout' => 3,
|
||||
'titleTextColor' => 'white',
|
||||
'backgroundColor' => '#F6F7FB',
|
||||
'backgroundImage' => '/assets/addons/wdsxh/img/mine/bg3.png',
|
||||
'hideMember' => false,
|
||||
'hideApply' => false,
|
||||
'hideNotice' => false,
|
||||
]
|
||||
],
|
||||
'items' => [
|
||||
[
|
||||
'name' => '商城订单',
|
||||
'type' => 'mallOrderDiy',
|
||||
'show' => true,
|
||||
'style' => [
|
||||
'iconSize' => 32,
|
||||
'fontSize' => 12,
|
||||
'textColor' => '#5A5B6E',
|
||||
'graphicSpace' => 8,
|
||||
],
|
||||
'data' => [
|
||||
[
|
||||
'type' => 1,
|
||||
'imgUrl' => '/assets/addons/wdsxh/img/mine/order_1.png',
|
||||
'text' => '待付款',
|
||||
],
|
||||
[
|
||||
'type' => 2,
|
||||
'imgUrl' => '/assets/addons/wdsxh/img/mine/order_2.png',
|
||||
'text' => '待发货',
|
||||
],
|
||||
[
|
||||
'type' => 3,
|
||||
'imgUrl' => '/assets/addons/wdsxh/img/mine/order_3.png',
|
||||
'text' => '待收货',
|
||||
],
|
||||
[
|
||||
'type' => 4,
|
||||
'imgUrl' => '/assets/addons/wdsxh/img/mine/order_4.png',
|
||||
'text' => '退款',
|
||||
]
|
||||
]
|
||||
],
|
||||
[
|
||||
'name' => '我的名片',
|
||||
'type' => 'cardDiy',
|
||||
'show' => true,
|
||||
],
|
||||
[
|
||||
'name' => '会员中心',
|
||||
'type' => 'memberDiy',
|
||||
'show' => true,
|
||||
'memberHide' => false,
|
||||
'style' => [
|
||||
'layout' => 1,
|
||||
'rowsNum' => 4,
|
||||
'iconSize' => 40,
|
||||
'fontSize' => 14,
|
||||
'textColor' => '#5A5B6E',
|
||||
'graphicSpace' => 8,
|
||||
'itemSpace' => 16,
|
||||
],
|
||||
'data' => [
|
||||
[
|
||||
'imgUrl' => '/assets/addons/wdsxh/img/mine/member_1.png',
|
||||
'text' => '编辑资料',
|
||||
'link' => [
|
||||
'type' => 'Custom',
|
||||
'path' => '/pages/member/information',
|
||||
'title' => '编辑资料'
|
||||
],
|
||||
],
|
||||
[
|
||||
'imgUrl' => '/assets/addons/wdsxh/img/mine/member_2.png',
|
||||
'text' => '推广会员',
|
||||
'link' => [
|
||||
'type' => 'Custom',
|
||||
'path' => '/pagesTools/publicize/index',
|
||||
'title' => '推广会员'
|
||||
],
|
||||
],
|
||||
[
|
||||
'imgUrl' => '/assets/addons/wdsxh/img/mine/member_3.png',
|
||||
'text' => '我的发布',
|
||||
'link' => [
|
||||
'type' => 'Custom',
|
||||
'path' => '/pagesDemand/demand/list',
|
||||
'title' => '我的发布'
|
||||
],
|
||||
],
|
||||
]
|
||||
],
|
||||
[
|
||||
'name' => '管理员中心',
|
||||
'type' => 'adminDiy',
|
||||
'show' => true,
|
||||
'style' => [
|
||||
'layout' => 1,
|
||||
'rowsNum' => 4,
|
||||
'iconSize' => 40,
|
||||
'fontSize' => 14,
|
||||
'textColor' => '#5A5B6E',
|
||||
'graphicSpace' => 8,
|
||||
'itemSpace' => 16,
|
||||
],
|
||||
'data' => [
|
||||
[
|
||||
'type' => 'subscribeMessage',
|
||||
'imgUrl' => '/assets/addons/wdsxh/img/mine/admin_1.png',
|
||||
'text' => '消息订阅',
|
||||
],
|
||||
[
|
||||
'type' => 'verificationActivity',
|
||||
'imgUrl' => '/assets/addons/wdsxh/img/mine/admin_2.png',
|
||||
'text' => '核销活动',
|
||||
],
|
||||
[
|
||||
'type' => 'examineMember',
|
||||
'imgUrl' => '/assets/addons/wdsxh/img/mine/admin_3.png',
|
||||
'text' => '审核会员',
|
||||
],
|
||||
]
|
||||
],
|
||||
[
|
||||
'name' => '系统中心',
|
||||
'type' => 'navDiy',
|
||||
'show' => true,
|
||||
'style' => [
|
||||
'layout' => 1,
|
||||
'rowsNum' => 4,
|
||||
'iconSize' => 40,
|
||||
'fontSize' => 14,
|
||||
'textColor' => '#5A5B6E',
|
||||
'graphicSpace' => 8,
|
||||
'itemSpace' => 16,
|
||||
],
|
||||
'data' => [
|
||||
[
|
||||
'imgUrl' => '/assets/addons/wdsxh/img/mine/member_4.png',
|
||||
'text' => '我的活动',
|
||||
'link' => [
|
||||
'type' => 'Custom',
|
||||
'path' => '/pagesActivity/order/index',
|
||||
'title' => '我的活动'
|
||||
],
|
||||
],
|
||||
[
|
||||
'imgUrl' => '/assets/addons/wdsxh/img/mine/system_points.png',
|
||||
'text' => '积分商城',
|
||||
'link' => [
|
||||
'type' => 'Custom',
|
||||
'path' => '/pagesPoints/index/index',
|
||||
'title' => '积分商城'
|
||||
],
|
||||
],
|
||||
[
|
||||
'imgUrl' => '/assets/addons/wdsxh/img/mine/system_1.png',
|
||||
'text' => '地址管理',
|
||||
'link' => [
|
||||
'type' => 'Custom',
|
||||
'path' => '/pagesMall/address/index',
|
||||
'title' => '地址管理'
|
||||
],
|
||||
],
|
||||
[
|
||||
'imgUrl' => '/assets/addons/wdsxh/img/mine/system_2.png',
|
||||
'text' => '平台客服',
|
||||
'link' => [
|
||||
'type' => 'Service',
|
||||
'title' => '小程序客服'
|
||||
],
|
||||
],
|
||||
[
|
||||
'imgUrl' => '/assets/addons/wdsxh/img/mine/system_3.png',
|
||||
'text' => '常见问题',
|
||||
'link' => [
|
||||
'type' => 'Custom',
|
||||
'path' => '/pages/mine/problem/index',
|
||||
'title' => '常见问题'
|
||||
],
|
||||
],
|
||||
[
|
||||
'imgUrl' => '/assets/addons/wdsxh/img/mine/system_4.png',
|
||||
'text' => '系统设置',
|
||||
'link' => [
|
||||
'type' => 'Custom',
|
||||
'path' => '/pages/mine/settings/system',
|
||||
'title' => '系统设置'
|
||||
],
|
||||
],
|
||||
]
|
||||
],
|
||||
]
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取内置链接列表
|
||||
*/
|
||||
public function getLinkUrl()
|
||||
{
|
||||
return [
|
||||
'Custom' => ['type' => 'Custom', 'name' => '内部页面', 'list' => $this->getCustomList()],
|
||||
'Editor' => ['type' => 'Editor', 'name' => '图文'],
|
||||
'WXMp' => ['type' => 'WXMp', 'name' => '微信小程序'],
|
||||
'Outside' => ['type' => 'Outside', 'name' => '外部链接'],
|
||||
'Phone' => ['type' => 'Phone', 'name' => '拨打电话'],
|
||||
'Service' => ['type' => 'Service', 'name' => '小程序客服'],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取内部页面列表
|
||||
*/
|
||||
public function getCustomList()
|
||||
{
|
||||
$data = Db::name('wdsxh_link')
|
||||
->where('status', '1')
|
||||
->field('name title,url path')
|
||||
->order('weigh desc')
|
||||
->select();
|
||||
return $data;
|
||||
}
|
||||
}
|
||||
79
application/admin/model/wdsxh/Quickmenu.php
Normal file
79
application/admin/model/wdsxh/Quickmenu.php
Normal file
@@ -0,0 +1,79 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | 麦沃德科技赋能开发者,助力商协会发展
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2017~2024 www.wdsxh.cn All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | 沃德商协会系统并不是自由软件,不加密,并不代表开源,未经许可不可自由转售和商用
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: MY WORLD Team <bd@maiwd.cn> www.maiwd.cn
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\admin\model\wdsxh;
|
||||
|
||||
use think\Model;
|
||||
|
||||
|
||||
class Quickmenu extends Model
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// 表名
|
||||
protected $name = 'wdsxh_quickmenu';
|
||||
|
||||
// 自动写入时间戳字段
|
||||
protected $autoWriteTimestamp = 'integer';
|
||||
|
||||
// 定义时间戳字段名
|
||||
protected $createTime = 'createtime';
|
||||
protected $updateTime = false;
|
||||
protected $deleteTime = false;
|
||||
|
||||
// 追加属性
|
||||
protected $append = [
|
||||
'skip_type_text',
|
||||
'status_text'
|
||||
];
|
||||
|
||||
|
||||
protected static function init()
|
||||
{
|
||||
self::afterInsert(function ($row) {
|
||||
$pk = $row->getPk();
|
||||
$row->getQuery()->where($pk, $row[$pk])->update(['weigh' => $row[$pk]]);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
public function getSkipTypeList()
|
||||
{
|
||||
return ['1' => __('Skip_type 1'), '2' => __('Skip_type 2'), '3' => __('Skip_type 3'), '4' => __('Skip_type 4')];
|
||||
}
|
||||
|
||||
public function getStatusList()
|
||||
{
|
||||
return ['0' => __('Status 0'), '1' => __('Status 1')];
|
||||
}
|
||||
|
||||
|
||||
public function getSkipTypeTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : (isset($data['skip_type']) ? $data['skip_type'] : '');
|
||||
$list = $this->getSkipTypeList();
|
||||
return isset($list[$value]) ? $list[$value] : '';
|
||||
}
|
||||
|
||||
|
||||
public function getStatusTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : (isset($data['status']) ? $data['status'] : '');
|
||||
$list = $this->getStatusList();
|
||||
return isset($list[$value]) ? $list[$value] : '';
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
70
application/admin/model/wdsxh/Tabbar.php
Normal file
70
application/admin/model/wdsxh/Tabbar.php
Normal file
@@ -0,0 +1,70 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | 麦沃德科技赋能开发者,助力商协会发展
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2017~2024 www.wdsxh.cn All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | 沃德商协会系统并不是自由软件,不加密,并不代表开源,未经许可不可自由转售和商用
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: MY WORLD Team <bd@maiwd.cn> www.maiwd.cn
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\admin\model\wdsxh;
|
||||
|
||||
use think\Model;
|
||||
|
||||
|
||||
class Tabbar extends Model
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// 表名
|
||||
protected $name = 'wdsxh_tabbar';
|
||||
|
||||
// 自动写入时间戳字段
|
||||
protected $autoWriteTimestamp = false;
|
||||
|
||||
// 定义时间戳字段名
|
||||
protected $createTime = false;
|
||||
protected $updateTime = false;
|
||||
protected $deleteTime = false;
|
||||
|
||||
// 追加属性
|
||||
protected $append = [
|
||||
'status_text'
|
||||
];
|
||||
|
||||
|
||||
protected static function init()
|
||||
{
|
||||
self::afterInsert(function ($row) {
|
||||
$pk = $row->getPk();
|
||||
$row->getQuery()->where($pk, $row[$pk])->update(['weigh' => $row[$pk]]);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
public function getStatusList()
|
||||
{
|
||||
return ['0' => __('Status 0'), '1' => __('Status 1')];
|
||||
}
|
||||
|
||||
|
||||
public function getStatusTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : (isset($data['status']) ? $data['status'] : '');
|
||||
$list = $this->getStatusList();
|
||||
return isset($list[$value]) ? $list[$value] : '';
|
||||
}
|
||||
|
||||
public function getJumpTypeList()
|
||||
{
|
||||
return ['1' => __('Jump_type 1'), '2' => __('Jump_type 2'), '4' => __('Jump_type 4'), '3' => __('Jump_type 3')];
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
11
application/admin/model/wdsxh/Willbrand.php
Normal file
11
application/admin/model/wdsxh/Willbrand.php
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace app\admin\model\wdsxh;
|
||||
|
||||
use think\Model;
|
||||
|
||||
|
||||
class Willbrand extends Model
|
||||
{
|
||||
protected $name = 'wdsxh_willbrand';
|
||||
}
|
||||
221
application/admin/model/wdsxh/activity/Activity.php
Normal file
221
application/admin/model/wdsxh/activity/Activity.php
Normal file
@@ -0,0 +1,221 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | 麦沃德科技赋能开发者,助力商协会发展
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2017~2024 www.wdsxh.cn All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | 沃德商协会系统并不是自由软件,不加密,并不代表开源,未经许可不可自由转售和商用
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: MY WORLD Team <bd@maiwd.cn> www.maiwd.cn
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\admin\model\wdsxh\activity;
|
||||
|
||||
use EasyWeChat\Factory;
|
||||
use think\Model;
|
||||
|
||||
|
||||
class Activity extends Model
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// 表名
|
||||
protected $name = 'wdsxh_activity';
|
||||
|
||||
// 自动写入时间戳字段
|
||||
protected $autoWriteTimestamp = 'integer';
|
||||
|
||||
// 定义时间戳字段名
|
||||
protected $createTime = 'createtime';
|
||||
protected $updateTime = 'updatetime';
|
||||
protected $deleteTime = false;
|
||||
|
||||
// 追加属性
|
||||
protected $append = [
|
||||
'organizing_method_text',
|
||||
'apply_time_text',
|
||||
'start_time_text',
|
||||
'end_time_text',
|
||||
'state_text',
|
||||
'is_verifying_text',
|
||||
'status_text',
|
||||
'applet_activity_qrcode_path'
|
||||
];
|
||||
|
||||
|
||||
protected static function init()
|
||||
{
|
||||
self::afterInsert(function ($row) {
|
||||
$pk = $row->getPk();
|
||||
$row->getQuery()->where($pk, $row[$pk])->update(['weigh' => $row[$pk]]);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
public function getOrganizingMethodList()
|
||||
{
|
||||
return ['1' => __('Organizing_method 1'), '2' => __('Organizing_method 2')];
|
||||
}
|
||||
|
||||
public function getStateList()
|
||||
{
|
||||
return ['1' => __('State 1'), '2' => __('State 2'), '3' => __('State 3')];
|
||||
}
|
||||
|
||||
public function getIsVerifyingList()
|
||||
{
|
||||
return ['1' => __('Is_verifying 1'), '2' => __('Is_verifying 2')];
|
||||
}
|
||||
|
||||
public function getStatusList()
|
||||
{
|
||||
return ['normal' => __('Status normal'), 'hidden' => __('Status hidden')];
|
||||
}
|
||||
|
||||
|
||||
public function getOrganizingMethodTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : (isset($data['organizing_method']) ? $data['organizing_method'] : '');
|
||||
$list = $this->getOrganizingMethodList();
|
||||
return isset($list[$value]) ? $list[$value] : '';
|
||||
}
|
||||
|
||||
|
||||
public function getApplyTimeTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : (isset($data['apply_time']) ? $data['apply_time'] : '');
|
||||
return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
|
||||
}
|
||||
|
||||
|
||||
public function getStartTimeTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : (isset($data['start_time']) ? $data['start_time'] : '');
|
||||
return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
|
||||
}
|
||||
|
||||
|
||||
public function getEndTimeTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : (isset($data['end_time']) ? $data['end_time'] : '');
|
||||
return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
|
||||
}
|
||||
|
||||
|
||||
public function getStateTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : (isset($data['state']) ? $data['state'] : '');
|
||||
$list = $this->getStateList();
|
||||
return isset($list[$value]) ? $list[$value] : '';
|
||||
}
|
||||
|
||||
|
||||
public function getIsVerifyingTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : (isset($data['is_verifying']) ? $data['is_verifying'] : '');
|
||||
$list = $this->getIsVerifyingList();
|
||||
return isset($list[$value]) ? $list[$value] : '';
|
||||
}
|
||||
|
||||
|
||||
public function getStatusTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : (isset($data['status']) ? $data['status'] : '');
|
||||
$list = $this->getStatusList();
|
||||
return isset($list[$value]) ? $list[$value] : '';
|
||||
}
|
||||
|
||||
protected function setApplyTimeAttr($value)
|
||||
{
|
||||
return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
|
||||
}
|
||||
|
||||
protected function setStartTimeAttr($value)
|
||||
{
|
||||
return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
|
||||
}
|
||||
|
||||
protected function setEndTimeAttr($value)
|
||||
{
|
||||
return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
|
||||
}
|
||||
|
||||
public function getActivityAuthList()
|
||||
{
|
||||
return ['1' => __('Activity_auth 1'), '2' => __('Activity_auth 2')];
|
||||
}
|
||||
|
||||
//todo 活动创建后,会员功能对外功能不可用,非会员无法报名
|
||||
public function getNonMemberRegistrationStatusList()
|
||||
{
|
||||
return ['1' => __('Non_member_registration_status 1'), '2' => __('Non_member_registration_status 2')];
|
||||
}
|
||||
|
||||
public function getVerificationMethodList()
|
||||
{
|
||||
return ['1' => __('Verification_method 1'), '2' => __('Verification_method 2')];
|
||||
}
|
||||
|
||||
public function getAppletActivityQrcodePathAttr($value, $data)
|
||||
{
|
||||
$row = $data;
|
||||
$row['createtime'] = self::where('id',$row['id'])->value('createtime');
|
||||
$save_path = '/uploads/wdsxh/applet_activity_qrcode/'.$row['id'].'/'.$row['createtime'].'.png';
|
||||
if (is_file(ROOT_PATH."public".$save_path)) {
|
||||
$value = $save_path;
|
||||
} else {
|
||||
if(isset($row['id'])) {
|
||||
$ids = $row['id'];
|
||||
$configObj = (new \app\admin\model\wdsxh\Config())->where('id',1)->find();
|
||||
if (!empty($configObj['applet_appid']) && !empty($configObj['applet_secret'])) {
|
||||
$path = 'pagesActivity/index/details';
|
||||
$config = [
|
||||
'app_id' => $configObj['applet_appid'],
|
||||
'secret' => $configObj['applet_secret'],
|
||||
'response_type' => 'array',
|
||||
'log' => [
|
||||
'level' => 'debug',
|
||||
],
|
||||
];
|
||||
|
||||
$app = Factory::miniProgram($config);
|
||||
|
||||
$response = $app->app_code->getUnlimit($ids, [
|
||||
'page' => $path,
|
||||
'check_path' => false,
|
||||
]);
|
||||
|
||||
if ($response instanceof \EasyWeChat\Kernel\Http\StreamResponse) {
|
||||
$response->saveAs('uploads/wdsxh/applet_activity_qrcode/'.$row['id'], $row['createtime'].'.png');
|
||||
$value = $save_path;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
if (!empty($value)) {
|
||||
$value = request()->domain().$value;
|
||||
}
|
||||
return $value;
|
||||
}
|
||||
|
||||
public function getPointsStatusList()
|
||||
{
|
||||
return ['2' => __('Points_status 2'), '1' => __('Points_status 1')];
|
||||
}
|
||||
|
||||
public function getApplyFieldStateList()
|
||||
{
|
||||
return ['2' => __('Apply_field_state 2'), '1' => __('Apply_field_state 1')];
|
||||
}
|
||||
|
||||
public function getCertificateEnabledList()
|
||||
{
|
||||
return ['1' => __('启用单独证书'), '2' => __('使用统一证书')];
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
87
application/admin/model/wdsxh/activity/ActivityApply.php
Normal file
87
application/admin/model/wdsxh/activity/ActivityApply.php
Normal file
@@ -0,0 +1,87 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | 麦沃德科技赋能开发者,助力商协会发展
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2017~2024 www.wdsxh.cn All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | 沃德商协会系统并不是自由软件,不加密,并不代表开源,未经许可不可自由转售和商用
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: MY WORLD Team <bd@maiwd.cn> www.maiwd.cn
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\admin\model\wdsxh\activity;
|
||||
|
||||
use think\Model;
|
||||
|
||||
|
||||
class ActivityApply extends Model
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// 表名
|
||||
protected $name = 'wdsxh_activity_apply';
|
||||
|
||||
// 自动写入时间戳字段
|
||||
protected $autoWriteTimestamp = 'integer';
|
||||
|
||||
// 定义时间戳字段名
|
||||
protected $createTime = 'createtime';
|
||||
protected $updateTime = false;
|
||||
protected $deleteTime = false;
|
||||
|
||||
// 追加属性
|
||||
protected $append = [
|
||||
'state_text',
|
||||
'is_sign_in_text'
|
||||
];
|
||||
|
||||
|
||||
|
||||
public function getStateList()
|
||||
{
|
||||
return ['1' => __('State 1'), '2' => __('State 2'), '4' => __('State 4')];
|
||||
}
|
||||
|
||||
public function getIsSignInList()
|
||||
{
|
||||
return ['1' => __('Is_sign_in 1'), '2' => __('Is_sign_in 2'), '3' => __('Is_sign_in 3')];
|
||||
}
|
||||
|
||||
|
||||
public function getStateTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : (isset($data['state']) ? $data['state'] : '');
|
||||
$list = $this->getStateList();
|
||||
return isset($list[$value]) ? $list[$value] : '';
|
||||
}
|
||||
|
||||
|
||||
public function getIsSignInTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : (isset($data['is_sign_in']) ? $data['is_sign_in'] : '');
|
||||
$list = $this->getIsSignInList();
|
||||
return isset($list[$value]) ? $list[$value] : '';
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public function activity()
|
||||
{
|
||||
return $this->belongsTo('app\admin\model\wdsxh\activity\Activity', 'activity_id', 'id', [], 'LEFT')->setEagerlyType(0);
|
||||
}
|
||||
|
||||
public function member()
|
||||
{
|
||||
return $this->belongsTo('app\admin\model\wdsxh\member\Member', 'member_id', 'id', [], 'LEFT')->setEagerlyType(0);
|
||||
}
|
||||
|
||||
//todo 活动创建后,会员功能对外功能不可用,非会员无法报名
|
||||
public function wechat()
|
||||
{
|
||||
return $this->belongsTo('app\admin\model\wdsxh\user\Wechat', 'wechat_id', 'id', [], 'LEFT')->setEagerlyType(0);
|
||||
}
|
||||
}
|
||||
42
application/admin/model/wdsxh/activity/ActivityConfig.php
Normal file
42
application/admin/model/wdsxh/activity/ActivityConfig.php
Normal file
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | 麦沃德科技赋能开发者,助力中小企业发展
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2017~2024 www.wdadmin.cn All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Wdadmin系统产品软件并不是自由软件,不加密,并不代表开源,未经许可不可自由转售和商用
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: MY WORLD Team <bd@maiwd.cn> www.wdadmin.cn
|
||||
// +----------------------------------------------------------------------
|
||||
/**
|
||||
* Class ActivityConfig
|
||||
* Desc 活动配置Model
|
||||
* Create on 2025/4/17 18:08
|
||||
* Create by wangyafang
|
||||
*/
|
||||
|
||||
namespace app\admin\model\wdsxh\activity;
|
||||
|
||||
|
||||
use think\Model;
|
||||
|
||||
class ActivityConfig extends Model
|
||||
{
|
||||
// 表名
|
||||
protected $name = 'wdsxh_activity_config';
|
||||
|
||||
|
||||
// 定义时间戳字段名
|
||||
protected $createTime = false;
|
||||
protected $updateTime = false;
|
||||
protected $deleteTime = false;
|
||||
|
||||
public function getExpiredActivityShowList()
|
||||
{
|
||||
return ['1' => __('Expired_activity_show 1'), '2' => __('Expired_activity_show 2')];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | 麦沃德科技赋能开发者,助力中小企业发展
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2017~2024 www.wdadmin.cn All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Wdadmin系统产品软件并不是自由软件,不加密,并不代表开源,未经许可不可自由转售和商用
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: MY WORLD Team <bd@maiwd.cn> www.wdadmin.cn
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\admin\model\wdsxh\activity;
|
||||
|
||||
use think\Model;
|
||||
|
||||
class ActivityElectronicCertificate extends Model
|
||||
{
|
||||
protected $name = 'wdsxh_activity_electronic_certificate';
|
||||
}
|
||||
27
application/admin/model/wdsxh/activity/ActivityFieldset.php
Normal file
27
application/admin/model/wdsxh/activity/ActivityFieldset.php
Normal file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | 麦沃德科技赋能开发者,助力中小企业发展
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2017~2024 www.wdadmin.cn All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Wdadmin系统产品软件并不是自由软件,不加密,并不代表开源,未经许可不可自由转售和商用
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: MY WORLD Team <bd@maiwd.cn> www.wdadmin.cn
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\admin\model\wdsxh\activity;
|
||||
|
||||
use think\Model;
|
||||
|
||||
class ActivityFieldset extends Model
|
||||
{
|
||||
// 表名
|
||||
protected $name = 'wdsxh_activity_fieldset';
|
||||
|
||||
// 自动写入时间戳字段
|
||||
protected $autoWriteTimestamp = 'integer';
|
||||
|
||||
// 定义时间戳字段名
|
||||
protected $createTime = false;
|
||||
protected $updateTime = false;
|
||||
protected $deleteTime = false;
|
||||
}
|
||||
39
application/admin/model/wdsxh/activity/Order.php
Normal file
39
application/admin/model/wdsxh/activity/Order.php
Normal file
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | 麦沃德科技赋能开发者,助力商协会发展
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2017~2024 www.wdsxh.cn All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | 沃德商协会系统并不是自由软件,不加密,并不代表开源,未经许可不可自由转售和商用
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: MY WORLD Team <bd@maiwd.cn> www.maiwd.cn
|
||||
// +----------------------------------------------------------------------
|
||||
/**
|
||||
* Class Order
|
||||
* Desc 活动订单表模型
|
||||
* Create on 2024/3/14 15:06
|
||||
* Create by wangyafang
|
||||
*/
|
||||
|
||||
namespace app\admin\model\wdsxh\activity;
|
||||
|
||||
|
||||
use think\Model;
|
||||
|
||||
class Order extends Model
|
||||
{
|
||||
// 表名
|
||||
protected $name = 'wdsxh_activity_order';
|
||||
|
||||
// 自动写入时间戳字段
|
||||
protected $autoWriteTimestamp = false;
|
||||
|
||||
// 定义时间戳字段名
|
||||
protected $createTime = false;
|
||||
protected $updateTime = false;
|
||||
protected $deleteTime = false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
89
application/admin/model/wdsxh/activity/Refund.php
Normal file
89
application/admin/model/wdsxh/activity/Refund.php
Normal file
@@ -0,0 +1,89 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | 麦沃德科技赋能开发者,助力商协会发展
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2017~2024 www.wdsxh.cn All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | 沃德商协会系统并不是自由软件,不加密,并不代表开源,未经许可不可自由转售和商用
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: MY WORLD Team <bd@maiwd.cn> www.maiwd.cn
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\admin\model\wdsxh\activity;
|
||||
|
||||
use think\Model;
|
||||
|
||||
|
||||
class Refund extends Model
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// 表名
|
||||
protected $name = 'wdsxh_activity_refund';
|
||||
|
||||
// 自动写入时间戳字段
|
||||
protected $autoWriteTimestamp = 'integer';
|
||||
|
||||
// 定义时间戳字段名
|
||||
protected $createTime = 'createtime';
|
||||
protected $updateTime = false;
|
||||
protected $deleteTime = false;
|
||||
|
||||
// 追加属性
|
||||
protected $append = [
|
||||
'state_text',
|
||||
'dispose_time_text'
|
||||
];
|
||||
|
||||
|
||||
|
||||
public function getStateList()
|
||||
{
|
||||
return ['1' => __('State 1'), '2' => __('State 2'), '3' => __('State 3')];
|
||||
}
|
||||
|
||||
|
||||
public function getStateTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : (isset($data['state']) ? $data['state'] : '');
|
||||
$list = $this->getStateList();
|
||||
return isset($list[$value]) ? $list[$value] : '';
|
||||
}
|
||||
|
||||
|
||||
public function getDisposeTimeTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : (isset($data['dispose_time']) ? $data['dispose_time'] : '');
|
||||
return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
|
||||
}
|
||||
|
||||
protected function setDisposeTimeAttr($value)
|
||||
{
|
||||
return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
|
||||
}
|
||||
|
||||
|
||||
public function member()
|
||||
{
|
||||
return $this->belongsTo('app\admin\model\wdsxh\member\Member', 'member_id', 'id', [], 'LEFT')->setEagerlyType(0);
|
||||
}
|
||||
|
||||
public function activity()
|
||||
{
|
||||
return $this->belongsTo('app\admin\model\wdsxh\activity\Activity', 'activity_id', 'id', [], 'LEFT')->setEagerlyType(0);
|
||||
}
|
||||
|
||||
public function order()
|
||||
{
|
||||
return $this->belongsTo('app\admin\model\wdsxh\activity\Order', 'order_id', 'id', [], 'LEFT')->setEagerlyType(0);
|
||||
}
|
||||
|
||||
//todo 活动创建后,会员功能对外功能不可用,非会员无法报名
|
||||
public function wechat()
|
||||
{
|
||||
return $this->belongsTo('app\admin\model\wdsxh\user\Wechat', 'wechat_id', 'id', [], 'LEFT')->setEagerlyType(0);
|
||||
}
|
||||
}
|
||||
78
application/admin/model/wdsxh/article/Article.php
Normal file
78
application/admin/model/wdsxh/article/Article.php
Normal file
@@ -0,0 +1,78 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | 麦沃德科技赋能开发者,助力商协会发展
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2017~2024 www.wdsxh.cn All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | 沃德商协会系统并不是自由软件,不加密,并不代表开源,未经许可不可自由转售和商用
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: MY WORLD Team <bd@maiwd.cn> www.maiwd.cn
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\admin\model\wdsxh\article;
|
||||
|
||||
use think\Model;
|
||||
|
||||
|
||||
class Article extends Model
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// 表名
|
||||
protected $name = 'wdsxh_article';
|
||||
|
||||
// 自动写入时间戳字段
|
||||
protected $autoWriteTimestamp = 'integer';
|
||||
|
||||
// 定义时间戳字段名
|
||||
protected $createTime = 'createtime';
|
||||
protected $updateTime = false;
|
||||
protected $deleteTime = false;
|
||||
|
||||
// 追加属性
|
||||
protected $append = [
|
||||
'status_text'
|
||||
];
|
||||
|
||||
|
||||
protected static function init()
|
||||
{
|
||||
self::afterInsert(function ($row) {
|
||||
$pk = $row->getPk();
|
||||
$row->getQuery()->where($pk, $row[$pk])->update(['weigh' => $row[$pk]]);
|
||||
});
|
||||
}
|
||||
|
||||
public function getStatusList()
|
||||
{
|
||||
return ['0' => __('Status 0'), '1' => __('Status 1')];
|
||||
}
|
||||
|
||||
public function getTypeList()
|
||||
{
|
||||
return ['1' => __('Type 1'), '2' => __('Type 2')];
|
||||
}
|
||||
|
||||
public function getStatusTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : (isset($data['status']) ? $data['status'] : '');
|
||||
$list = $this->getStatusList();
|
||||
return isset($list[$value]) ? $list[$value] : '';
|
||||
}
|
||||
|
||||
public function wdsxharticlecat()
|
||||
{
|
||||
return $this->belongsTo('app\admin\model\wdsxh\article\ArticleCat', 'cat_id', 'id', [], 'LEFT')->setEagerlyType(0);
|
||||
}
|
||||
|
||||
protected function setCreatetimeAttr($value)
|
||||
{
|
||||
return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
65
application/admin/model/wdsxh/article/ArticleCat.php
Normal file
65
application/admin/model/wdsxh/article/ArticleCat.php
Normal file
@@ -0,0 +1,65 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | 麦沃德科技赋能开发者,助力商协会发展
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2017~2024 www.wdsxh.cn All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | 沃德商协会系统并不是自由软件,不加密,并不代表开源,未经许可不可自由转售和商用
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: MY WORLD Team <bd@maiwd.cn> www.maiwd.cn
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\admin\model\wdsxh\article;
|
||||
|
||||
use think\Model;
|
||||
|
||||
|
||||
class ArticleCat extends Model
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// 表名
|
||||
protected $name = 'wdsxh_article_cat';
|
||||
|
||||
// 自动写入时间戳字段
|
||||
protected $autoWriteTimestamp = false;
|
||||
|
||||
// 定义时间戳字段名
|
||||
protected $createTime = false;
|
||||
protected $updateTime = false;
|
||||
protected $deleteTime = false;
|
||||
|
||||
// 追加属性
|
||||
protected $append = [
|
||||
'status_text'
|
||||
];
|
||||
|
||||
|
||||
protected static function init()
|
||||
{
|
||||
self::afterInsert(function ($row) {
|
||||
$pk = $row->getPk();
|
||||
$row->getQuery()->where($pk, $row[$pk])->update(['weigh' => $row[$pk]]);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
public function getStatusList()
|
||||
{
|
||||
return ['0' => __('Status 0'), '1' => __('Status 1')];
|
||||
}
|
||||
|
||||
|
||||
public function getStatusTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : (isset($data['status']) ? $data['status'] : '');
|
||||
$list = $this->getStatusList();
|
||||
return isset($list[$value]) ? $list[$value] : '';
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
48
application/admin/model/wdsxh/business/Association.php
Normal file
48
application/admin/model/wdsxh/business/Association.php
Normal file
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | 麦沃德科技赋能开发者,助力商协会发展
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2017~2024 www.wdsxh.cn All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | 沃德商协会系统并不是自由软件,不加密,并不代表开源,未经许可不可自由转售和商用
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: MY WORLD Team <bd@maiwd.cn> www.maiwd.cn
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\admin\model\wdsxh\business;
|
||||
|
||||
use think\Model;
|
||||
|
||||
|
||||
class Association extends Model
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// 表名
|
||||
protected $name = 'wdsxh_business_association';
|
||||
|
||||
// 自动写入时间戳字段
|
||||
protected $autoWriteTimestamp = 'integer';
|
||||
|
||||
// 定义时间戳字段名
|
||||
protected $createTime = 'createtime';
|
||||
protected $updateTime = 'updatetime';
|
||||
protected $deleteTime = false;
|
||||
|
||||
// 追加属性
|
||||
protected $append = [
|
||||
|
||||
];
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
90
application/admin/model/wdsxh/business/Business.php
Normal file
90
application/admin/model/wdsxh/business/Business.php
Normal file
@@ -0,0 +1,90 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | 麦沃德科技赋能开发者,助力商协会发展
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2017~2024 www.wdsxh.cn All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | 沃德商协会系统并不是自由软件,不加密,并不代表开源,未经许可不可自由转售和商用
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: MY WORLD Team <bd@maiwd.cn> www.maiwd.cn
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\admin\model\wdsxh\business;
|
||||
|
||||
use think\Model;
|
||||
use traits\model\SoftDelete;
|
||||
|
||||
class Business extends Model
|
||||
{
|
||||
|
||||
use SoftDelete;
|
||||
|
||||
|
||||
|
||||
// 表名
|
||||
protected $name = 'wdsxh_business';
|
||||
|
||||
// 自动写入时间戳字段
|
||||
protected $autoWriteTimestamp = 'integer';
|
||||
|
||||
// 定义时间戳字段名
|
||||
protected $createTime = 'createtime';
|
||||
protected $updateTime = 'updatetime';
|
||||
protected $deleteTime = 'deletetime';
|
||||
|
||||
// 追加属性
|
||||
protected $append = [
|
||||
'status_text',
|
||||
'state_text'
|
||||
];
|
||||
|
||||
|
||||
protected static function init()
|
||||
{
|
||||
self::afterInsert(function ($row) {
|
||||
$pk = $row->getPk();
|
||||
$row->getQuery()->where($pk, $row[$pk])->update(['weigh' => $row[$pk]]);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
public function getStatusList()
|
||||
{
|
||||
return ['normal' => __('Status normal'), 'hidden' => __('Status hidden')];
|
||||
}
|
||||
|
||||
public function getStateList()
|
||||
{
|
||||
return ['1' => __('State 1'), '2' => __('State 2'), '3' => __('State 3')];
|
||||
}
|
||||
|
||||
|
||||
public function getStatusTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : (isset($data['status']) ? $data['status'] : '');
|
||||
$list = $this->getStatusList();
|
||||
return isset($list[$value]) ? $list[$value] : '';
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public function getStateTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : (isset($data['state']) ? $data['state'] : '');
|
||||
$list = $this->getStateList();
|
||||
return isset($list[$value]) ? $list[$value] : '';
|
||||
}
|
||||
|
||||
public function category()
|
||||
{
|
||||
return $this->belongsTo('app\admin\model\wdsxh\business\Category','category_id','id')->setEagerlyType(0);
|
||||
}
|
||||
public function member()
|
||||
{
|
||||
return $this->belongsTo('app\admin\model\wdsxh\member\Member','member_id','id')->setEagerlyType(0);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
77
application/admin/model/wdsxh/business/BusinessConfig.php
Normal file
77
application/admin/model/wdsxh/business/BusinessConfig.php
Normal file
@@ -0,0 +1,77 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | 麦沃德科技赋能开发者,助力商协会发展
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2017~2024 www.wdsxh.cn All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | 沃德商协会系统并不是自由软件,不加密,并不代表开源,未经许可不可自由转售和商用
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: MY WORLD Team <bd@maiwd.cn> www.maiwd.cn
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\admin\model\wdsxh\business;
|
||||
|
||||
use think\Model;
|
||||
|
||||
class BusinessConfig extends Model
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
// 表名
|
||||
protected $name = 'wdsxh_business_config';
|
||||
|
||||
// 自动写入时间戳字段
|
||||
protected $autoWriteTimestamp = 'integer';
|
||||
|
||||
// 定义时间戳字段名
|
||||
protected $createTime = 'createtime';
|
||||
protected $updateTime = 'updatetime';
|
||||
|
||||
|
||||
public function getIsStatusList()
|
||||
{
|
||||
return ['1' => __('全部开放'), '2' => __('部分开放'), '3' => __('会员专属(只有会员才能查看)')];
|
||||
}
|
||||
|
||||
public function getIsExclusiveList()
|
||||
{
|
||||
return ['1' => __('是'), '2' => __('否')];
|
||||
}
|
||||
public function getIsProcessList()
|
||||
{
|
||||
return ['1' => __('是'), '2' => __('否')];
|
||||
}
|
||||
|
||||
public function getIsExclusiveTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : (isset($data['is_exclusive']) ? $data['is_exclusive'] : '');
|
||||
$list = $this->getIsExclusiveList();
|
||||
return isset($list[$value]) ? $list[$value] : '';
|
||||
}
|
||||
public function getIsProcessTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : (isset($data['is_process']) ? $data['is_process'] : '');
|
||||
$list = $this->getIsProcessList();
|
||||
return isset($list[$value]) ? $list[$value] : '';
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public function getIsStateTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : (isset($data['is_status']) ? $data['is_status'] : '');
|
||||
$list = $this->getIsStatusList();
|
||||
return isset($list[$value]) ? $list[$value] : '';
|
||||
}
|
||||
|
||||
public function category()
|
||||
{
|
||||
return $this->belongsTo('app\admin\model\wdsxh\business\Category','category_id','id')->setEagerlyType(0);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
65
application/admin/model/wdsxh/business/Category.php
Normal file
65
application/admin/model/wdsxh/business/Category.php
Normal file
@@ -0,0 +1,65 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | 麦沃德科技赋能开发者,助力商协会发展
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2017~2024 www.wdsxh.cn All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | 沃德商协会系统并不是自由软件,不加密,并不代表开源,未经许可不可自由转售和商用
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: MY WORLD Team <bd@maiwd.cn> www.maiwd.cn
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\admin\model\wdsxh\business;
|
||||
|
||||
use think\Model;
|
||||
use traits\model\SoftDelete;
|
||||
|
||||
class Category extends Model
|
||||
{
|
||||
|
||||
use SoftDelete;
|
||||
|
||||
|
||||
|
||||
// 表名
|
||||
protected $name = 'wdsxh_business_category';
|
||||
|
||||
// 自动写入时间戳字段
|
||||
protected $autoWriteTimestamp = 'integer';
|
||||
|
||||
// 定义时间戳字段名
|
||||
protected $createTime = 'createtime';
|
||||
protected $updateTime = 'updatetime';
|
||||
protected $deleteTime = 'deletetime';
|
||||
|
||||
// 追加属性
|
||||
protected $append = [
|
||||
'status_text'
|
||||
];
|
||||
|
||||
|
||||
protected static function init()
|
||||
{
|
||||
self::afterInsert(function ($row) {
|
||||
$pk = $row->getPk();
|
||||
$row->getQuery()->where($pk, $row[$pk])->update(['weigh' => $row[$pk]]);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
public function getStatusList()
|
||||
{
|
||||
return ['normal' => __('Status normal'), 'hidden' => __('Status hidden')];
|
||||
}
|
||||
|
||||
|
||||
public function getStatusTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : (isset($data['status']) ? $data['status'] : '');
|
||||
$list = $this->getStatusList();
|
||||
return isset($list[$value]) ? $list[$value] : '';
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
77
application/admin/model/wdsxh/corporate/Card.php
Normal file
77
application/admin/model/wdsxh/corporate/Card.php
Normal file
@@ -0,0 +1,77 @@
|
||||
<?php
|
||||
|
||||
namespace app\admin\model\wdsxh\corporate;
|
||||
|
||||
use think\Model;
|
||||
|
||||
|
||||
class Card extends Model
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// 表名
|
||||
protected $name = 'wdsxh_corporate_card';
|
||||
|
||||
// 自动写入时间戳字段
|
||||
protected $autoWriteTimestamp = 'integer';
|
||||
|
||||
// 定义时间戳字段名
|
||||
protected $createTime = 'createtime';
|
||||
protected $updateTime = 'updatetime';
|
||||
protected $deleteTime = false;
|
||||
|
||||
// 追加属性
|
||||
protected $append = [
|
||||
'is_default_text',
|
||||
'is_hide_avatar_text',
|
||||
'is_wechat_number_public_text'
|
||||
];
|
||||
|
||||
|
||||
|
||||
public function getIsDefaultList()
|
||||
{
|
||||
return ['1' => __('Is_default 1'), '2' => __('Is_default 2')];
|
||||
}
|
||||
|
||||
public function getIsHideAvatarList()
|
||||
{
|
||||
return ['1' => __('Is_hide_avatar 1'), '2' => __('Is_hide_avatar 2')];
|
||||
}
|
||||
|
||||
public function getIsWechatNumberPublicList()
|
||||
{
|
||||
return ['1' => __('Is_wechat_number_public 1'), '2' => __('Is_wechat_number_public 2')];
|
||||
}
|
||||
|
||||
|
||||
public function getIsDefaultTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : (isset($data['is_default']) ? $data['is_default'] : '');
|
||||
$list = $this->getIsDefaultList();
|
||||
return isset($list[$value]) ? $list[$value] : '';
|
||||
}
|
||||
|
||||
|
||||
public function getIsHideAvatarTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : (isset($data['is_hide_avatar']) ? $data['is_hide_avatar'] : '');
|
||||
$list = $this->getIsHideAvatarList();
|
||||
return isset($list[$value]) ? $list[$value] : '';
|
||||
}
|
||||
|
||||
|
||||
public function getIsWechatNumberPublicTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : (isset($data['is_wechat_number_public']) ? $data['is_wechat_number_public'] : '');
|
||||
$list = $this->getIsWechatNumberPublicList();
|
||||
return isset($list[$value]) ? $list[$value] : '';
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
62
application/admin/model/wdsxh/corporate/CardBackground.php
Normal file
62
application/admin/model/wdsxh/corporate/CardBackground.php
Normal file
@@ -0,0 +1,62 @@
|
||||
<?php
|
||||
|
||||
namespace app\admin\model\wdsxh\corporate;
|
||||
|
||||
use think\Model;
|
||||
use traits\model\SoftDelete;
|
||||
|
||||
class CardBackground extends Model
|
||||
{
|
||||
|
||||
use SoftDelete;
|
||||
|
||||
|
||||
|
||||
// 表名
|
||||
protected $name = 'wdsxh_corporate_card_background';
|
||||
|
||||
// 自动写入时间戳字段
|
||||
protected $autoWriteTimestamp = 'integer';
|
||||
|
||||
// 定义时间戳字段名
|
||||
protected $createTime = 'createtime';
|
||||
protected $updateTime = 'updatetime';
|
||||
protected $deleteTime = 'deletetime';
|
||||
|
||||
// 追加属性
|
||||
protected $append = [
|
||||
'status_text'
|
||||
];
|
||||
|
||||
|
||||
protected static function init()
|
||||
{
|
||||
self::afterInsert(function ($row) {
|
||||
$pk = $row->getPk();
|
||||
$row->getQuery()->where($pk, $row[$pk])->update(['weigh' => $row[$pk]]);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
public function getStatusList()
|
||||
{
|
||||
return ['normal' => __('Status normal'), 'hidden' => __('Status hidden')];
|
||||
}
|
||||
|
||||
public function getFontColorList()
|
||||
{
|
||||
return ['#FFFFFF' => __('White'),'#5A5B6E' => __('Black')];
|
||||
}
|
||||
|
||||
|
||||
public function getStatusTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : (isset($data['status']) ? $data['status'] : '');
|
||||
$list = $this->getStatusList();
|
||||
return isset($list[$value]) ? $list[$value] : '';
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
57
application/admin/model/wdsxh/institution/Institution.php
Normal file
57
application/admin/model/wdsxh/institution/Institution.php
Normal file
@@ -0,0 +1,57 @@
|
||||
<?php
|
||||
|
||||
namespace app\admin\model\wdsxh\institution;
|
||||
|
||||
use think\Model;
|
||||
|
||||
|
||||
class Institution extends Model
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// 表名
|
||||
protected $name = 'wdsxh_institution';
|
||||
|
||||
// 自动写入时间戳字段
|
||||
protected $autoWriteTimestamp = 'integer';
|
||||
|
||||
// 定义时间戳字段名
|
||||
protected $createTime = 'createtime';
|
||||
protected $updateTime = 'updatetime';
|
||||
protected $deleteTime = false;
|
||||
|
||||
// 追加属性
|
||||
protected $append = [
|
||||
'status_text'
|
||||
];
|
||||
|
||||
|
||||
protected static function init()
|
||||
{
|
||||
self::afterInsert(function ($row) {
|
||||
$pk = $row->getPk();
|
||||
$row->getQuery()->where($pk, $row[$pk])->update(['weigh' => $row[$pk]]);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
public function getStatusList()
|
||||
{
|
||||
return ['0' => __('Status 0'), '1' => __('Status 1')];
|
||||
}
|
||||
|
||||
|
||||
public function getStatusTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : (isset($data['status']) ? $data['status'] : '');
|
||||
$list = $this->getStatusList();
|
||||
return isset($list[$value]) ? $list[$value] : '';
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | 麦沃德科技赋能开发者,助力中小企业发展
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2017~2024 www.wdadmin.cn All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Wdadmin系统产品软件并不是自由软件,不加密,并不代表开源,未经许可不可自由转售和商用
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: MY WORLD Team <bd@maiwd.cn> www.wdadmin.cn
|
||||
// +----------------------------------------------------------------------
|
||||
/**
|
||||
* Class InstitutionConfig
|
||||
* Desc 机构配置Model
|
||||
* Create on 2025/3/6 10:50
|
||||
* Create by wangyafang
|
||||
*/
|
||||
|
||||
namespace app\admin\model\wdsxh\institution;
|
||||
|
||||
|
||||
use think\Model;
|
||||
|
||||
class InstitutionConfig extends Model
|
||||
{
|
||||
// 表名
|
||||
protected $name = 'wdsxh_institution_config';
|
||||
|
||||
// 自动写入时间戳字段
|
||||
protected $autoWriteTimestamp = 'integer';
|
||||
|
||||
// 定义时间戳字段名
|
||||
protected $createTime = 'createtime';
|
||||
protected $updateTime = 'updatetime';
|
||||
|
||||
public function getIsStatusList()
|
||||
{
|
||||
return ['1' => __('对外开放'), '2' => __('不对外开放')];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,75 @@
|
||||
<?php
|
||||
|
||||
namespace app\admin\model\wdsxh\institution;
|
||||
|
||||
use think\Model;
|
||||
|
||||
|
||||
class InstitutionMemberApply extends Model
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// 表名
|
||||
protected $name = 'wdsxh_institution_member_apply';
|
||||
|
||||
// 自动写入时间戳字段
|
||||
protected $autoWriteTimestamp = 'integer';
|
||||
|
||||
// 定义时间戳字段名
|
||||
protected $createTime = 'createtime';
|
||||
protected $updateTime = false;
|
||||
protected $deleteTime = false;
|
||||
|
||||
// 追加属性
|
||||
protected $append = [
|
||||
'state_text',
|
||||
'handle_time_text'
|
||||
];
|
||||
|
||||
|
||||
|
||||
public function getStateList()
|
||||
{
|
||||
return ['1' => __('State 1'), '2' => __('State 2'), '3' => __('State 3')];
|
||||
}
|
||||
|
||||
|
||||
public function getStateTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : (isset($data['state']) ? $data['state'] : '');
|
||||
$list = $this->getStateList();
|
||||
return isset($list[$value]) ? $list[$value] : '';
|
||||
}
|
||||
|
||||
|
||||
public function getHandleTimeTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : (isset($data['handle_time']) ? $data['handle_time'] : '');
|
||||
return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
|
||||
}
|
||||
|
||||
protected function setHandleTimeAttr($value)
|
||||
{
|
||||
return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
|
||||
}
|
||||
|
||||
|
||||
public function institution()
|
||||
{
|
||||
return $this->belongsTo('app\admin\model\wdsxh\institution\Institution', 'institution_id', 'id', [], 'LEFT')->setEagerlyType(0);
|
||||
}
|
||||
|
||||
|
||||
public function level()
|
||||
{
|
||||
return $this->belongsTo('Level', 'level_id', 'id', [], 'LEFT')->setEagerlyType(0);
|
||||
}
|
||||
|
||||
public function usermember()
|
||||
{
|
||||
return $this->belongsTo('app\admin\model\wdsxh\Member', 'member_id', 'id', [], 'LEFT')->setEagerlyType(0);
|
||||
}
|
||||
}
|
||||
44
application/admin/model/wdsxh/institution/Level.php
Normal file
44
application/admin/model/wdsxh/institution/Level.php
Normal file
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
namespace app\admin\model\wdsxh\institution;
|
||||
|
||||
use think\Model;
|
||||
|
||||
|
||||
class Level extends Model
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// 表名
|
||||
protected $name = 'wdsxh_institution_level';
|
||||
|
||||
// 自动写入时间戳字段
|
||||
protected $autoWriteTimestamp = 'integer';
|
||||
|
||||
// 定义时间戳字段名
|
||||
protected $createTime = 'createtime';
|
||||
protected $updateTime = 'updatetime';
|
||||
protected $deleteTime = false;
|
||||
|
||||
// 追加属性
|
||||
protected $append = [
|
||||
|
||||
];
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public function institution()
|
||||
{
|
||||
return $this->belongsTo('app\admin\model\wdsxh\institution\Institution', 'institution_id', 'id', [], 'LEFT')->setEagerlyType(0);
|
||||
}
|
||||
}
|
||||
69
application/admin/model/wdsxh/institution/Member.php
Normal file
69
application/admin/model/wdsxh/institution/Member.php
Normal file
@@ -0,0 +1,69 @@
|
||||
<?php
|
||||
|
||||
namespace app\admin\model\wdsxh\institution;
|
||||
|
||||
use think\Model;
|
||||
|
||||
|
||||
class Member extends Model
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// 表名
|
||||
protected $name = 'wdsxh_institution_member';
|
||||
|
||||
// 自动写入时间戳字段
|
||||
protected $autoWriteTimestamp = 'integer';
|
||||
|
||||
// 定义时间戳字段名
|
||||
protected $createTime = 'createtime';
|
||||
protected $updateTime = 'updatetime';
|
||||
protected $deleteTime = false;
|
||||
|
||||
// 追加属性
|
||||
protected $append = [
|
||||
|
||||
];
|
||||
|
||||
protected static function init()
|
||||
{
|
||||
self::beforeInsert(function ($row) {
|
||||
if (empty($row['institution_id']) && isset($row['level_id']) && !empty($row['level_id'])) {
|
||||
$row->institution_id = (new \app\api\model\wdsxh\institution\Level())->where('id',$row['level_id'])->value('institution_id');
|
||||
}
|
||||
$row->wechat_id = (new \app\admin\model\wdsxh\Member)->where('id',$row->member_id)->value('wechat_id');
|
||||
});
|
||||
|
||||
self::beforeUpdate(function ($row) {
|
||||
$row->wechat_id = (new \app\admin\model\wdsxh\Member)->where('id',$row->member_id)->value('wechat_id');
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public function institution()
|
||||
{
|
||||
return $this->belongsTo('app\admin\model\wdsxh\institution\Institution', 'institution_id', 'id', [], 'LEFT')->setEagerlyType(0);
|
||||
}
|
||||
|
||||
|
||||
public function level()
|
||||
{
|
||||
return $this->belongsTo('Level', 'level_id', 'id', [], 'LEFT')->setEagerlyType(0);
|
||||
}
|
||||
|
||||
public function usermember()
|
||||
{
|
||||
return $this->belongsTo('app\admin\model\wdsxh\Member', 'member_id', 'id', [], 'LEFT')->setEagerlyType(0);
|
||||
}
|
||||
}
|
||||
79
application/admin/model/wdsxh/mall/Banner.php
Normal file
79
application/admin/model/wdsxh/mall/Banner.php
Normal file
@@ -0,0 +1,79 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | 麦沃德科技赋能开发者,助力商协会发展
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2017~2024 www.wdsxh.cn All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | 沃德商协会系统并不是自由软件,不加密,并不代表开源,未经许可不可自由转售和商用
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: MY WORLD Team <bd@maiwd.cn> www.maiwd.cn
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\admin\model\wdsxh\mall;
|
||||
|
||||
use think\Model;
|
||||
use traits\model\SoftDelete;
|
||||
|
||||
class Banner extends Model
|
||||
{
|
||||
|
||||
use SoftDelete;
|
||||
|
||||
|
||||
|
||||
// 表名
|
||||
protected $name = 'wdsxh_mall_banner';
|
||||
|
||||
// 自动写入时间戳字段
|
||||
protected $autoWriteTimestamp = 'integer';
|
||||
|
||||
// 定义时间戳字段名
|
||||
protected $createTime = 'createtime';
|
||||
protected $updateTime = 'updatetime';
|
||||
protected $deleteTime = 'deletetime';
|
||||
|
||||
// 追加属性
|
||||
protected $append = [
|
||||
'jump_type_text',
|
||||
'status_text'
|
||||
];
|
||||
|
||||
|
||||
protected static function init()
|
||||
{
|
||||
self::afterInsert(function ($row) {
|
||||
$pk = $row->getPk();
|
||||
$row->getQuery()->where($pk, $row[$pk])->update(['weigh' => $row[$pk]]);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
public function getJumpTypeList()
|
||||
{
|
||||
return ['1' => __('Jump_type 1'), '2' => __('Jump_type 2'), '4' => __('Jump_type 4'), '3' => __('Jump_type 3')];
|
||||
}
|
||||
|
||||
public function getStatusList()
|
||||
{
|
||||
return ['0' => __('Status 0'), '1' => __('Status 1')];
|
||||
}
|
||||
|
||||
|
||||
public function getJumpTypeTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : (isset($data['jump_type']) ? $data['jump_type'] : '');
|
||||
$list = $this->getJumpTypeList();
|
||||
return isset($list[$value]) ? $list[$value] : '';
|
||||
}
|
||||
|
||||
|
||||
public function getStatusTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : (isset($data['status']) ? $data['status'] : '');
|
||||
$list = $this->getStatusList();
|
||||
return isset($list[$value]) ? $list[$value] : '';
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
56
application/admin/model/wdsxh/mall/Express.php
Normal file
56
application/admin/model/wdsxh/mall/Express.php
Normal file
@@ -0,0 +1,56 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | 麦沃德科技赋能开发者,助力商协会发展
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2017~2024 www.wdsxh.cn All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | 沃德商协会系统并不是自由软件,不加密,并不代表开源,未经许可不可自由转售和商用
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: MY WORLD Team <bd@maiwd.cn> www.maiwd.cn
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\admin\model\wdsxh\mall;
|
||||
|
||||
use think\Model;
|
||||
use traits\model\SoftDelete;
|
||||
|
||||
class Express extends Model
|
||||
{
|
||||
|
||||
use SoftDelete;
|
||||
|
||||
|
||||
|
||||
// 表名
|
||||
protected $name = 'wdsxh_mall_express';
|
||||
|
||||
// 自动写入时间戳字段
|
||||
protected $autoWriteTimestamp = 'integer';
|
||||
|
||||
// 定义时间戳字段名
|
||||
protected $createTime = 'createtime';
|
||||
protected $updateTime = 'updatetime';
|
||||
protected $deleteTime = 'deletetime';
|
||||
|
||||
// 追加属性
|
||||
protected $append = [
|
||||
|
||||
];
|
||||
|
||||
|
||||
protected static function init()
|
||||
{
|
||||
self::afterInsert(function ($row) {
|
||||
$pk = $row->getPk();
|
||||
$row->getQuery()->where($pk, $row[$pk])->update(['weigh' => $row[$pk]]);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
71
application/admin/model/wdsxh/mall/FreightRules.php
Normal file
71
application/admin/model/wdsxh/mall/FreightRules.php
Normal file
@@ -0,0 +1,71 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | 麦沃德科技赋能开发者,助力商协会发展
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2017~2024 www.wdsxh.cn All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | 沃德商协会系统并不是自由软件,不加密,并不代表开源,未经许可不可自由转售和商用
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: MY WORLD Team <bd@maiwd.cn> www.maiwd.cn
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\admin\model\wdsxh\mall;
|
||||
|
||||
use think\Model;
|
||||
use traits\model\SoftDelete;
|
||||
|
||||
class FreightRules extends Model
|
||||
{
|
||||
|
||||
use SoftDelete;
|
||||
|
||||
|
||||
|
||||
// 表名
|
||||
protected $name = 'wdsxh_mall_freight_rules';
|
||||
|
||||
// 自动写入时间戳字段
|
||||
protected $autoWriteTimestamp = 'integer';
|
||||
|
||||
// 定义时间戳字段名
|
||||
protected $createTime = 'createtime';
|
||||
protected $updateTime = 'updatetime';
|
||||
protected $deleteTime = 'deletetime';
|
||||
|
||||
// 追加属性
|
||||
protected $append = [
|
||||
'status_text'
|
||||
];
|
||||
|
||||
protected static function init()
|
||||
{
|
||||
self::beforeInsert(function ($row) {
|
||||
$row['open_area'] = implode(',',$row['open_area']);
|
||||
});
|
||||
|
||||
self::beforeUpdate(function ($row) {
|
||||
$row['open_area'] = implode(',',$row['open_area']);
|
||||
});
|
||||
}
|
||||
|
||||
public function getStatusList()
|
||||
{
|
||||
return ['normal' => __('Status normal'), 'hidden' => __('Status hidden')];
|
||||
}
|
||||
|
||||
|
||||
public function getStatusTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : (isset($data['status']) ? $data['status'] : '');
|
||||
$list = $this->getStatusList();
|
||||
return isset($list[$value]) ? $list[$value] : '';
|
||||
}
|
||||
|
||||
public function getOpenAreaList()
|
||||
{
|
||||
return ['北京市' => __('北京市'), '天津市' => __('天津市'), '上海市' => __('上海市'), '重庆市' => __('重庆市'), '河北省' => __('河北省'), '山西省' => __('山西省'), '辽宁省' => __('辽宁省'), '吉林省' => __('吉林省'), '黑龙江省' => __('黑龙江省'), '江苏省' => __('江苏省'), '浙江省' => __('浙江省'), '安徽省' => __('安徽省'), '福建省' => __('福建省'), '江西省' => __('江西省'), '山东省' => __('山东省'), '河南省' => __('河南省'), '湖北省' => __('湖北省'), '湖南省' => __('湖南省'), '广东省' => __('广东省'), '海南省' => __('海南省'), '四川省' => __('四川省'), '贵州省' => __('贵州省'), '云南省' => __('云南省'), '陕西省' => __('陕西省'), '甘肃省' => __('甘肃省'), '青海省' => __('青海省'), '内蒙古自治区' => __('内蒙古自治区'), '广西壮族自治区' => __('广西壮族自治区'), '西藏自治区' => __('西藏自治区'), '宁夏回族自治区' => __('宁夏回族自治区'), '新疆维吾尔自治区' => __('新疆维吾尔自治区'), '香港' => __('香港'), '澳门' => __('澳门'), '台湾省' => __('台湾省')];
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
85
application/admin/model/wdsxh/mall/Goods.php
Normal file
85
application/admin/model/wdsxh/mall/Goods.php
Normal file
@@ -0,0 +1,85 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | 麦沃德科技赋能开发者,助力商协会发展
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2017~2024 www.wdsxh.cn All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | 沃德商协会系统并不是自由软件,不加密,并不代表开源,未经许可不可自由转售和商用
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: MY WORLD Team <bd@maiwd.cn> www.maiwd.cn
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\admin\model\wdsxh\mall;
|
||||
|
||||
use think\Model;
|
||||
use traits\model\SoftDelete;
|
||||
|
||||
class Goods extends Model
|
||||
{
|
||||
|
||||
use SoftDelete;
|
||||
|
||||
|
||||
|
||||
// 表名
|
||||
protected $name = 'wdsxh_mall_goods';
|
||||
|
||||
// 自动写入时间戳字段
|
||||
protected $autoWriteTimestamp = 'integer';
|
||||
|
||||
// 定义时间戳字段名
|
||||
protected $createTime = 'createtime';
|
||||
protected $updateTime = 'updatetime';
|
||||
protected $deleteTime = 'deletetime';
|
||||
|
||||
// 追加属性
|
||||
protected $append = [
|
||||
'is_hot_text',
|
||||
'status_text'
|
||||
];
|
||||
|
||||
|
||||
protected static function init()
|
||||
{
|
||||
self::afterInsert(function ($row) {
|
||||
$pk = $row->getPk();
|
||||
$row->getQuery()->where($pk, $row[$pk])->update(['weigh' => $row[$pk]]);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
public function getIsHotList()
|
||||
{
|
||||
return ['1' => __('Is_hot 1'), '0' => __('Is_hot 0')];
|
||||
}
|
||||
|
||||
public function getStatusList()
|
||||
{
|
||||
return ['normal' => __('Status normal'), 'hidden' => __('Status hidden')];
|
||||
}
|
||||
|
||||
|
||||
public function getIsHotTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : (isset($data['is_hot']) ? $data['is_hot'] : '');
|
||||
$list = $this->getIsHotList();
|
||||
return isset($list[$value]) ? $list[$value] : '';
|
||||
}
|
||||
|
||||
|
||||
public function getStatusTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : (isset($data['status']) ? $data['status'] : '');
|
||||
$list = $this->getStatusList();
|
||||
return isset($list[$value]) ? $list[$value] : '';
|
||||
}
|
||||
|
||||
|
||||
public function category()
|
||||
{
|
||||
return $this->belongsTo('app\admin\model\wdsxh\mall\GoodsCategory','category_id','id')->setEagerlyType(0);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
65
application/admin/model/wdsxh/mall/GoodsCategory.php
Normal file
65
application/admin/model/wdsxh/mall/GoodsCategory.php
Normal file
@@ -0,0 +1,65 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | 麦沃德科技赋能开发者,助力商协会发展
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2017~2024 www.wdsxh.cn All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | 沃德商协会系统并不是自由软件,不加密,并不代表开源,未经许可不可自由转售和商用
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: MY WORLD Team <bd@maiwd.cn> www.maiwd.cn
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\admin\model\wdsxh\mall;
|
||||
|
||||
use think\Model;
|
||||
use traits\model\SoftDelete;
|
||||
|
||||
class GoodsCategory extends Model
|
||||
{
|
||||
|
||||
use SoftDelete;
|
||||
|
||||
|
||||
|
||||
// 表名
|
||||
protected $name = 'wdsxh_single_category';
|
||||
|
||||
// 自动写入时间戳字段
|
||||
protected $autoWriteTimestamp = 'integer';
|
||||
|
||||
// 定义时间戳字段名
|
||||
protected $createTime = 'createtime';
|
||||
protected $updateTime = 'updatetime';
|
||||
protected $deleteTime = 'deletetime';
|
||||
|
||||
// 追加属性
|
||||
protected $append = [
|
||||
'status_text'
|
||||
];
|
||||
|
||||
|
||||
protected static function init()
|
||||
{
|
||||
self::afterInsert(function ($row) {
|
||||
$pk = $row->getPk();
|
||||
$row->getQuery()->where($pk, $row[$pk])->update(['weigh' => $row[$pk]]);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
public function getStatusList()
|
||||
{
|
||||
return ['0' => __('Status 0'), '1' => __('Status 1')];
|
||||
}
|
||||
|
||||
|
||||
public function getStatusTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : (isset($data['status']) ? $data['status'] : '');
|
||||
$list = $this->getStatusList();
|
||||
return isset($list[$value]) ? $list[$value] : '';
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
21
application/admin/model/wdsxh/mall/Logistics.php
Normal file
21
application/admin/model/wdsxh/mall/Logistics.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | 麦沃德科技赋能开发者,助力商协会发展
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2017~2024 www.wdsxh.cn All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | 沃德商协会系统并不是自由软件,不加密,并不代表开源,未经许可不可自由转售和商用
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: MY WORLD Team <bd@maiwd.cn> www.maiwd.cn
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\admin\model\wdsxh\mall;
|
||||
|
||||
use think\Model;
|
||||
|
||||
class Logistics extends Model
|
||||
{
|
||||
|
||||
// 表名
|
||||
protected $name = 'wdsxh_mall_order_logistics';
|
||||
|
||||
}
|
||||
157
application/admin/model/wdsxh/mall/Order.php
Normal file
157
application/admin/model/wdsxh/mall/Order.php
Normal file
@@ -0,0 +1,157 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | 麦沃德科技赋能开发者,助力商协会发展
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2017~2024 www.wdsxh.cn All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | 沃德商协会系统并不是自由软件,不加密,并不代表开源,未经许可不可自由转售和商用
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: MY WORLD Team <bd@maiwd.cn> www.maiwd.cn
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\admin\model\wdsxh\mall;
|
||||
|
||||
use think\Model;
|
||||
use traits\model\SoftDelete;
|
||||
|
||||
class Order extends Model
|
||||
{
|
||||
|
||||
use SoftDelete;
|
||||
|
||||
|
||||
|
||||
// 表名
|
||||
protected $name = 'wdsxh_mall_order';
|
||||
|
||||
// 自动写入时间戳字段
|
||||
protected $autoWriteTimestamp = 'integer';
|
||||
|
||||
// 定义时间戳字段名
|
||||
protected $createTime = 'createtime';
|
||||
protected $updateTime = false;
|
||||
protected $deleteTime = 'deletetime';
|
||||
|
||||
// 追加属性
|
||||
protected $append = [
|
||||
'state_text',
|
||||
'refund_status_text',
|
||||
'paid_text',
|
||||
'pay_time_text',
|
||||
'refund_reason_time_text',
|
||||
'complete_time_text',
|
||||
'cancel_time_text'
|
||||
];
|
||||
|
||||
|
||||
public function getBuyNowList()
|
||||
{
|
||||
return ['1' => __('Buy_now 1'), '2' => __('Buy_now 2')];
|
||||
}
|
||||
|
||||
public function getStateList()
|
||||
{
|
||||
return ['1' => __('待付款'), '2' => __('待发货'), '3' => __('待收货'),'4' => __('已完成')];
|
||||
}
|
||||
|
||||
public function getRefundStatusList()
|
||||
{
|
||||
return ['1' => __('未退款'), '2' => __('申请中'), '3' => __('待退货'), '4' => __('退款中'), '5' => __('已退款')];
|
||||
}
|
||||
|
||||
public function getPaidList()
|
||||
{
|
||||
return ['1' => __('未付款'), '2' => __('已付款')];
|
||||
}
|
||||
|
||||
public function getBuyNowTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : (isset($data['buy_now']) ? $data['buy_now'] : '');
|
||||
$list = $this->getBuyNowList();
|
||||
return isset($list[$value]) ? $list[$value] : '';
|
||||
}
|
||||
|
||||
public function getStateTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : (isset($data['state']) ? $data['state'] : '');
|
||||
$list = $this->getStateList();
|
||||
return isset($list[$value]) ? $list[$value] : '';
|
||||
}
|
||||
|
||||
|
||||
public function getRefundStatusTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : (isset($data['refund_status']) ? $data['refund_status'] : '');
|
||||
$list = $this->getRefundStatusList();
|
||||
return isset($list[$value]) ? $list[$value] : '';
|
||||
}
|
||||
|
||||
|
||||
public function getPaidTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : (isset($data['paid']) ? $data['paid'] : '');
|
||||
$list = $this->getPaidList();
|
||||
return isset($list[$value]) ? $list[$value] : '';
|
||||
}
|
||||
|
||||
|
||||
public function getPayTimeTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : (isset($data['pay_time']) ? $data['pay_time'] : '');
|
||||
return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
|
||||
}
|
||||
|
||||
|
||||
public function getRefundReasonTimeTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : (isset($data['refund_reason_time']) ? $data['refund_reason_time'] : '');
|
||||
return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
|
||||
}
|
||||
|
||||
|
||||
public function getCompleteTimeTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : (isset($data['complete_time']) ? $data['complete_time'] : '');
|
||||
return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
|
||||
}
|
||||
|
||||
|
||||
public function getCancelTimeTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : (isset($data['cancel_time']) ? $data['cancel_time'] : '');
|
||||
return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
|
||||
}
|
||||
|
||||
protected function setPayTimeAttr($value)
|
||||
{
|
||||
return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
|
||||
}
|
||||
|
||||
protected function setRefundReasonTimeAttr($value)
|
||||
{
|
||||
return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
|
||||
}
|
||||
|
||||
protected function setCompleteTimeAttr($value)
|
||||
{
|
||||
return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
|
||||
}
|
||||
|
||||
protected function setCancelTimeAttr($value)
|
||||
{
|
||||
return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
|
||||
}
|
||||
|
||||
public function getDeliveryMethodList()
|
||||
{
|
||||
return ['1' => __('Delivery_method 1'), '2' => __('Delivery_method 2')];
|
||||
}
|
||||
|
||||
public function getDeliveryMethodTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : (isset($data['buy_now']) ? $data['buy_now'] : '');
|
||||
$list = $this->getDeliveryMethodList();
|
||||
return isset($list[$value]) ? $list[$value] : '';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
32
application/admin/model/wdsxh/mall/OrderRefundLog.php
Normal file
32
application/admin/model/wdsxh/mall/OrderRefundLog.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | 麦沃德科技赋能开发者,助力商协会发展
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2017~2024 www.wdsxh.cn All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | 沃德商协会系统并不是自由软件,不加密,并不代表开源,未经许可不可自由转售和商用
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: MY WORLD Team <bd@maiwd.cn> www.maiwd.cn
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\admin\model\wdsxh\mall;
|
||||
|
||||
use think\Model;
|
||||
use traits\model\SoftDelete;
|
||||
|
||||
class OrderRefundLog extends Model
|
||||
{
|
||||
|
||||
use SoftDelete;
|
||||
|
||||
|
||||
|
||||
// 表名
|
||||
protected $name = 'wdsxh_mall_order_refund_log';
|
||||
// 自动写入时间戳字段
|
||||
protected $autoWriteTimestamp = 'integer';
|
||||
// 定义时间戳字段名
|
||||
protected $createTime = 'createtime';
|
||||
protected $updateTime = 'updatetime';
|
||||
|
||||
|
||||
}
|
||||
70
application/admin/model/wdsxh/mall/Refund.php
Normal file
70
application/admin/model/wdsxh/mall/Refund.php
Normal file
@@ -0,0 +1,70 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | 麦沃德科技赋能开发者,助力商协会发展
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2017~2024 www.wdsxh.cn All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | 沃德商协会系统并不是自由软件,不加密,并不代表开源,未经许可不可自由转售和商用
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: MY WORLD Team <bd@maiwd.cn> www.maiwd.cn
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\admin\model\wdsxh\mall;
|
||||
|
||||
use think\Model;
|
||||
|
||||
|
||||
class Refund extends Model
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// 表名
|
||||
protected $name = 'wdsxh_mall_order_refund';
|
||||
|
||||
// 自动写入时间戳字段
|
||||
protected $autoWriteTimestamp = 'integer';
|
||||
|
||||
// 定义时间戳字段名
|
||||
protected $createTime = 'createtime';
|
||||
protected $updateTime = false;
|
||||
protected $deleteTime = false;
|
||||
|
||||
// 追加属性
|
||||
protected $append = [
|
||||
'refund_time_text',
|
||||
'add_express_no_time_text'
|
||||
];
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public function getRefundTimeTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : (isset($data['refund_time']) ? $data['refund_time'] : '');
|
||||
return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
|
||||
}
|
||||
|
||||
|
||||
public function getAddExpressNoTimeTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : (isset($data['add_express_no_time']) ? $data['add_express_no_time'] : '');
|
||||
return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
|
||||
}
|
||||
|
||||
protected function setRefundTimeAttr($value)
|
||||
{
|
||||
return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
|
||||
}
|
||||
|
||||
protected function setAddExpressNoTimeAttr($value)
|
||||
{
|
||||
return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
42
application/admin/model/wdsxh/mall/SelfPickup.php
Normal file
42
application/admin/model/wdsxh/mall/SelfPickup.php
Normal file
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | 麦沃德科技赋能开发者,助力中小企业发展
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2017~2024 www.wdadmin.cn All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Wdadmin系统产品软件并不是自由软件,不加密,并不代表开源,未经许可不可自由转售和商用
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: MY WORLD Team <bd@maiwd.cn> www.wdadmin.cn
|
||||
// +----------------------------------------------------------------------
|
||||
/**
|
||||
* Class SelfPickup
|
||||
* Desc 自提点Model
|
||||
* Create on 2025/4/15 14:23
|
||||
* Create by wangyafang
|
||||
*/
|
||||
|
||||
namespace app\admin\model\wdsxh\mall;
|
||||
|
||||
|
||||
use think\Model;
|
||||
|
||||
class SelfPickup extends Model
|
||||
{
|
||||
// 表名
|
||||
protected $name = 'wdsxh_mall_self_pickup';
|
||||
|
||||
|
||||
// 定义时间戳字段名
|
||||
protected $createTime = false;
|
||||
protected $updateTime = false;
|
||||
protected $deleteTime = false;
|
||||
|
||||
public function getIsStatusList()
|
||||
{
|
||||
return ['1' => __('Self_pickup_status 1'), '2' => __('Self_pickup_status 2')];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
91
application/admin/model/wdsxh/member/AuthConfig.php
Normal file
91
application/admin/model/wdsxh/member/AuthConfig.php
Normal file
@@ -0,0 +1,91 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | 麦沃德科技赋能开发者,助力商协会发展
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2017~2024 www.wdsxh.cn All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | 沃德商协会系统并不是自由软件,不加密,并不代表开源,未经许可不可自由转售和商用
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: MY WORLD Team <bd@maiwd.cn> www.maiwd.cn
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\admin\model\wdsxh\member;
|
||||
|
||||
use think\Model;
|
||||
|
||||
|
||||
class AuthConfig extends Model
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// 表名
|
||||
protected $name = 'wdsxh_member_auth_config';
|
||||
|
||||
// 自动写入时间戳字段
|
||||
protected $autoWriteTimestamp = false;
|
||||
|
||||
// 定义时间戳字段名
|
||||
protected $createTime = false;
|
||||
protected $updateTime = false;
|
||||
protected $deleteTime = false;
|
||||
|
||||
// 追加属性
|
||||
protected $append = [
|
||||
'address_book_is_openness_text',
|
||||
'address_book_is_exclusive_text',
|
||||
'member_details_text'
|
||||
];
|
||||
|
||||
|
||||
|
||||
public function getAddressBookIsOpennessList()
|
||||
{
|
||||
return ['1' => __('Address_book_is_openness 1'), '2' => __('Address_book_is_openness 2')];
|
||||
}
|
||||
|
||||
public function getAddressBookIsExclusiveList()
|
||||
{
|
||||
return ['1' => __('Address_book_is_exclusive 1'), '2' => __('Address_book_is_exclusive 2')];
|
||||
}
|
||||
|
||||
public function getMemberDetailsList()
|
||||
{
|
||||
return ['1' => __('Member_details 1'), '2' => __('Member_details 2'), '3' => __('Member_details 3')];
|
||||
}
|
||||
|
||||
public function getAddressBookSortOrderList()
|
||||
{
|
||||
return ['1' => __('Address_book_sort_order 1'), '2' => __('Address_book_sort_order 2'), '3' => __('Address_book_sort_order 3')];
|
||||
}
|
||||
|
||||
|
||||
public function getAddressBookIsOpennessTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : (isset($data['address_book_is_openness']) ? $data['address_book_is_openness'] : '');
|
||||
$list = $this->getAddressBookIsOpennessList();
|
||||
return isset($list[$value]) ? $list[$value] : '';
|
||||
}
|
||||
|
||||
|
||||
public function getAddressBookIsExclusiveTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : (isset($data['address_book_is_exclusive']) ? $data['address_book_is_exclusive'] : '');
|
||||
$list = $this->getAddressBookIsExclusiveList();
|
||||
return isset($list[$value]) ? $list[$value] : '';
|
||||
}
|
||||
|
||||
|
||||
public function getMemberDetailsTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : (isset($data['member_details']) ? $data['member_details'] : '');
|
||||
$list = $this->getMemberDetailsList();
|
||||
return isset($list[$value]) ? $list[$value] : '';
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
62
application/admin/model/wdsxh/member/Cert.php
Normal file
62
application/admin/model/wdsxh/member/Cert.php
Normal file
@@ -0,0 +1,62 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | 麦沃德科技赋能开发者,助力商协会发展
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2017~2024 www.wdsxh.cn All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | 沃德商协会系统并不是自由软件,不加密,并不代表开源,未经许可不可自由转售和商用
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: MY WORLD Team <bd@maiwd.cn> www.maiwd.cn
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\admin\model\wdsxh\member;
|
||||
|
||||
use think\Model;
|
||||
|
||||
|
||||
class Cert extends Model
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// 表名
|
||||
protected $name = 'wdsxh_member_cert';
|
||||
|
||||
// 自动写入时间戳字段
|
||||
protected $autoWriteTimestamp = 'integer';
|
||||
|
||||
// 定义时间戳字段名
|
||||
protected $createTime = 'createtime';
|
||||
protected $updateTime = 'updatetime';
|
||||
protected $deleteTime = false;
|
||||
|
||||
// 追加属性
|
||||
protected $append = [
|
||||
'channel_text'
|
||||
];
|
||||
|
||||
|
||||
|
||||
public function getChannelList()
|
||||
{
|
||||
return ['1' => __('Channel 1'), '2' => __('Channel 2')];
|
||||
}
|
||||
|
||||
|
||||
public function getChannelTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : (isset($data['channel']) ? $data['channel'] : '');
|
||||
$list = $this->getChannelList();
|
||||
return isset($list[$value]) ? $list[$value] : '';
|
||||
}
|
||||
|
||||
public function member()
|
||||
{
|
||||
return $this->belongsTo('app\admin\model\wdsxh\member\Member','member_id','id')->setEagerlyType(0);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
53
application/admin/model/wdsxh/member/Company.php
Normal file
53
application/admin/model/wdsxh/member/Company.php
Normal file
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | 麦沃德科技赋能开发者,助力商协会发展
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2017~2024 www.wdsxh.cn All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | 沃德商协会系统并不是自由软件,不加密,并不代表开源,未经许可不可自由转售和商用
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: MY WORLD Team <bd@maiwd.cn> www.maiwd.cn
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\admin\model\wdsxh\member;
|
||||
|
||||
use think\Model;
|
||||
|
||||
|
||||
class Company extends Model
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// 表名
|
||||
protected $name = 'wdsxh_member';
|
||||
|
||||
// 自动写入时间戳字段
|
||||
protected $autoWriteTimestamp = 'integer';
|
||||
|
||||
// 定义时间戳字段名
|
||||
protected $createTime = 'createtime';
|
||||
protected $updateTime = false;
|
||||
protected $deleteTime = false;
|
||||
|
||||
// 追加属性
|
||||
protected $append = [
|
||||
|
||||
];
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public function level()
|
||||
{
|
||||
return $this->belongsTo('Level', 'member_level_id', 'id', [], 'LEFT')->setEagerlyType(0);
|
||||
}
|
||||
}
|
||||
72
application/admin/model/wdsxh/member/FeesConfig.php
Normal file
72
application/admin/model/wdsxh/member/FeesConfig.php
Normal file
@@ -0,0 +1,72 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | 麦沃德科技赋能开发者,助力商协会发展
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2017~2024 www.wdsxh.cn All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | 沃德商协会系统并不是自由软件,不加密,并不代表开源,未经许可不可自由转售和商用
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: MY WORLD Team <bd@maiwd.cn> www.maiwd.cn
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\admin\model\wdsxh\member;
|
||||
|
||||
use think\Model;
|
||||
|
||||
|
||||
class FeesConfig extends Model
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// 表名
|
||||
protected $name = 'wdsxh_member_fees_config';
|
||||
|
||||
// 自动写入时间戳字段
|
||||
protected $autoWriteTimestamp = false;
|
||||
|
||||
// 定义时间戳字段名
|
||||
protected $createTime = false;
|
||||
protected $updateTime = false;
|
||||
protected $deleteTime = false;
|
||||
|
||||
// 追加属性
|
||||
protected $append = [
|
||||
'expire_time_type_text',
|
||||
'pay_method_text'
|
||||
];
|
||||
|
||||
|
||||
|
||||
public function getExpireTimeTypeList()
|
||||
{
|
||||
return ['1' => __('Expire_time_type 1'), '2' => __('Expire_time_type 2')];
|
||||
}
|
||||
|
||||
public function getPayMethodList()
|
||||
{
|
||||
return ['1' => __('Pay_method 1'), '2' => __('Pay_method 2'), '3' => __('Pay_method 3'), '4' => __('Pay_method 4')];
|
||||
}
|
||||
|
||||
|
||||
public function getExpireTimeTypeTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : (isset($data['expire_time_type']) ? $data['expire_time_type'] : '');
|
||||
$list = $this->getExpireTimeTypeList();
|
||||
return isset($list[$value]) ? $list[$value] : '';
|
||||
}
|
||||
|
||||
|
||||
public function getPayMethodTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : (isset($data['pay_method']) ? $data['pay_method'] : '');
|
||||
$list = $this->getPayMethodList();
|
||||
return isset($list[$value]) ? $list[$value] : '';
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
66
application/admin/model/wdsxh/member/IndustryCategory.php
Normal file
66
application/admin/model/wdsxh/member/IndustryCategory.php
Normal file
@@ -0,0 +1,66 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | 麦沃德科技赋能开发者,助力商协会发展
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2017~2024 www.wdsxh.cn All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | 沃德商协会系统并不是自由软件,不加密,并不代表开源,未经许可不可自由转售和商用
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: MY WORLD Team <bd@maiwd.cn> www.maiwd.cn
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\admin\model\wdsxh\member;
|
||||
|
||||
use think\Model;
|
||||
|
||||
|
||||
class IndustryCategory extends Model
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// 表名
|
||||
protected $name = 'wdsxh_member_industry_category';
|
||||
|
||||
// 自动写入时间戳字段
|
||||
protected $autoWriteTimestamp = false;
|
||||
|
||||
// 定义时间戳字段名
|
||||
protected $createTime = false;
|
||||
protected $updateTime = false;
|
||||
protected $deleteTime = false;
|
||||
|
||||
// 追加属性
|
||||
protected $append = [
|
||||
'status_text'
|
||||
];
|
||||
|
||||
|
||||
protected static function init()
|
||||
{
|
||||
self::afterInsert(function ($row) {
|
||||
$pk = $row->getPk();
|
||||
$row->getQuery()->where($pk, $row[$pk])->update(['weigh' => $row[$pk]]);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
public function getStatusList()
|
||||
{
|
||||
return ['0' => __('Status 0'), '1' => __('Status 1')];
|
||||
}
|
||||
|
||||
|
||||
public function getStatusTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : (isset($data['status']) ? $data['status'] : '');
|
||||
$list = $this->getStatusList();
|
||||
return isset($list[$value]) ? $list[$value] : '';
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
121
application/admin/model/wdsxh/member/JoinConfig.php
Normal file
121
application/admin/model/wdsxh/member/JoinConfig.php
Normal file
@@ -0,0 +1,121 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | 麦沃德科技赋能开发者,助力商协会发展
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2017~2024 www.wdsxh.cn All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | 沃德商协会系统并不是自由软件,不加密,并不代表开源,未经许可不可自由转售和商用
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: MY WORLD Team <bd@maiwd.cn> www.maiwd.cn
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\admin\model\wdsxh\member;
|
||||
|
||||
use think\Model;
|
||||
|
||||
|
||||
class JoinConfig extends Model
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// 表名
|
||||
protected $name = 'wdsxh_member_join_config';
|
||||
|
||||
// 自动写入时间戳字段
|
||||
protected $autoWriteTimestamp = false;
|
||||
|
||||
// 定义时间戳字段名
|
||||
protected $createTime = false;
|
||||
protected $updateTime = false;
|
||||
protected $deleteTime = false;
|
||||
|
||||
// 追加属性
|
||||
protected $append = [
|
||||
'type_text',
|
||||
'status_text'
|
||||
];
|
||||
|
||||
|
||||
|
||||
public function getTypeList()
|
||||
{
|
||||
return ['1' => __('Type 1'), '2' => __('Type 2'), '3' => __('Type 3')];
|
||||
}
|
||||
|
||||
public function getStatusList()
|
||||
{
|
||||
return ['normal' => __('Status normal'), 'hidden' => __('Status hidden')];
|
||||
}
|
||||
|
||||
|
||||
public function getTypeTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : (isset($data['type']) ? $data['type'] : '');
|
||||
$list = $this->getTypeList();
|
||||
return isset($list[$value]) ? $list[$value] : '';
|
||||
}
|
||||
|
||||
|
||||
public function getStatusTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : (isset($data['status']) ? $data['status'] : '');
|
||||
$list = $this->getStatusList();
|
||||
return isset($list[$value]) ? $list[$value] : '';
|
||||
}
|
||||
|
||||
public static function person_fieldset()
|
||||
{
|
||||
$config_file = ADDON_PATH . "wdsxh" . DS . 'config' . DS ."person.php";
|
||||
if (is_file($config_file)) {
|
||||
$person_fieldset = include $config_file;
|
||||
}
|
||||
if (empty($person_fieldset)) {
|
||||
$person_fieldset = Member::person_data();
|
||||
}
|
||||
return $person_fieldset;
|
||||
}
|
||||
|
||||
public static function company_fieldset()
|
||||
{
|
||||
$config_file = ADDON_PATH . "wdsxh" . DS . 'config' . DS ."company.php";
|
||||
if (is_file($config_file)) {
|
||||
$company_file_data = include $config_file;
|
||||
$person_fieldset = $company_file_data['person'];
|
||||
$company_fieldset = $company_file_data['company'];
|
||||
}
|
||||
if (empty($company_fieldset)) {
|
||||
$person_fieldset = Member::company_person_data();
|
||||
$company_fieldset = Member::company_data();
|
||||
}
|
||||
$data = array(
|
||||
$person_fieldset,
|
||||
$company_fieldset,
|
||||
);
|
||||
return $data;
|
||||
}
|
||||
|
||||
public static function organize_fieldset()
|
||||
{
|
||||
$config_file = ADDON_PATH . "wdsxh" . DS . 'config' . DS ."organize.php";
|
||||
if (is_file($config_file)) {
|
||||
$organize_file_data = include $config_file;
|
||||
$person_fieldset = $organize_file_data['person'];
|
||||
$organize_fieldset = $organize_file_data['organize'];
|
||||
}
|
||||
if (empty($organize_fieldset)) {
|
||||
$person_fieldset = Member::organize_person_data();
|
||||
$organize_fieldset = Member::organize_data();
|
||||
}
|
||||
$data = array(
|
||||
$person_fieldset,
|
||||
$organize_fieldset,
|
||||
);
|
||||
return $data;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
66
application/admin/model/wdsxh/member/Level.php
Normal file
66
application/admin/model/wdsxh/member/Level.php
Normal file
@@ -0,0 +1,66 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | 麦沃德科技赋能开发者,助力商协会发展
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2017~2024 www.wdsxh.cn All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | 沃德商协会系统并不是自由软件,不加密,并不代表开源,未经许可不可自由转售和商用
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: MY WORLD Team <bd@maiwd.cn> www.maiwd.cn
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\admin\model\wdsxh\member;
|
||||
|
||||
use think\Model;
|
||||
|
||||
|
||||
class Level extends Model
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// 表名
|
||||
protected $name = 'wdsxh_member_level';
|
||||
|
||||
// 自动写入时间戳字段
|
||||
protected $autoWriteTimestamp = 'integer';
|
||||
|
||||
// 定义时间戳字段名
|
||||
protected $createTime = 'createtime';
|
||||
protected $updateTime = 'updatetime';
|
||||
protected $deleteTime = false;
|
||||
|
||||
// 追加属性
|
||||
protected $append = [
|
||||
'status_text'
|
||||
];
|
||||
|
||||
|
||||
protected static function init()
|
||||
{
|
||||
self::afterInsert(function ($row) {
|
||||
$pk = $row->getPk();
|
||||
$row->getQuery()->where($pk, $row[$pk])->update(['weigh' => $row[$pk]]);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
public function getStatusList()
|
||||
{
|
||||
return ['normal' => __('Status normal'), 'hidden' => __('Status hidden')];
|
||||
}
|
||||
|
||||
|
||||
public function getStatusTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : (isset($data['status']) ? $data['status'] : '');
|
||||
$list = $this->getStatusList();
|
||||
return isset($list[$value]) ? $list[$value] : '';
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
609
application/admin/model/wdsxh/member/Member.php
Normal file
609
application/admin/model/wdsxh/member/Member.php
Normal file
@@ -0,0 +1,609 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | 麦沃德科技赋能开发者,助力商协会发展
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2017~2024 www.wdsxh.cn All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | 沃德商协会系统并不是自由软件,不加密,并不代表开源,未经许可不可自由转售和商用
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: MY WORLD Team <bd@maiwd.cn> www.maiwd.cn
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\admin\model\wdsxh\member;
|
||||
|
||||
use think\Model;
|
||||
|
||||
|
||||
class Member extends Model
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// 表名
|
||||
protected $name = 'wdsxh_member';
|
||||
|
||||
// 自动写入时间戳字段
|
||||
protected $autoWriteTimestamp = 'integer';
|
||||
|
||||
// 定义时间戳字段名
|
||||
protected $createTime = 'createtime';
|
||||
protected $updateTime = false;
|
||||
protected $deleteTime = false;
|
||||
|
||||
// 追加属性
|
||||
protected $append = [
|
||||
'type_text'
|
||||
];
|
||||
|
||||
protected static function init()
|
||||
{
|
||||
self::afterInsert(function ($row) {
|
||||
$pk = $row->getPk();
|
||||
if (isset($row['native_place']) && !empty($row['native_place'])) {
|
||||
$native_place = $row['native_place'];
|
||||
$nativePlaceArray = explode('/',$native_place);
|
||||
if (count($nativePlaceArray) == 3) {
|
||||
$area_letter = \app\common\model\wdsxh\member\Member::getFirstCharter($nativePlaceArray[2]);
|
||||
$row->getQuery()->where($pk, $row[$pk])->update(['area_letter' => $area_letter]);
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($row['channel']) && $row['channel'] == 3) {
|
||||
$pay_time = time();
|
||||
$payData = array(
|
||||
'member_id'=>$row[$pk],
|
||||
'wechat_id'=>isset($row['wechat_id']) && !empty($row['wechat_id']) ? $row['wechat_id'] : '',
|
||||
'order_no'=>wdsxh_create_order(),
|
||||
'fees'=>(new Level())->where('id',$row['member_level_id'])->value('fees'),
|
||||
'paid'=>'2',
|
||||
'pay_time'=>$pay_time,
|
||||
'level_id'=>$row['member_level_id'],
|
||||
'channel'=>'3',
|
||||
'pay_method'=>'4',
|
||||
'delivery_state'=>'2'
|
||||
);
|
||||
(new Pay())->allowField(true)->save($payData);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
self::afterUpdate(function ($row) {
|
||||
$native_place = $row['native_place'];
|
||||
$nativePlaceArray = explode('/',$native_place);
|
||||
if (count($nativePlaceArray) == 3) {
|
||||
$area_letter = \app\common\model\wdsxh\member\Member::getFirstCharter($nativePlaceArray[2]);
|
||||
$pk = $row->getPk();
|
||||
$row->getQuery()->where($pk, $row[$pk])->update(['area_letter' => $area_letter]);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
public function getStatusList()
|
||||
{
|
||||
return ['normal' => __('Status normal'), 'hidden' => __('Status hidden')];
|
||||
}
|
||||
|
||||
public function getTypeList()
|
||||
{
|
||||
return ['1' => __('Type 1'), '2' => __('Type 2'), '3' => __('Type 3')];
|
||||
}
|
||||
|
||||
public function getTypeTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : (isset($data['type']) ? $data['type'] : '');
|
||||
$list = $this->getTypeList();
|
||||
return isset($list[$value]) ? $list[$value] : '';
|
||||
}
|
||||
|
||||
public function wechat()
|
||||
{
|
||||
return $this->belongsTo('app\admin\model\wdsxh\user\Wechat', 'wechat_id', 'id', [], 'LEFT')->setEagerlyType(0);
|
||||
}
|
||||
|
||||
public function level()
|
||||
{
|
||||
return $this->belongsTo('Level', 'member_level_id', 'id', [], 'LEFT')->setEagerlyType(0);
|
||||
}
|
||||
|
||||
public function industry()
|
||||
{
|
||||
return $this->belongsTo('\app\admin\model\wdsxh\member\IndustryCategory', 'industry_category_id', 'id', [], 'LEFT')->setEagerlyType(0);
|
||||
}
|
||||
|
||||
//$person_original_custom_content 个人原始字段(new \app\admin\model\wdsxh\member\JoinConfig)->person_data();
|
||||
//$company_original_custom_content 企业原始字段(new \app\admin\model\wdsxh\member\JoinConfig)->company_data();
|
||||
//$organize_original_custom_content 组织原始字段(new \app\admin\model\wdsxh\member\JoinConfig)->organize_data();
|
||||
public static function get_member_edit_params($type = '',$person_original_custom_content = '',$params = array(),$company_original_custom_content = '',$organize_original_custom_content = '')
|
||||
{
|
||||
$joinConfigController = new \app\admin\controller\wdsxh\member\JoinConfig();
|
||||
switch ($type) {
|
||||
case 1:
|
||||
$custom_content = self::get_member_edit_custom_content($person_original_custom_content,$params);
|
||||
$fieldset = array_column(self::person_data(), 'field');
|
||||
foreach ($custom_content as $v) {
|
||||
if (in_array($v['field'],$fieldset)) {
|
||||
if ($v['field'] == 'address') {
|
||||
$params['address'] = $v['value']['address'];
|
||||
$params['latitude'] = $v['value']['latitude'];
|
||||
$params['longitude'] = $v['value']['longitude'];
|
||||
} else {
|
||||
$params[$v['field']] = $v['value'];
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
$params['custom_content'] = json_encode($custom_content);
|
||||
break;
|
||||
case 2:
|
||||
$person_custom_content = self::get_member_edit_custom_content($person_original_custom_content,$params);
|
||||
$fieldset = array_column(self::company_person_data(), 'field');
|
||||
foreach ($person_custom_content as $v) {
|
||||
if (in_array($v['field'],$fieldset)) {
|
||||
if ($v['field'] == 'address') {
|
||||
$params['address'] = $v['value']['address'];
|
||||
$params['latitude'] = $v['value']['latitude'];
|
||||
$params['longitude'] = $v['value']['longitude'];
|
||||
} else {
|
||||
$params[$v['field']] = $v['value'];
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
$company_custom_content = self::get_member_edit_custom_content($company_original_custom_content,$params);
|
||||
$fieldset = array_column(self::company_data(), 'field');
|
||||
foreach ($company_custom_content as $v) {
|
||||
if (in_array($v['field'],$fieldset)) {
|
||||
$params[$v['field']] = $v['value'];
|
||||
}
|
||||
}
|
||||
$custom_content = array(
|
||||
'person'=>$person_custom_content,
|
||||
'company'=>$company_custom_content,
|
||||
);
|
||||
$params['custom_content'] = json_encode($custom_content);
|
||||
break;
|
||||
case 3:
|
||||
$person_custom_content = self::get_member_edit_custom_content($person_original_custom_content,$params);
|
||||
$fieldset = array_column(self::organize_person_data(), 'field');
|
||||
foreach ($person_custom_content as $v) {
|
||||
if (in_array($v['field'],$fieldset)) {
|
||||
if ($v['field'] == 'address') {
|
||||
$params['address'] = $v['value']['address'];
|
||||
$params['latitude'] = $v['value']['latitude'];
|
||||
$params['longitude'] = $v['value']['longitude'];
|
||||
} else {
|
||||
$params[$v['field']] = $v['value'];
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
$organize_custom_content = self::get_member_edit_custom_content($organize_original_custom_content,$params);
|
||||
$fieldset = array_column(self::organize_data(), 'field');
|
||||
foreach ($organize_custom_content as $v) {
|
||||
if (in_array($v['field'],$fieldset)) {
|
||||
$params[$v['field']] = $v['value'];
|
||||
}
|
||||
}
|
||||
$custom_content = array(
|
||||
'person'=>$person_custom_content,
|
||||
'organize'=>$organize_custom_content,
|
||||
);
|
||||
$params['custom_content'] = json_encode($custom_content);
|
||||
break;
|
||||
|
||||
}
|
||||
$params['member_level_name'] = (new Level())->where('id',$params['member_level_id'])->value('name');
|
||||
|
||||
if (!empty($params['industry_category_id'])) {
|
||||
$params['industry_category_name'] = (new IndustryCategory())->where('id',$params['industry_category_id'])->value('name');
|
||||
} else {
|
||||
$params['industry_category_name'] = '';
|
||||
}
|
||||
|
||||
return $params;
|
||||
}
|
||||
|
||||
public static function get_member_edit_custom_content($original_custom_content,$params) {
|
||||
$custom_content = json_decode($original_custom_content,true);
|
||||
|
||||
|
||||
foreach ($custom_content as $k=>$v) {
|
||||
if ($v['field'] == 'address') {
|
||||
if (isset($params['custom_content']['address']['address']) && !empty($params['custom_content']['address']['address'])) {
|
||||
$custom_content[$k]['value']['address'] = $params['custom_content']['address']['address'];
|
||||
$custom_content[$k]['value']['latitude'] = $params['custom_content']['address']['latitude'];
|
||||
$custom_content[$k]['value']['longitude'] = $params['custom_content']['address']['longitude'];
|
||||
} else {
|
||||
$custom_content[$k]['value']['address'] = '';
|
||||
$custom_content[$k]['value']['latitude'] = '';
|
||||
$custom_content[$k]['value']['longitude'] = '';
|
||||
}
|
||||
} elseif ($v['type'] == 'checkbox') {
|
||||
$custom_content[$k]['value'] = implode(',',$params['custom_content'][$v['field']]);
|
||||
} elseif ($v['type'] == 'cert') {
|
||||
$custom_content[$k]['value'] = array(
|
||||
'name'=>$params['custom_content'][$v['field']]['name'],
|
||||
'number'=>$params['custom_content'][$v['field']]['number'],
|
||||
'image'=>$params['custom_content'][$v['field']]['image'],
|
||||
);
|
||||
} else {//解决radio没有选中问题
|
||||
$custom_content[$k]['value'] = isset($params['custom_content'][$v['field']]) ? $params['custom_content'][$v['field']] : '';
|
||||
}
|
||||
if ($v['field'] == 'avatar' && empty($custom_content[$k]['value'])) {
|
||||
$custom_content[$k]['value'] = '/assets/addons/wdsxh/img/avatar.png';
|
||||
}
|
||||
if ($v['field'] == 'company_logo' && empty($custom_content[$k]['value'])) {
|
||||
$custom_content[$k]['value'] = '/assets/addons/wdsxh/img/company_logo.png';
|
||||
}
|
||||
if ($v['field'] == 'organize_logo' && empty($custom_content[$k]['value'])) {
|
||||
$custom_content[$k]['value'] = '/assets/addons/wdsxh/img/organize_logo.png';
|
||||
}
|
||||
}
|
||||
|
||||
return $custom_content;
|
||||
}
|
||||
|
||||
public static function organize_data()
|
||||
{
|
||||
$data = array(
|
||||
0 =>
|
||||
array(
|
||||
'show' => '1',
|
||||
'apply_show' => '1',
|
||||
'required' => '1',
|
||||
'type' => 'text',
|
||||
'label' => '团体名称',
|
||||
'field' => 'organize_name',
|
||||
'option' => '请输入团体名称',
|
||||
),
|
||||
1 =>
|
||||
array(
|
||||
'show' => '1',
|
||||
'apply_show' => '1',
|
||||
'required' => '1',
|
||||
'type' => 'image',
|
||||
'label' => '团体Logo',
|
||||
'field' => 'organize_logo',
|
||||
'option' => '请上传团体Logo',
|
||||
),
|
||||
2 =>
|
||||
array(
|
||||
'show' => '1',
|
||||
'apply_show' => '1',
|
||||
'required' => '1',
|
||||
'type' => 'textarea',
|
||||
'label' => '团体简介',
|
||||
'field' => 'organize_introduction',
|
||||
'option' => '请输入团体简介',
|
||||
),
|
||||
);
|
||||
return $data;
|
||||
}
|
||||
|
||||
public static function company_person_data()
|
||||
{
|
||||
$data = array(
|
||||
0 =>
|
||||
array(
|
||||
'show' => '1',
|
||||
'apply_show' => '1',
|
||||
'required' => '1',
|
||||
'type' => 'text',
|
||||
'label' => '姓名',
|
||||
'field' => 'name',
|
||||
'option' => '请输入你的姓名',
|
||||
),
|
||||
1 =>
|
||||
array(
|
||||
'show' => '1',
|
||||
'apply_show' => '1',
|
||||
'required' => '1',
|
||||
'type' => 'image',
|
||||
'label' => '头像',
|
||||
'field' => 'avatar',
|
||||
'option' => '请上传头像',
|
||||
),
|
||||
2 =>
|
||||
array(
|
||||
'show' => '1',
|
||||
'apply_show' => '1',
|
||||
'required' => '1',
|
||||
'type' => 'number',
|
||||
'label' => '手机号',
|
||||
'field' => 'mobile',
|
||||
'option' => '请输入你的手机号',
|
||||
),
|
||||
3 =>
|
||||
array(
|
||||
'show' => '1',
|
||||
'apply_show' => '1',
|
||||
'required' => '1',
|
||||
'type' => 'select',
|
||||
'label' => '级别',
|
||||
'field' => 'member_level_id',
|
||||
'option' => '请选择会员级别',
|
||||
),
|
||||
4 =>
|
||||
array(
|
||||
'show' => '1',
|
||||
'apply_show' => '1',
|
||||
'required' => '1',
|
||||
'type' => 'select',
|
||||
'label' => '籍贯',
|
||||
'field' => 'native_place',
|
||||
'option' => '请选择籍贯',
|
||||
),
|
||||
5 =>
|
||||
array(
|
||||
'show' => '1',
|
||||
'apply_show' => '1',
|
||||
'required' => '1',
|
||||
'type' => 'textarea',
|
||||
'label' => '介绍',
|
||||
'field' => 'introduce_content',
|
||||
'option' => '请输入介绍',
|
||||
),
|
||||
6 =>
|
||||
array(
|
||||
'show' => '1',
|
||||
'apply_show' => '1',
|
||||
'required' => '1',
|
||||
'type' => 'text',
|
||||
'label' => '所在地址',
|
||||
'field' => 'address',
|
||||
'option' => '请选择所在地址',
|
||||
),
|
||||
7 =>
|
||||
array(
|
||||
'show' => '1',
|
||||
'apply_show' => '1',
|
||||
'required' => '1',
|
||||
'type' => 'select',
|
||||
'label' => '行业分类',
|
||||
'field' => 'industry_category_id',
|
||||
'option' => '请选择行业分类',
|
||||
),
|
||||
8 =>
|
||||
array(
|
||||
'show' => '1',
|
||||
'apply_show' => '1',
|
||||
'required' => '1',
|
||||
'type' => 'text',
|
||||
'label' => '公司职务',
|
||||
'field' => 'company_position',
|
||||
'option' => '请输入公司职务',
|
||||
),
|
||||
);
|
||||
return $data;
|
||||
}
|
||||
|
||||
public static function organize_person_data()
|
||||
{
|
||||
$data = array(
|
||||
0 =>
|
||||
array(
|
||||
'show' => '1',
|
||||
'apply_show' => '1',
|
||||
'required' => '1',
|
||||
'type' => 'text',
|
||||
'label' => '姓名',
|
||||
'field' => 'name',
|
||||
'option' => '请输入你的姓名',
|
||||
),
|
||||
1 =>
|
||||
array(
|
||||
'show' => '1',
|
||||
'apply_show' => '1',
|
||||
'required' => '1',
|
||||
'type' => 'image',
|
||||
'label' => '头像',
|
||||
'field' => 'avatar',
|
||||
'option' => '请上传头像',
|
||||
),
|
||||
2 =>
|
||||
array(
|
||||
'show' => '1',
|
||||
'apply_show' => '1',
|
||||
'required' => '1',
|
||||
'type' => 'number',
|
||||
'label' => '手机号',
|
||||
'field' => 'mobile',
|
||||
'option' => '请输入你的手机号',
|
||||
),
|
||||
3 =>
|
||||
array(
|
||||
'show' => '1',
|
||||
'apply_show' => '1',
|
||||
'required' => '1',
|
||||
'type' => 'select',
|
||||
'label' => '级别',
|
||||
'field' => 'member_level_id',
|
||||
'option' => '请选择会员级别',
|
||||
),
|
||||
4 =>
|
||||
array(
|
||||
'show' => '1',
|
||||
'apply_show' => '1',
|
||||
'required' => '1',
|
||||
'type' => 'select',
|
||||
'label' => '籍贯',
|
||||
'field' => 'native_place',
|
||||
'option' => '请选择籍贯',
|
||||
),
|
||||
5 =>
|
||||
array(
|
||||
'show' => '1',
|
||||
'apply_show' => '1',
|
||||
'required' => '1',
|
||||
'type' => 'textarea',
|
||||
'label' => '介绍',
|
||||
'field' => 'introduce_content',
|
||||
'option' => '请输入介绍',
|
||||
),
|
||||
6 =>
|
||||
array(
|
||||
'show' => '1',
|
||||
'apply_show' => '1',
|
||||
'required' => '1',
|
||||
'type' => 'text',
|
||||
'label' => '所在地址',
|
||||
'field' => 'address',
|
||||
'option' => '请选择所在地址',
|
||||
),
|
||||
7 =>
|
||||
array(
|
||||
'show' => '1',
|
||||
'apply_show' => '1',
|
||||
'required' => '1',
|
||||
'type' => 'select',
|
||||
'label' => '行业分类',
|
||||
'field' => 'industry_category_id',
|
||||
'option' => '请选择行业分类',
|
||||
),
|
||||
8 =>
|
||||
array(
|
||||
'show' => '1',
|
||||
'apply_show' => '1',
|
||||
'required' => '1',
|
||||
'type' => 'text',
|
||||
'label' => '团体职务',
|
||||
'field' => 'organize_position',
|
||||
'option' => '请输入团体职务',
|
||||
),
|
||||
);
|
||||
return $data;
|
||||
}
|
||||
|
||||
public static function person_data()
|
||||
{
|
||||
$data = array(
|
||||
0 =>
|
||||
array(
|
||||
'show' => '1',
|
||||
'apply_show' => '1',
|
||||
'required' => '1',
|
||||
'type' => 'text',
|
||||
'label' => '姓名',
|
||||
'field' => 'name',
|
||||
'option' => '请输入你的姓名',
|
||||
),
|
||||
1 =>
|
||||
array(
|
||||
'show' => '1',
|
||||
'apply_show' => '1',
|
||||
'required' => '1',
|
||||
'type' => 'image',
|
||||
'label' => '头像',
|
||||
'field' => 'avatar',
|
||||
'option' => '请上传头像',
|
||||
),
|
||||
2 =>
|
||||
array(
|
||||
'show' => '1',
|
||||
'apply_show' => '1',
|
||||
'required' => '1',
|
||||
'type' => 'number',
|
||||
'label' => '手机号',
|
||||
'field' => 'mobile',
|
||||
'option' => '请输入你的手机号',
|
||||
),
|
||||
3 =>
|
||||
array(
|
||||
'show' => '1',
|
||||
'apply_show' => '1',
|
||||
'required' => '1',
|
||||
'type' => 'select',
|
||||
'label' => '级别',
|
||||
'field' => 'member_level_id',
|
||||
'option' => '请选择会员级别',
|
||||
),
|
||||
4 =>
|
||||
array(
|
||||
'show' => '1',
|
||||
'apply_show' => '1',
|
||||
'required' => '1',
|
||||
'type' => 'select',
|
||||
'label' => '籍贯',
|
||||
'field' => 'native_place',
|
||||
'option' => '请选择籍贯',
|
||||
),
|
||||
5 =>
|
||||
array(
|
||||
'show' => '1',
|
||||
'apply_show' => '1',
|
||||
'required' => '1',
|
||||
'type' => 'textarea',
|
||||
'label' => '介绍',
|
||||
'field' => 'introduce_content',
|
||||
'option' => '请输入介绍',
|
||||
),
|
||||
6 =>
|
||||
array(
|
||||
'show' => '1',
|
||||
'apply_show' => '1',
|
||||
'required' => '1',
|
||||
'type' => 'text',
|
||||
'label' => '所在地址',
|
||||
'field' => 'address',
|
||||
'option' => '请选择所在地址',
|
||||
),
|
||||
7 =>
|
||||
array(
|
||||
'show' => '1',
|
||||
'apply_show' => '1',
|
||||
'required' => '1',
|
||||
'type' => 'select',
|
||||
'label' => '行业分类',
|
||||
'field' => 'industry_category_id',
|
||||
'option' => '请选择行业分类',
|
||||
),
|
||||
);
|
||||
return $data;
|
||||
}
|
||||
|
||||
public static function company_data()
|
||||
{
|
||||
$data = array(
|
||||
0 =>
|
||||
array(
|
||||
'show' => '1',
|
||||
'apply_show' => '1',
|
||||
'required' => '1',
|
||||
'type' => 'text',
|
||||
'label' => '公司名称',
|
||||
'field' => 'company_name',
|
||||
'option' => '请输入公司名称',
|
||||
),
|
||||
1 =>
|
||||
array(
|
||||
'show' => '1',
|
||||
'apply_show' => '1',
|
||||
'required' => '1',
|
||||
'type' => 'image',
|
||||
'label' => '公司Logo',
|
||||
'field' => 'company_logo',
|
||||
'option' => '请上传公司Logo',
|
||||
),
|
||||
2 =>
|
||||
array(
|
||||
'show' => '1',
|
||||
'apply_show' => '1',
|
||||
'required' => '1',
|
||||
'type' => 'textarea',
|
||||
'label' => '公司简介',
|
||||
'field' => 'company_introduction',
|
||||
'option' => '请输入公司简介',
|
||||
),
|
||||
);
|
||||
return $data;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
86
application/admin/model/wdsxh/member/MemberApply.php
Normal file
86
application/admin/model/wdsxh/member/MemberApply.php
Normal file
@@ -0,0 +1,86 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | 麦沃德科技赋能开发者,助力商协会发展
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2017~2024 www.wdsxh.cn All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | 沃德商协会系统并不是自由软件,不加密,并不代表开源,未经许可不可自由转售和商用
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: MY WORLD Team <bd@maiwd.cn> www.maiwd.cn
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\admin\model\wdsxh\member;
|
||||
|
||||
use think\Model;
|
||||
|
||||
|
||||
class MemberApply extends Model
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// 表名
|
||||
protected $name = 'wdsxh_member_apply';
|
||||
|
||||
// 自动写入时间戳字段
|
||||
protected $autoWriteTimestamp = 'integer';
|
||||
|
||||
// 定义时间戳字段名
|
||||
protected $createTime = 'createtime';
|
||||
protected $updateTime = false;
|
||||
protected $deleteTime = false;
|
||||
|
||||
// 追加属性
|
||||
protected $append = [
|
||||
'type_text',
|
||||
'state_text'
|
||||
];
|
||||
|
||||
|
||||
|
||||
public function getTypeList()
|
||||
{
|
||||
return ['1' => __('Type 1'), '2' => __('Type 2'), '3' => __('Type 3')];
|
||||
}
|
||||
|
||||
public function getStateList()
|
||||
{
|
||||
return ['1' => __('State 1'), '2' => __('State 2'), '3' => __('State 3'), '4' => __('State 4')];
|
||||
}
|
||||
|
||||
public function getStateExamineList()
|
||||
{
|
||||
return ['1' => __('State 1'), '2' => __('State 2'), '3' => __('State 3')];
|
||||
}
|
||||
|
||||
|
||||
public function getTypeTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : (isset($data['type']) ? $data['type'] : '');
|
||||
$list = $this->getTypeList();
|
||||
return isset($list[$value]) ? $list[$value] : '';
|
||||
}
|
||||
|
||||
|
||||
public function getStateTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : (isset($data['state']) ? $data['state'] : '');
|
||||
$list = $this->getStateList();
|
||||
return isset($list[$value]) ? $list[$value] : '';
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public function level()
|
||||
{
|
||||
return $this->belongsTo('app\admin\model\wdsxh\member\Level', 'member_level_id', 'id', [], 'LEFT')->setEagerlyType(0);
|
||||
}
|
||||
|
||||
public function getPayVoucherAttr($value)
|
||||
{
|
||||
return wdsxh_full_url($value);
|
||||
}
|
||||
}
|
||||
53
application/admin/model/wdsxh/member/Organize.php
Normal file
53
application/admin/model/wdsxh/member/Organize.php
Normal file
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | 麦沃德科技赋能开发者,助力商协会发展
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2017~2024 www.wdsxh.cn All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | 沃德商协会系统并不是自由软件,不加密,并不代表开源,未经许可不可自由转售和商用
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: MY WORLD Team <bd@maiwd.cn> www.maiwd.cn
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\admin\model\wdsxh\member;
|
||||
|
||||
use think\Model;
|
||||
|
||||
|
||||
class Organize extends Model
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// 表名
|
||||
protected $name = 'wdsxh_member';
|
||||
|
||||
// 自动写入时间戳字段
|
||||
protected $autoWriteTimestamp = 'integer';
|
||||
|
||||
// 定义时间戳字段名
|
||||
protected $createTime = 'createtime';
|
||||
protected $updateTime = false;
|
||||
protected $deleteTime = false;
|
||||
|
||||
// 追加属性
|
||||
protected $append = [
|
||||
|
||||
];
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public function level()
|
||||
{
|
||||
return $this->belongsTo('Level', 'member_level_id', 'id', [], 'LEFT')->setEagerlyType(0);
|
||||
}
|
||||
}
|
||||
83
application/admin/model/wdsxh/member/Pay.php
Normal file
83
application/admin/model/wdsxh/member/Pay.php
Normal file
@@ -0,0 +1,83 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | 麦沃德科技赋能开发者,助力商协会发展
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2017~2024 www.wdsxh.cn All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | 沃德商协会系统并不是自由软件,不加密,并不代表开源,未经许可不可自由转售和商用
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: MY WORLD Team <bd@maiwd.cn> www.maiwd.cn
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\admin\model\wdsxh\member;
|
||||
|
||||
use think\Model;
|
||||
|
||||
|
||||
class Pay extends Model
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// 表名
|
||||
protected $name = 'wdsxh_member_pay';
|
||||
|
||||
// 自动写入时间戳字段
|
||||
protected $autoWriteTimestamp = 'integer';
|
||||
|
||||
// 定义时间戳字段名
|
||||
protected $createTime = 'createtime';
|
||||
protected $updateTime = false;
|
||||
protected $deleteTime = false;
|
||||
|
||||
// 追加属性
|
||||
protected $append = [
|
||||
'paid_text',
|
||||
'pay_time_text'
|
||||
];
|
||||
|
||||
|
||||
|
||||
public function getPaidList()
|
||||
{
|
||||
return ['1' => __('Paid 1'), '2' => __('Paid 2')];
|
||||
}
|
||||
|
||||
|
||||
public function getPaidTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : (isset($data['paid']) ? $data['paid'] : '');
|
||||
$list = $this->getPaidList();
|
||||
return isset($list[$value]) ? $list[$value] : '';
|
||||
}
|
||||
|
||||
|
||||
public function getPayTimeTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : (isset($data['pay_time']) ? $data['pay_time'] : '');
|
||||
return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
|
||||
}
|
||||
|
||||
protected function setPayTimeAttr($value)
|
||||
{
|
||||
return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
|
||||
}
|
||||
|
||||
|
||||
public function level()
|
||||
{
|
||||
return $this->belongsTo('Level', 'level_id', 'id', [], 'LEFT')->setEagerlyType(0);
|
||||
}
|
||||
|
||||
public function wechat()
|
||||
{
|
||||
return $this->belongsTo('app\admin\model\wdsxh\user\UserWechat', 'wechat_id', 'id', [], 'LEFT')->setEagerlyType(0);
|
||||
}
|
||||
|
||||
public function member()
|
||||
{
|
||||
return $this->belongsTo('app\admin\model\wdsxh\member\Member', 'member_id', 'id', [], 'LEFT')->setEagerlyType(0);
|
||||
}
|
||||
}
|
||||
50
application/admin/model/wdsxh/member/Person.php
Normal file
50
application/admin/model/wdsxh/member/Person.php
Normal file
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | 麦沃德科技赋能开发者,助力商协会发展
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2017~2024 www.wdsxh.cn All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | 沃德商协会系统并不是自由软件,不加密,并不代表开源,未经许可不可自由转售和商用
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: MY WORLD Team <bd@maiwd.cn> www.maiwd.cn
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\admin\model\wdsxh\member;
|
||||
|
||||
use think\Model;
|
||||
|
||||
|
||||
class Person extends Model
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// 表名
|
||||
protected $name = 'wdsxh_member';
|
||||
|
||||
// 自动写入时间戳字段
|
||||
protected $autoWriteTimestamp = 'integer';
|
||||
|
||||
// 定义时间戳字段名
|
||||
protected $createTime = 'createtime';
|
||||
protected $updateTime = false;
|
||||
protected $deleteTime = false;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
44
application/admin/model/wdsxh/member/Promotion.php
Normal file
44
application/admin/model/wdsxh/member/Promotion.php
Normal file
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | 麦沃德科技赋能开发者,助力商协会发展
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2017~2024 www.wdsxh.cn All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | 沃德商协会系统并不是自由软件,不加密,并不代表开源,未经许可不可自由转售和商用
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: MY WORLD Team <bd@maiwd.cn> www.maiwd.cn
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\admin\model\wdsxh\member;
|
||||
|
||||
use think\Model;
|
||||
|
||||
|
||||
class Promotion extends Model
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// 表名
|
||||
protected $name = 'wdsxh_member_promotion';
|
||||
|
||||
// 自动写入时间戳字段
|
||||
protected $autoWriteTimestamp = 'integer';
|
||||
|
||||
// 定义时间戳字段名
|
||||
protected $createTime = 'createtime';
|
||||
protected $updateTime = false;
|
||||
protected $deleteTime = false;
|
||||
|
||||
// 追加属性
|
||||
protected $append = [
|
||||
|
||||
];
|
||||
|
||||
public function member()
|
||||
{
|
||||
return $this->belongsTo('app\admin\model\wdsxh\Member', 'member_id', 'id', [], 'LEFT')->setEagerlyType(0);
|
||||
}
|
||||
}
|
||||
108
application/admin/model/wdsxh/message/MemberNotification.php
Normal file
108
application/admin/model/wdsxh/message/MemberNotification.php
Normal file
@@ -0,0 +1,108 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | 麦沃德科技赋能开发者,助力商协会发展
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2017~2024 www.wdsxh.cn All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | 沃德商协会系统并不是自由软件,不加密,并不代表开源,未经许可不可自由转售和商用
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: MY WORLD Team <bd@maiwd.cn> www.maiwd.cn
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\admin\model\wdsxh\message;
|
||||
|
||||
use think\Model;
|
||||
|
||||
/**
|
||||
* 会员消息通知模型
|
||||
*/
|
||||
class MemberNotification extends Model
|
||||
{
|
||||
// 表名
|
||||
protected $name = 'wdsxh_member_notification';
|
||||
|
||||
// 自动写入时间戳字段
|
||||
protected $autoWriteTimestamp = 'int';
|
||||
|
||||
// 定义时间戳字段名
|
||||
protected $createTime = 'createtime';
|
||||
protected $updateTime = false;
|
||||
|
||||
// 追加属性
|
||||
protected $append = [
|
||||
'is_read_text',
|
||||
'createtime_text'
|
||||
];
|
||||
|
||||
// 已读状态列表
|
||||
public static $isReadList = [
|
||||
0 => '未读',
|
||||
1 => '已读'
|
||||
];
|
||||
|
||||
/**
|
||||
* 获取已读状态文本
|
||||
*/
|
||||
public function getIsReadTextAttr($value, $data)
|
||||
{
|
||||
return isset(self::$isReadList[$data['is_read']]) ? self::$isReadList[$data['is_read']] : '';
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取创建时间文本
|
||||
*/
|
||||
public function getCreatetimeTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : (isset($data['createtime']) ? $data['createtime'] : '');
|
||||
return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* 关联会员
|
||||
*/
|
||||
public function member()
|
||||
{
|
||||
return $this->belongsTo('app\admin\model\wdsxh\member\Member', 'member_id', 'id', [], 'LEFT')->setEagerlyType(0);
|
||||
}
|
||||
|
||||
/**
|
||||
* 标记为已读
|
||||
*/
|
||||
public function markAsRead()
|
||||
{
|
||||
if ($this->is_read == 0) {
|
||||
$this->is_read = 1;
|
||||
$this->read_time = time();
|
||||
return $this->save();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取未读数量
|
||||
* @param int $member_id 会员ID
|
||||
* @return int
|
||||
*/
|
||||
public static function getUnreadCount($member_id)
|
||||
{
|
||||
return self::where('member_id', $member_id)
|
||||
->where('is_read', 0)
|
||||
->count();
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量标记为已读
|
||||
* @param array $ids 消息ID数组
|
||||
* @param int $member_id 会员ID
|
||||
* @return bool
|
||||
*/
|
||||
public static function markBatchAsRead($ids, $member_id)
|
||||
{
|
||||
return self::where('id', 'in', $ids)
|
||||
->where('member_id', $member_id)
|
||||
->update([
|
||||
'is_read' => 1,
|
||||
'read_time' => time()
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
<?php
|
||||
|
||||
namespace app\admin\model\wdsxh\message;
|
||||
|
||||
use think\Model;
|
||||
|
||||
|
||||
class MessageNotification extends Model
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// 表名
|
||||
protected $name = 'wdsxh_message_notification';
|
||||
|
||||
// 自动写入时间戳字段
|
||||
protected $autoWriteTimestamp = 'integer';
|
||||
|
||||
// 定义时间戳字段名
|
||||
protected $createTime = 'createtime';
|
||||
protected $updateTime = 'updatetime';
|
||||
protected $deleteTime = false;
|
||||
|
||||
// 追加属性
|
||||
protected $append = [
|
||||
'type_text'
|
||||
];
|
||||
|
||||
|
||||
|
||||
public function getTypeList()
|
||||
{
|
||||
return ['1' => __('Type 1'), '2' => __('Type 2'), '3' => __('Type 3')];
|
||||
}
|
||||
|
||||
|
||||
public function getTypeTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : (isset($data['type']) ? $data['type'] : '');
|
||||
$list = $this->getTypeList();
|
||||
return isset($list[$value]) ? $list[$value] : '';
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
|
||||
namespace app\admin\model\wdsxh\message;
|
||||
|
||||
use think\Model;
|
||||
|
||||
|
||||
class MessageNotificationMemberId extends Model
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// 表名
|
||||
protected $name = 'wdsxh_message_notification_member_id';
|
||||
|
||||
// 自动写入时间戳字段
|
||||
protected $autoWriteTimestamp = false;
|
||||
|
||||
// 定义时间戳字段名
|
||||
protected $createTime = false;
|
||||
protected $updateTime = false;
|
||||
protected $deleteTime = false;
|
||||
|
||||
// 追加属性
|
||||
protected $append = [
|
||||
'send_status'
|
||||
];
|
||||
|
||||
public function getSendStatusAttr($value, $data)
|
||||
{
|
||||
$memberNotificationObj = (new MemberNotification())
|
||||
->where('notification_id', $data['notification_id'])
|
||||
->where('member_id', $data['member_id'])
|
||||
->find();
|
||||
return $memberNotificationObj ? 1 : 2;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public function member()
|
||||
{
|
||||
return $this->belongsTo('app\admin\model\wdsxh\Member', 'member_id', 'id', [], 'LEFT')->setEagerlyType(0);
|
||||
}
|
||||
}
|
||||
40
application/admin/model/wdsxh/points/Express.php
Normal file
40
application/admin/model/wdsxh/points/Express.php
Normal file
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
namespace app\admin\model\wdsxh\points;
|
||||
|
||||
use think\Model;
|
||||
|
||||
|
||||
class Express extends Model
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// 表名
|
||||
protected $name = 'wdsxh_points_express';
|
||||
|
||||
// 自动写入时间戳字段
|
||||
protected $autoWriteTimestamp = 'integer';
|
||||
|
||||
// 定义时间戳字段名
|
||||
protected $createTime = 'createtime';
|
||||
protected $updateTime = 'updatetime';
|
||||
protected $deleteTime = false;
|
||||
|
||||
// 追加属性
|
||||
protected $append = [
|
||||
|
||||
];
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
57
application/admin/model/wdsxh/points/Goods.php
Normal file
57
application/admin/model/wdsxh/points/Goods.php
Normal file
@@ -0,0 +1,57 @@
|
||||
<?php
|
||||
|
||||
namespace app\admin\model\wdsxh\points;
|
||||
|
||||
use think\Model;
|
||||
use traits\model\SoftDelete;
|
||||
|
||||
class Goods extends Model
|
||||
{
|
||||
|
||||
use SoftDelete;
|
||||
|
||||
|
||||
|
||||
// 表名
|
||||
protected $name = 'wdsxh_points_goods';
|
||||
|
||||
// 自动写入时间戳字段
|
||||
protected $autoWriteTimestamp = 'integer';
|
||||
|
||||
// 定义时间戳字段名
|
||||
protected $createTime = 'createtime';
|
||||
protected $updateTime = 'updatetime';
|
||||
protected $deleteTime = 'deletetime';
|
||||
|
||||
// 追加属性
|
||||
protected $append = [
|
||||
'status_text'
|
||||
];
|
||||
|
||||
|
||||
protected static function init()
|
||||
{
|
||||
self::afterInsert(function ($row) {
|
||||
$pk = $row->getPk();
|
||||
$row->getQuery()->where($pk, $row[$pk])->update(['weigh' => $row[$pk]]);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
public function getStatusList()
|
||||
{
|
||||
return ['normal' => __('Status normal'), 'hidden' => __('Status hidden')];
|
||||
}
|
||||
|
||||
|
||||
public function getStatusTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : (isset($data['status']) ? $data['status'] : '');
|
||||
$list = $this->getStatusList();
|
||||
return isset($list[$value]) ? $list[$value] : '';
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
23
application/admin/model/wdsxh/points/Logistics.php
Normal file
23
application/admin/model/wdsxh/points/Logistics.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | 麦沃德科技赋能开发者,助力中小企业发展
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2017~2024 www.wdadmin.cn All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Wdadmin系统产品软件并不是自由软件,不加密,并不代表开源,未经许可不可自由转售和商用
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: MY WORLD Team <bd@maiwd.cn> www.wdadmin.cn
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\admin\model\wdsxh\points;
|
||||
|
||||
use think\Model;
|
||||
|
||||
class Logistics extends Model
|
||||
{
|
||||
// 表名
|
||||
protected $name = 'wdsxh_points_order_logistics';
|
||||
|
||||
protected $type = [
|
||||
'send_time' => 'timestamp:Y-m-d H:i:s',
|
||||
];
|
||||
}
|
||||
84
application/admin/model/wdsxh/points/Order.php
Normal file
84
application/admin/model/wdsxh/points/Order.php
Normal file
@@ -0,0 +1,84 @@
|
||||
<?php
|
||||
|
||||
namespace app\admin\model\wdsxh\points;
|
||||
|
||||
use think\Model;
|
||||
|
||||
|
||||
class Order extends Model
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// 表名
|
||||
protected $name = 'wdsxh_points_order';
|
||||
|
||||
// 自动写入时间戳字段
|
||||
protected $autoWriteTimestamp = 'integer';
|
||||
|
||||
// 定义时间戳字段名
|
||||
protected $createTime = 'createtime';
|
||||
protected $updateTime = false;
|
||||
protected $deleteTime = false;
|
||||
|
||||
// 追加属性
|
||||
protected $append = [
|
||||
'state_text',
|
||||
'complete_time_text',
|
||||
'redemption_time_text',
|
||||
'goods_info',
|
||||
];
|
||||
|
||||
|
||||
|
||||
public function getStateList()
|
||||
{
|
||||
return ['2' => __('State 2'), '3' => __('State 3'), '4' => __('State 4')];
|
||||
}
|
||||
|
||||
|
||||
public function getStateTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : (isset($data['state']) ? $data['state'] : '');
|
||||
$list = $this->getStateList();
|
||||
return isset($list[$value]) ? $list[$value] : '';
|
||||
}
|
||||
|
||||
|
||||
public function getCompleteTimeTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : (isset($data['complete_time']) ? $data['complete_time'] : '');
|
||||
return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
|
||||
}
|
||||
|
||||
|
||||
public function getRedemptionTimeTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : (isset($data['redemption_time']) ? $data['redemption_time'] : '');
|
||||
return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
|
||||
}
|
||||
|
||||
protected function setCompleteTimeAttr($value)
|
||||
{
|
||||
return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
|
||||
}
|
||||
|
||||
protected function setRedemptionTimeAttr($value)
|
||||
{
|
||||
return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
|
||||
}
|
||||
|
||||
public function getGoodsInfoAttr($value, $data)
|
||||
{
|
||||
$goods = (new Goods())
|
||||
->withTrashed()
|
||||
->where('id',$data['goods_id'])
|
||||
->field('name,image')
|
||||
->find();
|
||||
$goods->points = $data['points'];
|
||||
return $goods;
|
||||
}
|
||||
|
||||
}
|
||||
36
application/admin/model/wdsxh/points/PointsConfig.php
Normal file
36
application/admin/model/wdsxh/points/PointsConfig.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | 麦沃德科技赋能开发者,助力商协会发展
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2017~2024 www.wdsxh.cn All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | 沃德商协会系统并不是自由软件,不加密,并不代表开源,未经许可不可自由转售和商用
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: MY WORLD Team <bd@maiwd.cn> www.maiwd.cn
|
||||
// +----------------------------------------------------------------------
|
||||
/**
|
||||
* Class PointsConfig
|
||||
* Desc 积分配置Model
|
||||
* Create on 2025/11/14
|
||||
*/
|
||||
|
||||
namespace app\admin\model\wdsxh\points;
|
||||
|
||||
|
||||
use think\Model;
|
||||
|
||||
class PointsConfig extends Model
|
||||
{
|
||||
// 表名
|
||||
protected $name = 'wdsxh_points_config';
|
||||
|
||||
// 自动写入时间戳字段
|
||||
protected $autoWriteTimestamp = 'integer';
|
||||
|
||||
// 定义时间戳字段名
|
||||
protected $createTime = 'createtime';
|
||||
protected $updateTime = 'updatetime';
|
||||
|
||||
}
|
||||
|
||||
|
||||
40
application/admin/model/wdsxh/points/Ranking.php
Normal file
40
application/admin/model/wdsxh/points/Ranking.php
Normal file
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
namespace app\admin\model\wdsxh\points;
|
||||
|
||||
use think\Model;
|
||||
|
||||
|
||||
class Ranking extends Model
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// 表名
|
||||
protected $name = 'wdsxh_user_wechat_points_log';
|
||||
|
||||
// 自动写入时间戳字段
|
||||
protected $autoWriteTimestamp = 'integer';
|
||||
|
||||
// 定义时间戳字段名
|
||||
protected $createTime = 'createtime';
|
||||
protected $updateTime = false;
|
||||
protected $deleteTime = false;
|
||||
|
||||
// 追加属性
|
||||
protected $append = [
|
||||
|
||||
];
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
49
application/admin/model/wdsxh/points/UserWechatPointsLog.php
Normal file
49
application/admin/model/wdsxh/points/UserWechatPointsLog.php
Normal file
@@ -0,0 +1,49 @@
|
||||
<?php
|
||||
|
||||
namespace app\admin\model\wdsxh\points;
|
||||
|
||||
use think\Model;
|
||||
|
||||
|
||||
class UserWechatPointsLog extends Model
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// 表名
|
||||
protected $name = 'wdsxh_user_wechat_points_log';
|
||||
|
||||
// 自动写入时间戳字段
|
||||
protected $autoWriteTimestamp = 'integer';
|
||||
|
||||
// 定义时间戳字段名
|
||||
protected $createTime = 'createtime';
|
||||
protected $updateTime = false;
|
||||
protected $deleteTime = false;
|
||||
|
||||
// 追加属性
|
||||
protected $append = [
|
||||
'change_text'
|
||||
];
|
||||
|
||||
|
||||
|
||||
public function getChangeList()
|
||||
{
|
||||
return ['1' => __('Change 1'), '2' => __('Change 2')];
|
||||
}
|
||||
|
||||
|
||||
public function getChangeTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : (isset($data['change']) ? $data['change'] : '');
|
||||
$list = $this->getChangeList();
|
||||
return isset($list[$value]) ? $list[$value] : '';
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
59
application/admin/model/wdsxh/questionnaire/Category.php
Normal file
59
application/admin/model/wdsxh/questionnaire/Category.php
Normal file
@@ -0,0 +1,59 @@
|
||||
<?php
|
||||
|
||||
namespace app\admin\model\wdsxh\questionnaire;
|
||||
|
||||
use think\Model;
|
||||
|
||||
|
||||
class Category extends Model
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// 表名
|
||||
protected $name = 'wdsxh_questionnaire_category';
|
||||
|
||||
// 自动写入时间戳字段
|
||||
protected $autoWriteTimestamp = false;
|
||||
|
||||
// 定义时间戳字段名
|
||||
protected $createTime = false;
|
||||
protected $updateTime = false;
|
||||
protected $deleteTime = false;
|
||||
|
||||
// 追加属性
|
||||
protected $append = [
|
||||
'status_text'
|
||||
];
|
||||
|
||||
|
||||
protected static function init()
|
||||
{
|
||||
self::afterInsert(function ($row) {
|
||||
$pk = $row->getPk();
|
||||
$row->getQuery()->where($pk, $row[$pk])->update(['weigh' => $row[$pk]]);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
public function getStatusList()
|
||||
{
|
||||
return ['0' => __('Status 0'), '1' => __('Status 1')];
|
||||
}
|
||||
|
||||
|
||||
public function getStatusTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : (isset($data['status']) ? $data['status'] : '');
|
||||
$list = $this->getStatusList();
|
||||
return isset($list[$value]) ? $list[$value] : '';
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
123
application/admin/model/wdsxh/questionnaire/Questionnaire.php
Normal file
123
application/admin/model/wdsxh/questionnaire/Questionnaire.php
Normal file
@@ -0,0 +1,123 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | 麦沃德科技赋能开发者,助力商协会发展
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2017~2024 www.wdsxh.cn All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | 沃德商协会系统并不是自由软件,不加密,并不代表开源,未经许可不可自由转售和商用
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: MY WORLD Team <bd@maiwd.cn> www.maiwd.cn
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\admin\model\wdsxh\questionnaire;
|
||||
|
||||
use EasyWeChat\Factory;
|
||||
use think\Model;
|
||||
use traits\model\SoftDelete;
|
||||
|
||||
class Questionnaire extends Model
|
||||
{
|
||||
|
||||
use SoftDelete;
|
||||
|
||||
|
||||
|
||||
// 表名
|
||||
protected $name = 'wdsxh_questionnaire';
|
||||
|
||||
// 自动写入时间戳字段
|
||||
protected $autoWriteTimestamp = 'integer';
|
||||
|
||||
// 定义时间戳字段名
|
||||
protected $createTime = 'createtime';
|
||||
protected $updateTime = 'updatetime';
|
||||
protected $deleteTime = 'deletetime';
|
||||
|
||||
// 追加属性
|
||||
protected $append = [
|
||||
'end_time_text',
|
||||
'status_text',
|
||||
'applet_questionnaire_qrcode_path'
|
||||
];
|
||||
|
||||
|
||||
protected static function init()
|
||||
{
|
||||
self::afterInsert(function ($row) {
|
||||
$pk = $row->getPk();
|
||||
$row->getQuery()->where($pk, $row[$pk])->update(['weigh' => $row[$pk]]);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
public function getStatusList()
|
||||
{
|
||||
return ['normal' => __('Status normal'), 'hidden' => __('Status hidden')];
|
||||
}
|
||||
|
||||
|
||||
public function getEndTimeTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : (isset($data['end_time']) ? $data['end_time'] : '');
|
||||
return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
|
||||
}
|
||||
|
||||
|
||||
public function getStatusTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : (isset($data['status']) ? $data['status'] : '');
|
||||
$list = $this->getStatusList();
|
||||
return isset($list[$value]) ? $list[$value] : '';
|
||||
}
|
||||
|
||||
protected function setEndTimeAttr($value)
|
||||
{
|
||||
return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
|
||||
}
|
||||
|
||||
public function getAppletQuestionnaireQrcodePathAttr($value, $data)
|
||||
{
|
||||
$row = $data;
|
||||
$save_path = '/uploads/wdsxh/applet_questionnaire_qrcode/'.$row['id'].'/'.$row['createtime'].'.png';
|
||||
if (is_file(ROOT_PATH."public".$save_path)) {
|
||||
$value = $save_path;
|
||||
} else {
|
||||
$ids = $row['id'];
|
||||
$configObj = (new \app\admin\model\wdsxh\Config())->where('id',1)->find();
|
||||
if (!empty($configObj['applet_appid']) && !empty($configObj['applet_secret'])) {
|
||||
$path = 'pagesTools/questionnaire/details';
|
||||
$config = [
|
||||
'app_id' => $configObj['applet_appid'],
|
||||
'secret' => $configObj['applet_secret'],
|
||||
'response_type' => 'array',
|
||||
'log' => [
|
||||
'level' => 'debug',
|
||||
],
|
||||
];
|
||||
|
||||
$app = Factory::miniProgram($config);
|
||||
|
||||
$response = $app->app_code->getUnlimit($ids, [
|
||||
'page' => $path,
|
||||
'check_path' => false,
|
||||
]);
|
||||
|
||||
if ($response instanceof \EasyWeChat\Kernel\Http\StreamResponse) {
|
||||
$response->saveAs('uploads/wdsxh/applet_questionnaire_qrcode/'.$row['id'], $row['createtime'].'.png');
|
||||
$value = $save_path;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!empty($value)) {
|
||||
$value = request()->domain().$value;
|
||||
}
|
||||
return $value;
|
||||
}
|
||||
|
||||
public function getNonMemberAnswerSheetStatusList()
|
||||
{
|
||||
return ['1' => __('Non_member_answer_sheet_status 1'), '2' => __('Non_member_answer_sheet_status 2')];
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
49
application/admin/model/wdsxh/questionnaire/Render.php
Normal file
49
application/admin/model/wdsxh/questionnaire/Render.php
Normal file
@@ -0,0 +1,49 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | 麦沃德科技赋能开发者,助力商协会发展
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2017~2024 www.wdsxh.cn All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | 沃德商协会系统并不是自由软件,不加密,并不代表开源,未经许可不可自由转售和商用
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: MY WORLD Team <bd@maiwd.cn> www.maiwd.cn
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\admin\model\wdsxh\questionnaire;
|
||||
|
||||
use think\Model;
|
||||
|
||||
|
||||
class Render extends Model
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// 表名
|
||||
protected $name = 'wdsxh_questionnaire_render';
|
||||
|
||||
// 自动写入时间戳字段
|
||||
protected $autoWriteTimestamp = 'integer';
|
||||
|
||||
// 定义时间戳字段名
|
||||
protected $createTime = 'createtime';
|
||||
protected $updateTime = false;
|
||||
protected $deleteTime = false;
|
||||
|
||||
// 追加属性
|
||||
protected $append = [
|
||||
|
||||
];
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
108
application/admin/model/wdsxh/questionnaire/Topic.php
Normal file
108
application/admin/model/wdsxh/questionnaire/Topic.php
Normal file
@@ -0,0 +1,108 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | 麦沃德科技赋能开发者,助力商协会发展
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2017~2024 www.wdsxh.cn All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | 沃德商协会系统并不是自由软件,不加密,并不代表开源,未经许可不可自由转售和商用
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: MY WORLD Team <bd@maiwd.cn> www.maiwd.cn
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\admin\model\wdsxh\questionnaire;
|
||||
|
||||
use think\Model;
|
||||
use traits\model\SoftDelete;
|
||||
|
||||
class Topic extends Model
|
||||
{
|
||||
|
||||
use SoftDelete;
|
||||
|
||||
|
||||
|
||||
// 表名
|
||||
protected $name = 'wdsxh_questionnaire_topic';
|
||||
|
||||
// 自动写入时间戳字段
|
||||
protected $autoWriteTimestamp = 'integer';
|
||||
|
||||
// 定义时间戳字段名
|
||||
protected $createTime = 'createtime';
|
||||
protected $updateTime = 'updatetime';
|
||||
protected $deleteTime = 'deletetime';
|
||||
|
||||
// 追加属性
|
||||
protected $append = [
|
||||
'type_text',
|
||||
'is_explain_text',
|
||||
'must_text',
|
||||
'status_text'
|
||||
];
|
||||
|
||||
|
||||
protected static function init()
|
||||
{
|
||||
self::afterInsert(function ($row) {
|
||||
$pk = $row->getPk();
|
||||
$row->getQuery()->where($pk, $row[$pk])->update(['weigh' => $row[$pk]]);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
public function getTypeList()
|
||||
{
|
||||
return ['text' => __('Type text'), 'number' => __('Type number'), 'radio' => __('Type radio'), 'checkbox' => __('Type checkbox'), 'select' => __('Type select'),'datetime' => __('Type datetime'), 'textarea' => __('Type textarea'),'images' => __('Type images')];
|
||||
}
|
||||
|
||||
public function getIsExplainList()
|
||||
{
|
||||
return ['1' => __('Is_explain 1'), '2' => __('Is_explain 2')];
|
||||
}
|
||||
|
||||
public function getMustList()
|
||||
{
|
||||
return ['1' => __('Must 1'), '2' => __('Must 2')];
|
||||
}
|
||||
|
||||
public function getStatusList()
|
||||
{
|
||||
return ['normal' => __('Status normal'), 'hidden' => __('Status hidden')];
|
||||
}
|
||||
|
||||
|
||||
public function getTypeTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : (isset($data['type']) ? $data['type'] : '');
|
||||
$list = $this->getTypeList();
|
||||
return isset($list[$value]) ? $list[$value] : '';
|
||||
}
|
||||
|
||||
|
||||
public function getIsExplainTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : (isset($data['is_explain']) ? $data['is_explain'] : '');
|
||||
$list = $this->getIsExplainList();
|
||||
return isset($list[$value]) ? $list[$value] : '';
|
||||
}
|
||||
|
||||
|
||||
public function getMustTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : (isset($data['must']) ? $data['must'] : '');
|
||||
$list = $this->getMustList();
|
||||
return isset($list[$value]) ? $list[$value] : '';
|
||||
}
|
||||
|
||||
|
||||
public function getStatusTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : (isset($data['status']) ? $data['status'] : '');
|
||||
$list = $this->getStatusList();
|
||||
return isset($list[$value]) ? $list[$value] : '';
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
118
application/admin/model/wdsxh/user/User.php
Normal file
118
application/admin/model/wdsxh/user/User.php
Normal file
@@ -0,0 +1,118 @@
|
||||
<?php
|
||||
|
||||
namespace app\admin\model\wdsxh\user;
|
||||
|
||||
use app\common\model\MoneyLog;
|
||||
use app\common\model\ScoreLog;
|
||||
use think\Model;
|
||||
|
||||
class User extends Model
|
||||
{
|
||||
|
||||
// 表名
|
||||
protected $name = 'user';
|
||||
// 自动写入时间戳字段
|
||||
protected $autoWriteTimestamp = 'int';
|
||||
// 定义时间戳字段名
|
||||
protected $createTime = 'createtime';
|
||||
protected $updateTime = 'updatetime';
|
||||
// 追加属性
|
||||
protected $append = [
|
||||
'prevtime_text',
|
||||
'logintime_text',
|
||||
'jointime_text'
|
||||
];
|
||||
|
||||
public function getOriginData()
|
||||
{
|
||||
return $this->origin;
|
||||
}
|
||||
|
||||
protected static function init()
|
||||
{
|
||||
self::beforeUpdate(function ($row) {
|
||||
$changed = $row->getChangedData();
|
||||
//如果有修改密码
|
||||
if (isset($changed['password'])) {
|
||||
if ($changed['password']) {
|
||||
$salt = \fast\Random::alnum();
|
||||
$row->password = \app\common\library\Auth::instance()->getEncryptPassword($changed['password'], $salt);
|
||||
$row->salt = $salt;
|
||||
} else {
|
||||
unset($row->password);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
self::beforeUpdate(function ($row) {
|
||||
$changedata = $row->getChangedData();
|
||||
$origin = $row->getOriginData();
|
||||
if (isset($changedata['money']) && (function_exists('bccomp') ? bccomp($changedata['money'], $origin['money'], 2) !== 0 : (double)$changedata['money'] !== (double)$origin['money'])) {
|
||||
MoneyLog::create(['user_id' => $row['id'], 'money' => $changedata['money'] - $origin['money'], 'before' => $origin['money'], 'after' => $changedata['money'], 'memo' => '管理员变更金额']);
|
||||
}
|
||||
if (isset($changedata['score']) && (int)$changedata['score'] !== (int)$origin['score']) {
|
||||
ScoreLog::create(['user_id' => $row['id'], 'score' => $changedata['score'] - $origin['score'], 'before' => $origin['score'], 'after' => $changedata['score'], 'memo' => '管理员变更积分']);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public function getGenderList()
|
||||
{
|
||||
return ['1' => __('Male'), '0' => __('Female')];
|
||||
}
|
||||
|
||||
public function getStatusList()
|
||||
{
|
||||
return ['normal' => __('Normal'), 'hidden' => __('Hidden')];
|
||||
}
|
||||
|
||||
public function getChannelList()
|
||||
{
|
||||
return ['1' => __('微信小程序'), '2' => __('微信公众号')];
|
||||
}
|
||||
|
||||
public function getPrevtimeTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : ($data['prevtime'] ?? "");
|
||||
return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
|
||||
}
|
||||
|
||||
public function getLogintimeTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : ($data['logintime'] ?? "");
|
||||
return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
|
||||
}
|
||||
|
||||
public function getJointimeTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : ($data['jointime'] ?? "");
|
||||
return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
|
||||
}
|
||||
|
||||
protected function setPrevtimeAttr($value)
|
||||
{
|
||||
return $value && !is_numeric($value) ? strtotime($value) : $value;
|
||||
}
|
||||
|
||||
protected function setLogintimeAttr($value)
|
||||
{
|
||||
return $value && !is_numeric($value) ? strtotime($value) : $value;
|
||||
}
|
||||
|
||||
protected function setJointimeAttr($value)
|
||||
{
|
||||
return $value && !is_numeric($value) ? strtotime($value) : $value;
|
||||
}
|
||||
|
||||
protected function setBirthdayAttr($value)
|
||||
{
|
||||
return $value ? $value : null;
|
||||
}
|
||||
|
||||
public function group()
|
||||
{
|
||||
return $this->belongsTo('UserGroup', 'group_id', 'id', [], 'LEFT')->setEagerlyType(0);
|
||||
}
|
||||
|
||||
}
|
||||
20
application/admin/model/wdsxh/user/UserWechat.php
Normal file
20
application/admin/model/wdsxh/user/UserWechat.php
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | 麦沃德科技赋能开发者,助力商协会发展
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2017~2024 www.wdsxh.cn All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | 沃德商协会系统并不是自由软件,不加密,并不代表开源,未经许可不可自由转售和商用
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: MY WORLD Team <bd@maiwd.cn> www.maiwd.cn
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\admin\model\wdsxh\user;
|
||||
|
||||
use think\Model;
|
||||
|
||||
class UserWechat extends Model
|
||||
{
|
||||
// 表名
|
||||
protected $name = 'wdsxh_user_wechat';
|
||||
|
||||
}
|
||||
76
application/admin/model/wdsxh/user/Wechat.php
Normal file
76
application/admin/model/wdsxh/user/Wechat.php
Normal file
@@ -0,0 +1,76 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | 麦沃德科技赋能开发者,助力商协会发展
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2017~2024 www.wdsxh.cn All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | 沃德商协会系统并不是自由软件,不加密,并不代表开源,未经许可不可自由转售和商用
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: MY WORLD Team <bd@maiwd.cn> www.maiwd.cn
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\admin\model\wdsxh\user;
|
||||
|
||||
use think\Model;
|
||||
|
||||
|
||||
class Wechat extends Model
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// 表名
|
||||
protected $name = 'wdsxh_user_wechat';
|
||||
|
||||
// 自动写入时间戳字段
|
||||
protected $autoWriteTimestamp = false;
|
||||
|
||||
// 定义时间戳字段名
|
||||
protected $createTime = false;
|
||||
protected $updateTime = false;
|
||||
protected $deleteTime = false;
|
||||
|
||||
// 追加属性
|
||||
protected $append = [
|
||||
'set_admin_text',
|
||||
'channel_text'
|
||||
];
|
||||
|
||||
|
||||
|
||||
public function getSetAdminList()
|
||||
{
|
||||
return ['1' => __('Set_admin 1'), '2' => __('Set_admin 2')];
|
||||
}
|
||||
|
||||
public function getChannelList()
|
||||
{
|
||||
return ['1' => __('Channel 1'), '2' => __('Channel 2')];
|
||||
}
|
||||
|
||||
|
||||
public function getSetAdminTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : (isset($data['set_admin']) ? $data['set_admin'] : '');
|
||||
$list = $this->getSetAdminList();
|
||||
return isset($list[$value]) ? $list[$value] : '';
|
||||
}
|
||||
|
||||
|
||||
public function getChannelTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : (isset($data['channel']) ? $data['channel'] : '');
|
||||
$list = $this->getChannelList();
|
||||
return isset($list[$value]) ? $list[$value] : '';
|
||||
}
|
||||
|
||||
protected $type = [
|
||||
'createtime' => 'timestamp:Y-m-d',
|
||||
];
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user