chore(src): 所有代码上传

This commit is contained in:
2025-12-02 15:36:42 +08:00
parent ce8e59902c
commit eb79ad260c
669 changed files with 86838 additions and 87639 deletions

View File

@@ -5,6 +5,7 @@ namespace app;
use app\exception\ApiException;
use app\exception\BaseException;
use extend\exception\OrderException;
use extend\exception\StockException;
use think\db\exception\DataNotFoundException;
use think\db\exception\ModelNotFoundException;
use think\exception\Handle;
@@ -64,6 +65,14 @@ class ExceptionHandle extends Handle
'timestamp' => time()
];
return Response::create($data, 'json', 200);
} elseif ($e instanceof StockException) {
//针对api异常处理
$data = [
'code' => $e->getCode(),
'message' => $e->getMessage(),
'timestamp' => time()
];
return Response::create($data, 'json', 200);
} elseif (!env('app_debug') && ( $request->isPost() || $request->isAjax() ) && !( $e instanceof HttpResponseException )) {
$data = [
'code' => -1,

View File

@@ -102,6 +102,7 @@ class Request extends \think\Request
*/
public function module($module = '')
{
$module = str_replace('.html', '', $module);
if (!empty($module)) {
$GLOBALS[ "REQUEST_MODULE" ] = $module;
}

View File

@@ -1,343 +1,335 @@
<?php
/**
*/
namespace app\api\controller;
use app\exception\ApiException;
use app\model\shop\Shop;
use app\model\system\Api;
use Exception;
use think\facade\Cache;
use addon\store\model\Config as StoreConfig;
use app\model\store\Store;
use think\Response;
use app\tracking\VisitorTracker;
class BaseApi
{
public $lang;
public $params;
public $token;
protected $member_id = 0;
protected $site_id;
protected $uniacid;
protected $site_ids = [];
protected $app_module = 'shop';
public $app_type;
private $refresh_token;
/**
* 所选门店id
* @var
*/
protected $store_id = 0; // 门店id
/**
* 门店数据
* @var
*/
protected $store_data = [
'config' => [
'store_business' => 'shop'
]
];
public function __construct()
{
if ($_SERVER[ 'REQUEST_METHOD' ] == 'OPTIONS') {
exit;
}
//小程序获取获取参数
$this->uniacid = input('uniacid');
//快应用通过ua获取uniacid
if (strpos($_SERVER['HTTP_USER_AGENT'], 'uniacid') !== false) {
$ua = explode('=',$_SERVER['HTTP_USER_AGENT']);
$this->uniacid = intval($ua[1]);
}
$this->site_id = model('user')->getValue(['uniacid'=>$this->uniacid,'is_main'=>1],'site_id');
//获取对应站点下所有的商户
$sites = model('user')->getList(['uniacid'=>$this->uniacid]);
$this->site_ids = array_column($sites,'site_id');
// $this->site_id = input('site_id');//request()->siteid();
// $this->uniacid = model('site')->getValue(['site_id'=>$this->site_id],'uniacid');
$this->params = input();
$this->params[ 'site_id' ] = $this->site_id;
$shop_model = new Shop();
$shop_status = $shop_model->getShopStatus($this->site_id, 'shop');
//默认APP类型处理
if (!isset($this->params[ 'app_type' ])) $this->params[ 'app_type' ] = 'h5';
if ($this->params[ 'app_type' ] == 'pc') {
if (!$shop_status[ 'data' ][ 'value' ][ 'shop_pc_status' ]) throw new ApiException(-3, '网站已关闭!');
} else if ($this->params[ 'app_type' ] == 'weapp') {
if (!$shop_status[ 'data' ][ 'value' ][ 'shop_weapp_status' ]) throw new ApiException(-3, '网站已关闭!');
} else if ($this->params[ 'app_type' ] == 'h5' || $this->params[ 'app_type' ] == 'wechat') {
if (!$shop_status[ 'data' ][ 'value' ][ 'shop_h5_status' ]) throw new ApiException(-3, '网站已关闭!');
}
$this->store_id = $this->params[ 'store_id' ] ?? 0;
// ------------ 埋点:新增用户访问来源统计数据 ------------
$visitorTracker = new VisitorTracker();
$visitorTracker->shop_visit(['site_id' => $this->site_id,]);
if (!empty($this->params[ 'store_id' ])) {
$visitorTracker->store_visit(['site_id' => $this->site_id, 'store_id' => $this->store_id]);
}
// ------------------------------------------- ------------
}
/**
* 初始化门店数据
*/
protected function initStoreData()
{
$store_model = new Store();
$default_store = $store_model->getDefaultStore($this->site_id)[ 'data' ];
$this->store_data[ 'default_store' ] = $default_store ? $default_store[ 'store_id' ] : 0;
$this->store_id = $this->store_id ?: $this->store_data[ 'default_store' ];
if (addon_is_exit('store', $this->site_id)) {
$this->store_data[ 'config' ] = ( new StoreConfig() )->getStoreBusinessConfig($this->site_id)[ 'data' ][ 'value' ];
if ($this->store_id == $this->store_data[ 'default_store' ]) $this->store_data[ 'store_info' ] = $default_store;
else $this->store_data[ 'store_info' ] = $store_model->getStoreInfo([ [ 'site_id', '=', $this->site_id ], [ 'store_id', '=', $this->store_id ] ])[ 'data' ];
if (empty($this->store_data[ 'store_info' ]) || $this->store_data[ 'store_info' ][ 'status' ] == 0) {
throw new ApiException(-3, '门店已关闭!');
}
}
}
/**
* 检测token(使用私钥检测)
*/
protected function checkToken() : array
{
if (empty($this->params[ 'token' ])) return $this->error('', 'TOKEN_NOT_EXIST');
$key = 'site' . $this->site_id;
$api_model = new Api();
$api_config = $api_model->getApiConfig()[ 'data' ];
if ($api_config[ 'is_use' ] && isset($api_config[ 'value' ][ 'private_key' ]) && !empty($api_config[ 'value' ][ 'private_key' ])) {
$key = $api_config[ 'value' ][ 'private_key' ] . $key;
}
$decrypt = decrypt($this->params[ 'token' ], $key);
if (empty($decrypt)) return $this->error('', 'TOKEN_ERROR');
$data = json_decode($decrypt, true);
if (empty($data[ 'member_id' ])) return $this->error('', 'TOKEN_ERROR');
if ($data[ 'expire_time' ] < time()) {
if ($data[ 'expire_time' ] != 0) {
return $this->error('', 'TOKEN_EXPIRE');
}
} else if (( $data[ 'expire_time' ] - time() ) < 300 && !Cache::get('member_token' . $data[ 'member_id' ])) {
$this->refresh_token = $this->createToken($data[ 'member_id' ]);
Cache::set('member_token' . $data[ 'member_id' ], $this->refresh_token, 360);
}
$this->member_id = $data[ 'member_id' ];
return success(0, '', $data);
}
/**
* 创建token
* @param
* @return string
*/
protected function createToken($member_id)
{
$api_model = new Api();
$config_result = $api_model->getApiConfig();
$config = $config_result['data'];
# $expire_time 有效时间 0为永久 单位s
if ($config) {
$expire_time = round($config[ 'value' ][ 'long_time' ] * 3600);
} else {
$expire_time = 0;
}
$key = 'site' . $this->site_id;
$api_model = new Api();
$api_config = $api_model->getApiConfig()[ 'data' ];
if ($api_config[ 'is_use' ] && isset($api_config[ 'value' ][ 'private_key' ]) && !empty($api_config[ 'value' ][ 'private_key' ])) {
$key = $api_config[ 'value' ][ 'private_key' ] . $key;
}
$data = [
'member_id' => $member_id,
'create_time' => time(),
'expire_time' => empty($expire_time) ? 0 : time() + $expire_time
];
return encrypt(json_encode($data), $key);
}
/**
* 返回数据
* @param $data
* @return false|string
*/
public function response($data)
{
$data[ 'timestamp' ] = time();
if (!empty($this->refresh_token)) $data[ 'refreshtoken' ] = $this->refresh_token;
return Response::create($data, 'json', 200);
}
/**
* 操作成功返回值函数
* @param string $data
* @param string $code_var
* @return array
*/
public function success($data = '', $code_var = 'SUCCESS')
{
$lang_array = $this->getLang();
$code_array = $this->getCode();
$lang_var = $lang_array[$code_var] ?? $code_var;
$code_var = $code_array[$code_var] ?? $code_array['SUCCESS'];
return success($code_var, $lang_var, $data);
}
/**
* 操作失败返回值函数
* @param string $data
* @param string $code_var
* @return array
*/
public function error($data = '', $code_var = 'ERROR')
{
$lang_array = $this->getLang();
$code_array = $this->getCode();
$lang_var = $lang_array[$code_var] ?? $code_var;
$code_var = $code_array[$code_var] ?? $code_array['ERROR'];
return error($code_var, $lang_var, $data);
}
/**
* 获取语言包数组
* @return Ambigous <multitype:, unknown>
*/
private function getLang()
{
$default_lang = config('lang.default_lang');
$addon = request()->addon();
$addon = $addon ?? '';
$cache_common = Cache::get('lang_app/api/lang/' . $default_lang);
if (empty($cache_common)) {
$cache_common = include 'app/api/lang/' . $default_lang . '.php';
Cache::tag('lang')->set('lang_app/api/lang/' . $default_lang, $cache_common);
}
if (!empty($addon)) {
try {
$addon_cache_common = include 'addon/' . $addon . '/api/lang/' . $default_lang . '.php';
if (!empty($addon_cache_common)) {
$cache_common = array_merge($cache_common, $addon_cache_common);
Cache::tag('lang')->set('lang_app/api/lang/' . $addon . '_' . $default_lang, $addon_cache_common);
}
} catch ( Exception $e) {
}
}
return $cache_common;
}
/**
* 获取code编码
* @return Ambigous <multitype:, unknown>
*/
private function getCode()
{
$addon = request()->addon();
$addon = $addon ?? '';
$cache_common = Cache::get('lang_code_app/api/lang');
if (!empty($addon)) {
$addon_cache_common = Cache::get('lang_code_app/api/lang/' . $addon);
if (!empty($addon_cache_common)) {
$cache_common = array_merge($cache_common, $addon_cache_common);
}
}
if (empty($cache_common)) {
$cache_common = include 'app/api/lang/code.php';
Cache::tag('lang_code')->set('lang_code_app/api/lang', $cache_common);
if (!empty($addon)) {
try {
$addon_cache_common = include 'addon/' . $addon . '/api/lang/code.php';
if (!empty($addon_cache_common)) {
Cache::tag('lang_code')->set('lang_code_app/api/lang/' . $addon, $addon_cache_common);
$cache_common = array_merge($cache_common, $addon_cache_common);
}
} catch ( Exception $e) {
}
}
}
$lang_path = $this->lang ?? '';
if (!empty($lang_path)) {
$cache_path = Cache::get('lang_code_' . $lang_path);
if (empty($cache_path)) {
$cache_path = include $lang_path . '/code.php';
Cache::tag('lang')->set('lang_code_' . $lang_path, $cache_path);
}
$lang = array_merge($cache_common, $cache_path);
} else {
$lang = $cache_common;
}
return $lang;
}
/**
* @param array $data 验证数据
* @param 验证类 $validate
* @param 验证场景 $scene
*/
public function validate(array $data, $validate, $scene = '')
{
try {
$class = new $validate;
if (!empty($scene)) {
$res = $class->scene($scene)->check($data);
} else {
$res = $class->check($data);
}
if (!$res) {
return error(-1, $class->getError());
} else
return success(1);
} catch (ValidateException $e) {
return error(-1, $e->getError());
} catch ( Exception $e) {
return error(-1, $e->getMessage());
}
}
<?php
namespace app\api\controller;
use app\exception\ApiException;
use app\model\shop\Shop;
use app\model\system\Api;
use Exception;
use think\facade\Cache;
use addon\store\model\Config as StoreConfig;
use app\model\store\Store;
use think\Response;
use app\tracking\VisitorTracker;
class BaseApi
{
public $lang;
public $params;
public $token;
protected $member_id = 0;
protected $site_id;
protected $uniacid;
protected $site_ids = [];
protected $app_module = 'shop';
public $app_type;
private $refresh_token;
/**
* 所选门店id
* @var
*/
protected $store_id = 0; // 门店id
/**
* 门店数据
* @var
*/
protected $store_data = [
'config' => [
'store_business' => 'shop'
]
];
public function __construct()
{
if ($_SERVER[ 'REQUEST_METHOD' ] == 'OPTIONS') {
exit;
}
//小程序获取获取参数
$this->uniacid = input('uniacid');
//快应用通过ua获取uniacid
if (strpos($_SERVER['HTTP_USER_AGENT'], 'uniacid') !== false) {
$ua = explode('=',$_SERVER['HTTP_USER_AGENT']);
$this->uniacid = intval($ua[1]);
}
$this->site_id = model('user')->getValue(['uniacid'=>$this->uniacid,'is_main'=>1],'site_id');
//获取对应站点下所有的商户
$sites = model('user')->getList(['uniacid'=>$this->uniacid]);
$this->site_ids = array_column($sites,'site_id');
// $this->site_id = input('site_id');//request()->siteid();
// $this->uniacid = model('site')->getValue(['site_id'=>$this->site_id],'uniacid');
$this->params = input();
$this->params[ 'site_id' ] = $this->site_id;
$shop_model = new Shop();
$shop_status = $shop_model->getShopStatus($this->site_id, 'shop');
//默认APP类型处理
if (!isset($this->params[ 'app_type' ])) $this->params[ 'app_type' ] = 'h5';
if ($this->params[ 'app_type' ] == 'pc') {
if (!$shop_status[ 'data' ][ 'value' ][ 'shop_pc_status' ]) throw new ApiException(-3, '网站已关闭!');
} else if ($this->params[ 'app_type' ] == 'weapp') {
if (!$shop_status[ 'data' ][ 'value' ][ 'shop_weapp_status' ]) throw new ApiException(-3, '网站已关闭!');
} else if ($this->params[ 'app_type' ] == 'h5' || $this->params[ 'app_type' ] == 'wechat') {
if (!$shop_status[ 'data' ][ 'value' ][ 'shop_h5_status' ]) throw new ApiException(-3, '网站已关闭!');
}
$this->store_id = $this->params[ 'store_id' ] ?? 0;
// ------------ 埋点:新增用户访问来源统计数据 ------------
$visitorTracker = new VisitorTracker();
$visitorTracker->shop_visit(['site_id' => $this->site_id,]);
if (!empty($this->params[ 'store_id' ])) {
$visitorTracker->store_visit(['site_id' => $this->site_id, 'store_id' => $this->store_id]);
}
// ------------------------------------------- ------------
}
/**
* 初始化门店数据
*/
protected function initStoreData()
{
$store_model = new Store();
$default_store = $store_model->getDefaultStore($this->site_id)[ 'data' ];
$this->store_data[ 'default_store' ] = $default_store ? $default_store[ 'store_id' ] : 0;
$this->store_id = $this->store_id ?: $this->store_data[ 'default_store' ];
if (addon_is_exit('store', $this->site_id)) {
$this->store_data[ 'config' ] = ( new StoreConfig() )->getStoreBusinessConfig($this->site_id)[ 'data' ][ 'value' ];
if ($this->store_id == $this->store_data[ 'default_store' ]) $this->store_data[ 'store_info' ] = $default_store;
else $this->store_data[ 'store_info' ] = $store_model->getStoreInfo([ [ 'site_id', '=', $this->site_id ], [ 'store_id', '=', $this->store_id ] ])[ 'data' ];
if (empty($this->store_data[ 'store_info' ]) || $this->store_data[ 'store_info' ][ 'status' ] == 0) {
throw new ApiException(-3, '门店已关闭!');
}
}
}
/**
* 检测token(使用私钥检测)
*/
protected function checkToken() : array
{
if (empty($this->params[ 'token' ])) return $this->error('', 'TOKEN_NOT_EXIST');
$key = 'site' . $this->site_id;
$api_model = new Api();
$api_config = $api_model->getApiConfig()[ 'data' ];
if ($api_config[ 'is_use' ] && isset($api_config[ 'value' ][ 'private_key' ]) && !empty($api_config[ 'value' ][ 'private_key' ])) {
$key = $api_config[ 'value' ][ 'private_key' ] . $key;
}
$decrypt = decrypt($this->params[ 'token' ], $key);
if (empty($decrypt)) return $this->error('', 'TOKEN_ERROR');
$data = json_decode($decrypt, true);
if (empty($data[ 'member_id' ])) return $this->error('', 'TOKEN_ERROR');
if ($data[ 'expire_time' ] < time()) {
if ($data[ 'expire_time' ] != 0) {
return $this->error('', 'TOKEN_EXPIRE');
}
} else if (( $data[ 'expire_time' ] - time() ) < 300 && !Cache::get('member_token' . $data[ 'member_id' ])) {
$this->refresh_token = $this->createToken($data[ 'member_id' ]);
Cache::set('member_token' . $data[ 'member_id' ], $this->refresh_token, 360);
}
$this->member_id = $data[ 'member_id' ];
return success(0, '', $data);
}
/**
* 创建token
* @param
* @return string
*/
protected function createToken($member_id)
{
$api_model = new Api();
$config_result = $api_model->getApiConfig();
$config = $config_result['data'];
# $expire_time 有效时间 0为永久 单位s
if ($config) {
$expire_time = round($config[ 'value' ][ 'long_time' ] * 3600);
} else {
$expire_time = 0;
}
$key = 'site' . $this->site_id;
$api_model = new Api();
$api_config = $api_model->getApiConfig()[ 'data' ];
if ($api_config[ 'is_use' ] && isset($api_config[ 'value' ][ 'private_key' ]) && !empty($api_config[ 'value' ][ 'private_key' ])) {
$key = $api_config[ 'value' ][ 'private_key' ] . $key;
}
$data = [
'member_id' => $member_id,
'create_time' => time(),
'expire_time' => empty($expire_time) ? 0 : time() + $expire_time
];
return encrypt(json_encode($data), $key);
}
/**
* 返回数据
* @param $data
* @return false|string
*/
public function response($data)
{
$data[ 'timestamp' ] = time();
if (!empty($this->refresh_token)) $data[ 'refreshtoken' ] = $this->refresh_token;
return Response::create($data, 'json', 200);
}
/**
* 操作成功返回值函数
* @param string $data
* @param string $code_var
* @return array
*/
public function success($data = '', $code_var = 'SUCCESS')
{
$lang_array = $this->getLang();
$code_array = $this->getCode();
$lang_var = $lang_array[$code_var] ?? $code_var;
$code_var = $code_array[$code_var] ?? $code_array['SUCCESS'];
return success($code_var, $lang_var, $data);
}
/**
* 操作失败返回值函数
* @param string $data
* @param string $code_var
* @return array
*/
public function error($data = '', $code_var = 'ERROR')
{
$lang_array = $this->getLang();
$code_array = $this->getCode();
$lang_var = $lang_array[$code_var] ?? $code_var;
$code_var = $code_array[$code_var] ?? $code_array['ERROR'];
return error($code_var, $lang_var, $data);
}
/**
* 获取语言包数组
* @return Ambigous <multitype:, unknown>
*/
private function getLang()
{
$default_lang = config('lang.default_lang');
$addon = request()->addon();
$addon = $addon ?? '';
$cache_common = Cache::get('lang_app/api/lang/' . $default_lang);
if (empty($cache_common)) {
$cache_common = include 'app/api/lang/' . $default_lang . '.php';
Cache::tag('lang')->set('lang_app/api/lang/' . $default_lang, $cache_common);
}
if (!empty($addon)) {
try {
$addon_cache_common = include 'addon/' . $addon . '/api/lang/' . $default_lang . '.php';
if (!empty($addon_cache_common)) {
$cache_common = array_merge($cache_common, $addon_cache_common);
Cache::tag('lang')->set('lang_app/api/lang/' . $addon . '_' . $default_lang, $addon_cache_common);
}
} catch ( Exception $e) {
}
}
return $cache_common;
}
/**
* 获取code编码
* @return Ambigous <multitype:, unknown>
*/
private function getCode()
{
$addon = request()->addon();
$addon = $addon ?? '';
$cache_common = Cache::get('lang_code_app/api/lang');
if (!empty($addon)) {
$addon_cache_common = Cache::get('lang_code_app/api/lang/' . $addon);
if (!empty($addon_cache_common)) {
$cache_common = array_merge($cache_common, $addon_cache_common);
}
}
if (empty($cache_common)) {
$cache_common = include 'app/api/lang/code.php';
Cache::tag('lang_code')->set('lang_code_app/api/lang', $cache_common);
if (!empty($addon)) {
try {
$addon_cache_common = include 'addon/' . $addon . '/api/lang/code.php';
if (!empty($addon_cache_common)) {
Cache::tag('lang_code')->set('lang_code_app/api/lang/' . $addon, $addon_cache_common);
$cache_common = array_merge($cache_common, $addon_cache_common);
}
} catch ( Exception $e) {
}
}
}
$lang_path = $this->lang ?? '';
if (!empty($lang_path)) {
$cache_path = Cache::get('lang_code_' . $lang_path);
if (empty($cache_path)) {
$cache_path = include $lang_path . '/code.php';
Cache::tag('lang')->set('lang_code_' . $lang_path, $cache_path);
}
$lang = array_merge($cache_common, $cache_path);
} else {
$lang = $cache_common;
}
return $lang;
}
/**
* @param array $data 验证数据
* @param 验证类 $validate
* @param 验证场景 $scene
*/
public function validate(array $data, $validate, $scene = '')
{
try {
$class = new $validate;
if (!empty($scene)) {
$res = $class->scene($scene)->check($data);
} else {
$res = $class->check($data);
}
if (!$res) {
return error(-1, $class->getError());
} else
return success(1);
} catch (ValidateException $e) {
return error(-1, $e->getError());
} catch ( Exception $e) {
return error(-1, $e->getMessage());
}
}
}

View File

@@ -1,147 +1,139 @@
<?php
/**
*/
namespace app\api\controller;
use app\model\member\Withdraw as WithdrawModel;
use app\model\member\Member as MemberModel;
/**
* 会员提现
*/
class Memberwithdraw extends BaseApi
{
/**
* 会员提现信息
*/
public function info()
{
$token = $this->checkToken();
if ($token[ 'code' ] < 0) return $this->response($token);
$member_model = new MemberModel();
$member_info_result = $member_model->getMemberInfo([ [ 'member_id', '=', $token[ 'data' ][ 'member_id' ] ] ], 'site_id,balance_money,balance_withdraw_apply,balance_withdraw');
$config_model = new WithdrawModel();
$config_result = $config_model->getConfig($member_info_result[ 'data' ][ 'site_id' ], 'shop');
$config = $config_result['data'][ 'value' ];
$config[ 'is_use' ] = $config_result['data'][ 'is_use' ];
$data = [
'member_info' => $member_info_result['data'],
'config' => $config
];
return $this->response($this->success($data));
}
/**
* 会员提现配置
*/
public function config()
{
$config_model = new WithdrawModel();
$config_result = $config_model->getConfig($this->site_id, 'shop');
return $this->response($config_result);
}
/**
* 获取转账方式
* @return false|string
*/
public function transferType()
{
$token = $this->checkToken();
if ($token[ 'code' ] < 0) return $this->response($token);
$member_model = new MemberModel();
$member_info = $member_model->getMemberInfo([ [ 'member_id', '=', $token[ 'data' ][ 'member_id' ] ] ], 'site_id,wx_openid,weapp_openid');
$withdraw_model = new WithdrawModel();
$transfer_type_list = $withdraw_model->getTransferType($member_info[ 'data' ][ 'site_id' ]);
if (empty($member_info[ 'data' ][ 'wx_openid' ]) && empty($member_info[ 'data' ][ 'weapp_openid' ])) {
unset($transfer_type_list[ 'wechatpay' ]);
}
return $this->response($this->success($transfer_type_list));
}
/**
* 申请提现
* @return false|string
*/
public function apply()
{
$token = $this->checkToken();
if ($token[ 'code' ] < 0) return $this->response($token);
$apply_money = $this->params['apply_money'] ?? 0;
$transfer_type = $this->params['transfer_type'] ?? '';//提现方式
$realname = $this->params['realname'] ?? '';//真实姓名
$bank_name = $this->params['bank_name'] ?? '';//银行名称
$account_number = $this->params['account_number'] ?? '';//账号名称
$mobile = $this->params['mobile'] ?? '';//手机号
$app_type = $this->params[ 'app_type' ];
$member_model = new MemberModel();
$member_info = $member_model->getMemberInfo([ [ 'member_id', '=', $token[ 'data' ][ 'member_id' ] ] ], 'site_id');
$withdraw_model = new WithdrawModel();
$data = [
'member_id' => $token[ 'data' ][ 'member_id' ],
'transfer_type' => $transfer_type,
'realname' => $realname,
'bank_name' => $bank_name,
'account_number' => $account_number,
'apply_money' => $apply_money,
'mobile' => $mobile,
'app_type' => $app_type
];
$result = $withdraw_model->apply($data, $member_info[ 'data' ][ 'site_id' ], 'shop');
return $this->response($result);
}
/**
* 提现详情
* @return false|string
*/
public function detail()
{
$token = $this->checkToken();
if ($token[ 'code' ] < 0) return $this->response($token);
$id = $this->params['id'] ?? 0;
if (empty($id)) {
return $this->response($this->error('', 'REQUEST_ID'));
}
$condition = [
['member_id', '=', $token[ 'data' ][ 'member_id' ] ],
['id', '=', $id ]
];
$withdraw_model = new WithdrawModel();
$info = $withdraw_model->getMemberWithdrawDetail($condition);
return $this->response($info);
}
/**
* 提现记录
* @return false|string
*/
public function page()
{
$token = $this->checkToken();
if ($token[ 'code' ] < 0) return $this->response($token);
$page = $this->params['page'] ?? 1;
$page_size = $this->params['page_size'] ?? PAGE_LIST_ROWS;
$condition = [
['member_id', '=', $token[ 'data' ][ 'member_id' ] ]
];
$withdraw_model = new WithdrawModel();
$list = $withdraw_model->getMemberWithdrawPageList($condition, $page, $page_size, 'apply_time desc', 'id,withdraw_no,apply_money,apply_time,status,status_name,transfer_type_name');
return $this->response($list);
}
<?php
namespace app\api\controller;
use app\model\member\Withdraw as WithdrawModel;
use app\model\member\Member as MemberModel;
/**
* 会员提现
*/
class Memberwithdraw extends BaseApi
{
/**
* 会员提现信息
*/
public function info()
{
$token = $this->checkToken();
if ($token[ 'code' ] < 0) return $this->response($token);
$member_model = new MemberModel();
$member_info_result = $member_model->getMemberInfo([ [ 'member_id', '=', $token[ 'data' ][ 'member_id' ] ] ], 'site_id,balance_money,balance_withdraw_apply,balance_withdraw');
$config_model = new WithdrawModel();
$config_result = $config_model->getConfig($member_info_result[ 'data' ][ 'site_id' ], 'shop');
$config = $config_result['data'][ 'value' ];
$config[ 'is_use' ] = $config_result['data'][ 'is_use' ];
$data = [
'member_info' => $member_info_result['data'],
'config' => $config
];
return $this->response($this->success($data));
}
/**
* 会员提现配置
*/
public function config()
{
$config_model = new WithdrawModel();
$config_result = $config_model->getConfig($this->site_id, 'shop');
return $this->response($config_result);
}
/**
* 获取转账方式
* @return false|string
*/
public function transferType()
{
$token = $this->checkToken();
if ($token[ 'code' ] < 0) return $this->response($token);
$member_model = new MemberModel();
$member_info = $member_model->getMemberInfo([ [ 'member_id', '=', $token[ 'data' ][ 'member_id' ] ] ], 'site_id,wx_openid,weapp_openid');
$withdraw_model = new WithdrawModel();
$transfer_type_list = $withdraw_model->getTransferType($member_info[ 'data' ][ 'site_id' ]);
if (empty($member_info[ 'data' ][ 'wx_openid' ]) && empty($member_info[ 'data' ][ 'weapp_openid' ])) {
unset($transfer_type_list[ 'wechatpay' ]);
}
return $this->response($this->success($transfer_type_list));
}
/**
* 申请提现
* @return false|string
*/
public function apply()
{
$token = $this->checkToken();
if ($token[ 'code' ] < 0) return $this->response($token);
$apply_money = $this->params['apply_money'] ?? 0;
$transfer_type = $this->params['transfer_type'] ?? '';//提现方式
$realname = $this->params['realname'] ?? '';//真实姓名
$bank_name = $this->params['bank_name'] ?? '';//银行名称
$account_number = $this->params['account_number'] ?? '';//账号名称
$mobile = $this->params['mobile'] ?? '';//手机号
$app_type = $this->params[ 'app_type' ];
$member_model = new MemberModel();
$member_info = $member_model->getMemberInfo([ [ 'member_id', '=', $token[ 'data' ][ 'member_id' ] ] ], 'site_id');
$withdraw_model = new WithdrawModel();
$data = [
'member_id' => $token[ 'data' ][ 'member_id' ],
'transfer_type' => $transfer_type,
'realname' => $realname,
'bank_name' => $bank_name,
'account_number' => $account_number,
'apply_money' => $apply_money,
'mobile' => $mobile,
'app_type' => $app_type
];
$result = $withdraw_model->apply($data, $member_info[ 'data' ][ 'site_id' ], 'shop');
return $this->response($result);
}
/**
* 提现详情
* @return false|string
*/
public function detail()
{
$token = $this->checkToken();
if ($token[ 'code' ] < 0) return $this->response($token);
$id = $this->params['id'] ?? 0;
if (empty($id)) {
return $this->response($this->error('', 'REQUEST_ID'));
}
$condition = [
['member_id', '=', $token[ 'data' ][ 'member_id' ] ],
['id', '=', $id ]
];
$withdraw_model = new WithdrawModel();
$info = $withdraw_model->getMemberWithdrawDetail($condition);
return $this->response($info);
}
/**
* 提现记录
* @return false|string
*/
public function page()
{
$token = $this->checkToken();
if ($token[ 'code' ] < 0) return $this->response($token);
$page = $this->params['page'] ?? 1;
$page_size = $this->params['page_size'] ?? PAGE_LIST_ROWS;
$condition = [
['member_id', '=', $token[ 'data' ][ 'member_id' ] ]
];
$withdraw_model = new WithdrawModel();
$list = $withdraw_model->getMemberWithdrawPageList($condition, $page, $page_size, 'apply_time desc', 'id,withdraw_no,apply_money,apply_time,status,status_name,transfer_type_name');
return $this->response($list);
}
}

View File

@@ -1,69 +1,61 @@
<?php
/**
*/
namespace app\api\controller;
use app\model\web\Notice as NoticeModel;
/**
* Class Notice
* @package app\api\controller
*/
class Notice extends BaseApi
{
/**
* 基础信息
*/
public function info()
{
$id = $this->params['id'] ?? 0;
if (empty($id)) {
return $this->response($this->error('', 'REQUEST_ID'));
}
$notice = new NoticeModel();
$info = $notice->getNoticeInfo([ [ 'id', '=', $id ], [ 'site_id', '=', $this->site_id ] ]);
return $this->response($info);
}
public function lists()
{
$id_arr = $this->params['id_arr'] ?? '';//id数组
$notice = new NoticeModel();
$condition = [
[ 'receiving_type', 'like', '%mobile%' ],
[ 'site_id', '=', $this->site_id ],
[ 'id', 'in', $id_arr ]
];
$list = $notice->getNoticeList($condition);
return $this->response($list);
}
public function page()
{
$page = $this->params['page'] ?? 1;
$page_size = $this->params['page_size'] ?? PAGE_LIST_ROWS;
$id_arr = $this->params['id_arr'] ?? '';//id数组
$notice = new NoticeModel();
$order = 'is_top desc,sort asc,create_time desc';
$condition = [
[ 'receiving_type', 'like', '%mobile%' ],
[ 'site_id', '=', $this->site_id ]
];
if (!empty($id_arr)) {
$condition[] = [ 'id', 'in', $id_arr ];
}
$list = $notice->getNoticePageList($condition, $page, $page_size, $order);
return $this->response($list);
}
<?php
namespace app\api\controller;
use app\model\web\Notice as NoticeModel;
/**
* Class Notice
* @package app\api\controller
*/
class Notice extends BaseApi
{
/**
* 基础信息
*/
public function info()
{
$id = $this->params['id'] ?? 0;
if (empty($id)) {
return $this->response($this->error('', 'REQUEST_ID'));
}
$notice = new NoticeModel();
$info = $notice->getNoticeInfo([ [ 'id', '=', $id ], [ 'site_id', '=', $this->site_id ] ]);
return $this->response($info);
}
public function lists()
{
$id_arr = $this->params['id_arr'] ?? '';//id数组
$notice = new NoticeModel();
$condition = [
[ 'receiving_type', 'like', '%mobile%' ],
[ 'site_id', '=', $this->site_id ],
[ 'id', 'in', $id_arr ]
];
$list = $notice->getNoticeList($condition);
return $this->response($list);
}
public function page()
{
$page = $this->params['page'] ?? 1;
$page_size = $this->params['page_size'] ?? PAGE_LIST_ROWS;
$id_arr = $this->params['id_arr'] ?? '';//id数组
$notice = new NoticeModel();
$order = 'is_top desc,sort asc,create_time desc';
$condition = [
[ 'receiving_type', 'like', '%mobile%' ],
[ 'site_id', '=', $this->site_id ]
];
if (!empty($id_arr)) {
$condition[] = [ 'id', 'in', $id_arr ];
}
$list = $notice->getNoticePageList($condition, $page, $page_size, $order);
return $this->response($list);
}
}

View File

@@ -33,7 +33,7 @@ Vue.component("article-sources", {
},
created: function () {
this.$parent.data.ignore = [];//加载忽略内容 -- 其他设置中的属性设置
this.$parent.data.ignoreLoad = true; // 等待忽略数组赋值后加载
this.$parent.data.ignoreLoad = true; // 等待忽略数组赋值后加载
if(Object.keys(this.$parent.data.previewList).length == 0) {
for (var i = 1; i < 3; i++) {

View File

@@ -1,52 +1,79 @@
<?php
/**
*/
namespace app\dict\goods;
/**
* 商品公共属性
*/
class GoodsDict
{
const real = 1;
const virtual = 2;
const virtualcard = 3;
const service = 4;
const card = 5;
const weigh = 6;
/**
* 商品类型
* @param $type
* @return string|string[]
*/
public static function getType($type = ''){
$list = [
self::real => '实物商品',
self::virtual => '虚拟商品',
self::virtualcard => '电子卡密',
self::service => '服务项目',
self::card => '卡项套餐',
self::weigh => '称重商品',
];
//todo 插件商品类型应该用钩子获取
$temp_list = array_filter(event('GetGoodsClass'));
if(!empty($temp_list)){
foreach($temp_list as $v){
$list = array_merge($list, $v);
}
}
if($type) return $list[$type] ?? '';
return $list;
}
}
<?php
namespace app\dict\goods;
/**
* 商品公共属性
*/
class GoodsDict
{
const real = 1;
const virtual = 2;
const virtualcard = 3;
const service = 4;
const card = 5;
const weigh = 6;
/**
* 商品类型
* @param $type
* @return string|string[]
*/
public static function getType($type = ''){
$list = [
self::real => '实物商品',
self::virtual => '虚拟商品',
self::virtualcard => '电子卡密',
self::service => '服务项目',
self::card => '卡项套餐',
self::weigh => '称重商品',
];
//todo 插件商品类型应该用钩子获取
$temp_list = array_filter(event('GetGoodsClass'));
if(!empty($temp_list)){
foreach($temp_list as $v){
$list = array_merge($list, $v);
}
}
if($type) return $list[$type] ?? '';
return $list;
}
const virtual_auto_deliver = 'auto_deliver';
const virtual_artificial_deliver = 'artificial_deliver';
const virtual_verify = 'verify';
/**
* 获取虚拟商品发货方式
* @param $type
* @return void
*/
public static function getVirtualDeliverType($type = ''){
$list = [
self::virtual_auto_deliver => '自动发货',
self::virtual_artificial_deliver => '手动发货',
self::virtual_verify => '到店核销',
];
//todo 插件商品类型应该用钩子获取
if($type) return $list[$type] ?? '';
return $list;
}
const service_permanent = 0;
const service_day = 1;
const service_day_expire = 2;
public static function getVerifyValidityType($type = ''){
$list = [
self::service_permanent => '永久',
self::service_day => '指定几日内有效',
self::service_day_expire => '指定日期过期',
];
//todo 插件商品类型应该用钩子获取
if($type) return $list[$type] ?? '';
return $list;
}
}

View File

@@ -1,41 +1,32 @@
<?php
/**
*/
namespace app\dict\member_account;
/**
* 账户公共属性
*/
class AccountDict
{
const balance = 'balance';
const balance_money = 'balance_money';
const point = 'point';
const growth = 'growth';
/**
* 账户类型
* @param $type
* @return string|string[]
*/
public static function getType($type = ''){
$list = array(
self::balance => '储值余额',
self::balance_money => '现金余额',
self::point => '积分',
self::growth => '成长值'
);
if(!$type) return $list[$type] ?? '';
return $list;
}
}
<?php
namespace app\dict\member_account;
/**
* 账户公共属性
*/
class AccountDict
{
const balance = 'balance';
const balance_money = 'balance_money';
const point = 'point';
const growth = 'growth';
/**
* 账户类型
* @param $type
* @return string|string[]
*/
public static function getType($type = ''){
$list = array(
self::balance => '储值余额',
self::balance_money => '现金余额',
self::point => '积分',
self::growth => '成长值'
);
if(!$type) return $list[$type] ?? '';
return $list;
}
}

View File

@@ -1,85 +1,76 @@
<?php
/**
*/
namespace app\dict\order;
/**
* 订单公共属性
*/
class OrderDict
{
//普通订单
const express = 1;
const store = 2;
const local = 3;
const virtual = 4;
const cashier = 5;
/**
* 订单类型
* @param $type
* @return string|string[]
*/
public static function getType($type = ''){
$list = [
self::express => '物流订单',
self::store => '自提订单',
self::local => '外卖订单',
self::virtual => '虚拟订单',
self::cashier => '收银订单',
];
$temp_list = array_filter(event('GetOrderType'));
if(!empty($temp_list)){
foreach($temp_list as $k => $v){
$list = array_merge($list, $v);
}
}
if($type) return $list[$type] ?? '';
return $list;
}
const scene_online = 'online';
const scene_cashier = 'cashier';
/**
* 订单创建场景
* @param $type
* @return string|string[]
*/
public static function getOrderScene($type = ''){
$list = [
self::scene_online => '线上订单',
self::scene_cashier => '自收银台订单',
];
if($type) return $list[$type] ?? '';
return $list;
}
const evaluate_wait = 0;
const evaluated = 1;
const evaluate_again = 2;
/**
* 订单评价状态
* @param $status
* @return string|string[]
*/
public static function getEvaluateStatus($status = ''){
$list = [
self::evaluate_wait => '待评价',
self::evaluated => '已评价',
self::evaluate_again => '已追评',
];
if($status !== '') return $list[$status] ?? '';
return $list;
}
}
<?php
namespace app\dict\order;
/**
* 订单公共属性
*/
class OrderDict
{
//普通订单
const express = 1;
const store = 2;
const local = 3;
const virtual = 4;
const cashier = 5;
/**
* 订单类型
* @param $type
* @return string|string[]
*/
public static function getType($type = ''){
$list = [
self::express => '物流订单',
self::store => '自提订单',
self::local => '外卖订单',
self::virtual => '虚拟订单',
self::cashier => '收银订单',
];
$temp_list = array_filter(event('GetOrderType'));
if(!empty($temp_list)){
foreach($temp_list as $k => $v){
$list = array_merge($list, $v);
}
}
if($type) return $list[$type] ?? '';
return $list;
}
const scene_online = 'online';
const scene_cashier = 'cashier';
/**
* 订单创建场景
* @param $type
* @return string|string[]
*/
public static function getOrderScene($type = ''){
$list = [
self::scene_online => '线上订单',
self::scene_cashier => '自收银台订单',
];
if($type) return $list[$type] ?? '';
return $list;
}
const evaluate_wait = 0;
const evaluated = 1;
const evaluate_again = 2;
/**
* 订单评价状态
* @param $status
* @return string|string[]
*/
public static function getEvaluateStatus($status = ''){
$list = [
self::evaluate_wait => '待评价',
self::evaluated => '已评价',
self::evaluate_again => '已追评',
];
if($status !== '') return $list[$status] ?? '';
return $list;
}
}

View File

@@ -1,43 +1,34 @@
<?php
/**
*/
namespace app\dict\order;
use app\dict\pay\PayDict;
/**
* 订单项公共属性
*/
class OrderGoodsDict
{
const wait_delivery = 0;//待发货
const delivery = 1;//已发货
const delivery_finish = 2;
/**
* 作用于订单项上的配送状态
* @param $status
* @return string|string[]
*/
public static function getDeliveryStatus($status = ''){
$list = array(
self::wait_delivery => '待发货',
self::delivery => '已发货',
self::delivery_finish => '已收货'
);
if($status !== '') return $list[$status] ?? '';
return $list;
}
}
<?php
namespace app\dict\order;
use app\dict\pay\PayDict;
/**
* 订单项公共属性
*/
class OrderGoodsDict
{
const wait_delivery = 0;//待发货
const delivery = 1;//已发货
const delivery_finish = 2;
/**
* 作用于订单项上的配送状态
* @param $status
* @return string|string[]
*/
public static function getDeliveryStatus($status = ''){
$list = array(
self::wait_delivery => '待发货',
self::delivery => '已发货',
self::delivery_finish => '已收货'
);
if($status !== '') return $list[$status] ?? '';
return $list;
}
}

View File

@@ -1,42 +1,35 @@
<?php
/**
*/
namespace app\dict\order;
use app\dict\pay\PayDict;
/**
* 订单支付公共属性
*/
class OrderPayDict
{
const online_pay = 'ONLINE_PAY';
const balance = 'BALANCE';
const offline_pay = 'OFFLINE_PAY';
const point = 'POINT';
/**
* 订单支付方式
* @param $type
* @return string|string[]
*/
public static function getType($type = ''){
$list = array(
self::online_pay => '在线支付',
self::balance => '余额支付',
self::offline_pay => '线下支付',
self::point => '积分兑换',
);
$list = array_merge($list, PayDict::getType());
if($type) return $list[$type] ?? '';
return $list;
}
}
<?php
namespace app\dict\order;
use app\dict\pay\PayDict;
/**
* 订单支付公共属性
*/
class OrderPayDict
{
const online_pay = 'ONLINE_PAY';
const balance = 'BALANCE';
const offline_pay = 'OFFLINE_PAY';
const offline_pay2 = 'offlinepay';
const point = 'POINT';
/**
* 订单支付方式
* @param $type
* @return string|string[]
*/
public static function getType($type = ''){
$list = array(
self::online_pay => '在线支付',
self::balance => '余额支付',
self::offline_pay => '线下支付',
self::offline_pay2 => '线下支付',
self::point => '积分兑换',
);
$list = array_merge($list, PayDict::getType());
if($type) return $list[$type] ?? '';
return $list;
}
}

View File

@@ -1,277 +1,284 @@
<?php
/**
*/
namespace app\dict\order_refund;
/**
* 订单公共属性
*/
class OrderRefundDict
{
/********************************************************************************* 订单退款状态 *****************************************************/
//未申请退款
const REFUND_NOT_APPLY = 0;
//已申请退款
const REFUND_APPLY = 1;
// 已确认
const REFUND_CONFIRM = 2;
//已完成
const REFUND_COMPLETE = 3;
//等待买家发货
const REFUND_WAIT_DELIVERY = 4;
//等待卖家收货
const REFUND_WAIT_TAKEDELIVERY = 5;
//卖家确认收货
const REFUND_TAKEDELIVERY = 6;
// 卖家拒绝退款
const REFUND_DIEAGREE = -1;
// 卖家关闭退款
const REFUND_CLOSE = -2;
//退款方式
const ONLY_REFUNDS = 1;//仅退款
const A_REFUND_RETURN = 2;//退款退货
const SHOP_ACTIVE_REFUND = 3;//店铺主动退款
/******************** 退款模式 ****************/
const refund = 1;
const after_sales = 2;
/**
* 退款类型
* @return void
*/
public static function getRefundMode($type = ''){
$list = [
self::refund => '退款',
self::after_sales => '售后',
];
if($type) return $list[$type] ?? '';
return $list;
}
/**
* 维权状态以及操作
* @param $status
* @return string|string[]
*/
public static function getStatus($status = 'all'){
$list = [
self::REFUND_NOT_APPLY => [
'status' => self::REFUND_NOT_APPLY,
'name' => '',
'action' => [
],
'member_action' => [
[
'event' => 'orderRefundApply',
'title' => '申请维权',
'color' => ''
],
]
],
self::REFUND_APPLY => [
'status' => self::REFUND_APPLY,
'name' => '申请维权',
'action' => [
[
'event' => 'orderRefundAgree',
'title' => '同意',
'color' => ''
],
[
'event' => 'orderRefundRefuse',
'title' => '拒绝',
'color' => ''
],
[
'event' => 'orderRefundClose',
'title' => '关闭维权',
'color' => ''
]
],
'member_action' => [
[
'event' => 'orderRefundCancel',
'title' => '撤销维权',
'color' => ''
],
]
],
self::REFUND_CONFIRM => [
'status' => self::REFUND_CONFIRM,
'name' => '待转账',
'action' => [
[
'event' => 'orderRefundTransfer',
'title' => '转账',
'color' => ''
],
[
'event' => 'orderRefundClose',
'title' => '关闭维权',
'color' => ''
]
],
'member_action' => [
]
],
self::REFUND_COMPLETE => [
'status' => self::REFUND_COMPLETE,
'name' => '维权结束',
'action' => [
],
'member_action' => [
]
],
self::REFUND_WAIT_DELIVERY => [
'status' => self::REFUND_WAIT_DELIVERY,
'name' => '买家待退货',
'action' => [
[
'event' => 'orderRefundClose',
'title' => '关闭维权',
'color' => ''
]
],
'member_action' => [
[
'event' => 'orderRefundDelivery',
'title' => '填写发货物流',
'color' => ''
],
]
],
self::REFUND_WAIT_TAKEDELIVERY => [
'status' => self::REFUND_WAIT_TAKEDELIVERY,
'name' => '卖家待收货',
'action' => [
[
'event' => 'orderRefundTakeDelivery',
'title' => '收货',
'color' => ''
],
[
'event' => 'orderRefundRefuse',
'title' => '拒绝',
'color' => ''
],
[
'event' => 'orderRefundClose',
'title' => '关闭维权',
'color' => ''
]
],
'member_action' => [
]
],
self::REFUND_TAKEDELIVERY => [
'status' => self::REFUND_TAKEDELIVERY,
'name' => '卖家已收货',
'action' => [
[
'event' => 'orderRefundTransfer',
'title' => '转账',
'color' => ''
],
[
'event' => 'orderRefundClose',
'title' => '关闭维权',
'color' => ''
]
],
'member_action' => [
]
],
self::REFUND_DIEAGREE => [
'status' => self::REFUND_DIEAGREE,
'name' => '卖家拒绝',
'action' => [
[
'event' => 'orderRefundClose',
'title' => '关闭维权',
'color' => ''
]
],
'member_action' => [
[
'event' => 'orderRefundCancel',
'title' => '撤销维权',
'color' => ''
],
[
'event' => 'orderRefundAsk',
'title' => '修改申请',
'color' => ''
],
]
]
];
if((string)$status != 'all') {
return $list[$status] ?? [];
}
return $list;
}
/**
* 获取维权方式
* @return string[]
*/
public static function getRefundType(){
$list = [
self::ONLY_REFUNDS => '仅退款',
self::A_REFUND_RETURN => '退货退款',
];
return $list;
}
/**
* 维权原因
* @return string[]
*/
public static function getRefundReasonType(){
$list = [
'未按约定时间发货',
'拍错/多拍/不喜欢',
'协商一致退款',
'其他',
];
return $list;
}
const back = 1;
const offline = 2;
const balance = 3;
public static function getRefundMoneyType($type = ''){
$list = [
self::back => '原路退款',
self::offline => '线下',
self::balance => '余额',
];
if($type) return $list[$type] ?? '';
return $list;
}
}
<?php
namespace app\dict\order_refund;
/**
* 订单公共属性
*/
class OrderRefundDict
{
/********************************************************************************* 订单退款状态 *****************************************************/
//未申请退款
const REFUND_NOT_APPLY = 0;
//已申请退款
const REFUND_APPLY = 1;
// 已确认
const REFUND_CONFIRM = 2;
//已完成
const REFUND_COMPLETE = 3;
//等待买家发货
const REFUND_WAIT_DELIVERY = 4;
//等待卖家收货
const REFUND_WAIT_TAKEDELIVERY = 5;
//卖家确认收货
const REFUND_TAKEDELIVERY = 6;
// 卖家拒绝退款
const REFUND_DIEAGREE = -1;
// 卖家关闭退款
const REFUND_CLOSE = -2;
//部分退款
const PARTIAL_REFUND = -3;
//退款方式
const ONLY_REFUNDS = 1;//仅退款
const A_REFUND_RETURN = 2;//退款退货
const SHOP_ACTIVE_REFUND = 3;//店铺主动退款
public static function getRefundType($type = ''){
$list = [
self::ONLY_REFUNDS => '仅退款',
self::A_REFUND_RETURN => '退款退货',
];
if($type !== '') return $list[$type] ?? '';
return $list;
}
/******************** 退款模式 ****************/
const refund = 1;
const after_sales = 2;
/**
* 退款类型
* @return void
*/
public static function getRefundMode($type = ''){
$list = [
self::refund => '退款',
self::after_sales => '售后',
];
if($type !== '') return $list[$type] ?? '';
return $list;
}
/**
* 维权状态以及操作
* @param $status
* @return string|string[]
*/
public static function getStatus($status = 'all'){
$list = [
self::REFUND_NOT_APPLY => [
'status' => self::REFUND_NOT_APPLY,
'name' => '',
'action' => [
],
'member_action' => [
[
'event' => 'orderRefundApply',
'title' => '申请售后',
'color' => ''
],
]
],
self::REFUND_APPLY => [
'status' => self::REFUND_APPLY,
'name' => '申请售后',
'action' => [
[
'event' => 'orderRefundAgree',
'title' => '同意',
'color' => ''
],
[
'event' => 'orderRefundRefuse',
'title' => '拒绝',
'color' => ''
],
[
'event' => 'orderRefundClose',
'title' => '关闭维权',
'color' => ''
]
],
'member_action' => [
[
'event' => 'orderRefundCancel',
'title' => '撤销售后',
'color' => ''
],
]
],
self::REFUND_CONFIRM => [
'status' => self::REFUND_CONFIRM,
'name' => '待转账',
'action' => [
[
'event' => 'orderRefundTransfer',
'title' => '转账',
'color' => ''
],
[
'event' => 'orderRefundClose',
'title' => '关闭售后',
'color' => ''
]
],
'member_action' => [
]
],
self::REFUND_COMPLETE => [
'status' => self::REFUND_COMPLETE,
'name' => '售后结束',
'action' => [
],
'member_action' => [
]
],
self::REFUND_WAIT_DELIVERY => [
'status' => self::REFUND_WAIT_DELIVERY,
'name' => '买家待退货',
'action' => [
[
'event' => 'orderRefundClose',
'title' => '关闭售后',
'color' => ''
]
],
'member_action' => [
[
'event' => 'orderRefundDelivery',
'title' => '填写发货物流',
'color' => ''
],
]
],
self::REFUND_WAIT_TAKEDELIVERY => [
'status' => self::REFUND_WAIT_TAKEDELIVERY,
'name' => '卖家待收货',
'action' => [
[
'event' => 'orderRefundTakeDelivery',
'title' => '收货',
'color' => ''
],
[
'event' => 'orderRefundRefuse',
'title' => '拒绝',
'color' => ''
],
[
'event' => 'orderRefundClose',
'title' => '关闭售后',
'color' => ''
]
],
'member_action' => [
]
],
self::REFUND_TAKEDELIVERY => [
'status' => self::REFUND_TAKEDELIVERY,
'name' => '卖家已收货',
'action' => [
[
'event' => 'orderRefundTransfer',
'title' => '转账',
'color' => ''
],
[
'event' => 'orderRefundClose',
'title' => '关闭售后',
'color' => ''
]
],
'member_action' => [
]
],
self::REFUND_DIEAGREE => [
'status' => self::REFUND_DIEAGREE,
'name' => '卖家拒绝',
'action' => [
[
'event' => 'orderRefundClose',
'title' => '关闭售后',
'color' => ''
]
],
'member_action' => [
[
'event' => 'orderRefundCancel',
'title' => '撤销售后',
'color' => ''
],
[
'event' => 'orderRefundAsk',
'title' => '修改申请',
'color' => ''
],
]
],
self::PARTIAL_REFUND => [
'status' => self::PARTIAL_REFUND,
'name' => '部分退款',
'action' => [
],
'member_action' => [
[
'event' => 'orderRefundApply',
'title' => '申请售后',
'color' => ''
],
]
],
];
if((string)$status != 'all') {
return $list[$status] ?? [];
}
return $list;
}
/**
* 售后原因
* @return string[]
*/
public static function getRefundReasonType($site_id = 1){
/*$list = [
'未按约定时间发货',
'拍错/多拍/不喜欢',
'协商一致退款',
'其他',
];*/
$config_model = new \app\model\order\Config();
$config_info = $config_model->getOrderRefundConfig($site_id)['data']['value'];
$reason_type = explode("\n", $config_info['reason_type']);
return $reason_type;
}
const back = 1;
const offline = 2;
const balance = 3;
public static function getRefundMoneyType($type = ''){
$list = [
self::back => '原路退款',
self::offline => '线下退款',
self::balance => '退款到余额',
];
if($type !== '') return $list[$type] ?? '';
return $list;
}
}

View File

@@ -1,36 +1,29 @@
<?php
/**
*/
namespace app\dict\pay;
/**
* 支付公共属性
*/
class PayDict
{
//普通订单
const wechatpay = 'wechatpay';
const alipay = 'alipay';
/**
* 支付方式
* @param $type
* @return string|string[]
*/
public static function getType($type = ''){
$list = array(
self::wechatpay => '微信支付',
self::alipay => '支付宝支付',
);
if($type) return $list[$type] ?? '';
return $list;
}
}
<?php
namespace app\dict\pay;
/**
* 支付公共属性
*/
class PayDict
{
//普通订单
const wechatpay = 'wechatpay';
const alipay = 'alipay';
const huaweipay = 'huaweipay';
/**
* 支付方式
* @param $type
* @return string|string[]
*/
public static function getType($type = ''){
$list = array(
self::wechatpay => '微信支付',
self::alipay => '支付宝支付',
self::huaweipay => '华为支付',
);
if($type) return $list[$type] ?? '';
return $list;
}
}

View File

@@ -1,72 +1,63 @@
<?php
/**
*/
namespace app\dict\system;
/**
* 计划任务属性
*/
class ScheduleDict
{
const default = 'default';
const url = 'url';
const cli = 'cli';
/**
* 计划任务类型
* @param $type
* @return string|string[]
*/
public static function getType($type = ''){
$list = [
self::default => '系统任务',
self::url => '接口启动',
self::cli => '命令启动',
];
if($type) return $list[$type] ?? '';
return $list;
}
/**
* 获取错误列表
* @param $code
* @return void
*/
public static function getError($code = ''){
$list = array(
self::default => [
'curl_ssl_error' => '',
],
self::url => [
],
self::cli => [
],
);
if($code) return $list[$code] ?? '';
return $list;
}
public static function getSuggestion(string $type) {
switch($type) {
case self::default:
return '请检查系统计划任务配置,确保 cron 进程正常运行,并检查网络连接和 SSL 证书设置。';
case self::url:
return '请检查网络连接、目标 URL 可访问性、HTTP 状态码和接口认证配置。可以使用 curl 命令手动测试接口。';
case self::cli:
return '请检查 cron 服务状态、命令执行权限、脚本路径和 PHP CLI 环境。建议使用 crontab -l 查看当前任务配置。';
default:
return '请检查计划任务配置文件和相关权限设置,确保所有依赖服务正常运行。';
}
}
}
<?php
namespace app\dict\system;
/**
* 计划任务属性
*/
class ScheduleDict
{
const default = 'default';
const url = 'url';
const cli = 'cli';
/**
* 计划任务类型
* @param $type
* @return string|string[]
*/
public static function getType($type = ''){
$list = [
self::default => '系统任务',
self::url => '接口启动',
self::cli => '命令启动',
];
if($type) return $list[$type] ?? '';
return $list;
}
/**
* 获取错误列表
* @param $code
* @return void
*/
public static function getError($code = ''){
$list = array(
self::default => [
'curl_ssl_error' => '',
],
self::url => [
],
self::cli => [
],
);
if($code) return $list[$code] ?? '';
return $list;
}
public static function getSuggestion(string $type) {
switch($type) {
case self::default:
return '请检查系统计划任务配置,确保 cron 进程正常运行,并检查网络连接和 SSL 证书设置。';
case self::url:
return '请检查网络连接、目标 URL 可访问性、HTTP 状态码和接口认证配置。可以使用 curl 命令手动测试接口。';
case self::cli:
return '请检查 cron 服务状态、命令执行权限、脚本路径和 PHP CLI 环境。建议使用 crontab -l 查看当前任务配置。';
default:
return '请检查计划任务配置文件和相关权限设置,确保所有依赖服务正常运行。';
}
}
}

View File

@@ -1,361 +1,385 @@
<?php
/**
*/
return [
'bind' => [
],
'listen' => [
// 测试计划任务
'Syntest' => [
'app\event\Syntest'
],
'MerchRrderSettlement' => [
'app\event\merch\Merchsettlement'
],
//-----------
/**
* 系统基础事件
* 完成系统基础化操作执行
*/
//应用初始化事件
'AppInit' => [
'app\event\init\InitConfig',
'app\event\init\InitRoute',
'app\event\init\InitAddon',
'app\event\init\InitCron',
],
'HttpRun' => [],
'HttpEnd' => [],
'LogLevel' => [],
'LogWrite' => [],
/**
* 支付功能事件
* 对应支付相关功能调用
*/
//支付异步回调(支付插件完成,作用判定支付成功,返回对应支付编号)
'PayNotify' => [
],
'Qrcode' => [
'app\event\Qrcode'
],
//添加门店事件
'AddStore' => [
],
/******************************************************************营销活动相关事件********************************/
//关闭游戏
'CloseGame' => [
'app\event\promotion\CloseGame'
],
//开启游戏
'OpenGame' => [
'app\event\promotion\OpenGame'
],
//营销活动
'ShowPromotion' => [
'app\event\promotion\ShowPromotion'
],
/**
* 营销活动二维码
*/
'PromotionQrcode' => [
'app\event\promotion\PromotionQrcode'
],
/******************************************************************自定义装修事件*********************************/
// 自定义组件
'DiyViewUtils' => [
'app\event\diy\DiyViewUtils',
],
// 自定义页面编辑
'DiyViewEdit' => [
'app\event\diy\DiyViewEdit',
],
/*******************************************************************会员相关事件**********************************/
//添加会员账户数据
'AddMemberAccount' => [
'app\event\member\AddMemberAccount',//会员账户变化检测会员等级
],
//会员行为事件
'MemberAction' => [],
//会员营销活动标志
'MemberPromotion' => [],
//会员注册后执行事件
'MemberRegister' => [
],
'MemberDetail' => [
'app\event\member\MemberDetail'
],
'MemberLogin' => [
'app\event\member\MemberLogin'
],
//会员群体定时刷新
'CronMemberClusterRefresh' => [
'app\event\member\CronMemberClusterRefresh'
],
/*******************************************************************微信相关事件**********************************/
//微信分享数据
'WchatShareData' => [
'app\event\wechat\WchatShareData',
],
//微信分享配置
'WchatShareConfig' => [
'app\event\wechat\WchatShareConfig',
],
//小程序分享数据
'WeappShareData' => [
'app\event\wechat\WeappShareData',
],
//小程序分享配置
'WeappShareConfig' => [
'app\event\wechat\WeappShareConfig',
],
/********************************************************************商品相关事件*********************************/
//商品自动上架
'CronGoodsTimerOn' => [
'app\event\goods\CronGoodsTimerOn'
],
//商品自动下架
'CronGoodsTimerOff' => [
'app\event\goods\CronGoodsTimerOff'
],
//商品类型,用于商品添加,编辑,搜索
'GoodsClass' => [
'app\event\goods\GoodsClass',
'app\event\goods\VirtualGoodsClass'
],
/*******************************************************************订单核销相关功能事件(单独处理)*******************/
//核销类型
'VerifyType' => [
],
//核销
'Verify' => [
'app\event\verify\PickupOrderVerify',//自提订单核销
'app\event\verify\VirtualGoodsVerify',//虚拟商品核销
],
// 核销商品临期提醒
'VerifyOrderOutTime' => [
'app\event\verify\VerifyOrderOutTime'
],
// 核销码过期提醒
'CronVerifyCodeExpire' => [
'app\event\verify\CronVerifyCodeExpire'
],
/*****************************************************************订单相关事件***********************************/
//订单创建后执行事件
'OrderCreate' => [
'app\event\order\OrderCreate',
],
'OrderCreateAfter' => [
'app\event\order\OrderCreateAfter',
],
// 订单催付通知(计划任务,针对临近期限)
'CronOrderUrgePayment' => [
'app\event\order\CronOrderUrgePayment'
],
//订单支付同步事件
'OrderPay' => [
'app\event\order\OrderPay',
],
//订单支付成功异步事件
'OrderPayAfter' => [
'app\event\order\OrderPayAfter',
],
//订单支付异步执行
'OrderPayNotify' => [
'app\event\order\OrderPayNotify',//商城订单支付异步回调
],
//订单发货事件
'OrderDelivery' => [],
//订单发货后自动收货时间
'CronOrderTakeDelivery' => [
'app\event\order\CronOrderTakeDelivery'
],
//订单收货事件(后期执行)
'orderTakeDeliveryAfter' => [], //订单收货
'OrderComplete' => [
//订单完成后执行 后续事件
'app\event\order\OrderComplete',
], //订单完成后执行事件
//自动执行订单自动完成
'CronOrderComplete' => [
'app\event\order\CronOrderComplete'
],
// 自动关闭订单售后
'CronOrderAfterSaleClose' => [
'app\event\order\CronOrderAfterSaleClose'
],
'OrderClose' => [], //订单关闭后执行事件
//订单未支付自动关闭
'CronOrderClose' => [
'app\event\order\CronOrderClose'
],
'OrderRefundFinish' => [
'app\event\order\OrderRefundFinish'
],//订单项完成退款操作之后
/**************************************************************************************************************/
/*****************************************************************统计相关事件***********************************/
//店铺统计更新(按日)
'CronStatShop' => [
'app\event\stat\CronStatShop'
],
//店铺统计更新(按时)
'CronStatShopHour' => [
'app\event\stat\CronStatShopHour'
],
//门店统计更新(按日)
'CronStatStore' => [
'app\event\stat\CronStatStore'
],
//门店统计更新(按时)
'CronStatStoreHour' => [
'app\event\stat\CronStatStoreHour'
],
/**************************************************************************************************************/
/******************************************************消息发送相关事件****************************************/
/**
* 消息发送
*/
//消息模板
'SendMessageTemplate' => [
// 订单核销通知
'app\event\message\MessageShopVerified',
// 核销商品临期提醒
'app\event\message\MessageVerifyOrderOutTime',
// 订单催付通知
'app\event\message\MessageOrderUrgePayment',
// 订单关闭
'app\event\message\MessageOrderClose',
// 订单完成
'app\event\message\MessageOrderComplete',
// 订单支付
'app\event\message\MessageOrderPaySuccess',
// 订单发货
'app\event\message\MessageOrderDelivery',
// 商家同意退款
'app\event\message\MessageShopRefundAgree',
// 商家拒绝退款
'app\event\message\MessageShopRefundRefuse',
// 核销通知
'app\event\message\MessageShopVerified',
// 核销码过期提醒
'app\event\message\MessageVerifyCodeExpire',
// 注册验证
'app\event\message\MessageRegisterCode',
// 找回密码
'app\event\message\MessageFindCode',
// 会员登陆成功
'app\event\message\MessageLogin',
// 帐户绑定验证码
'app\event\message\MessageBindCode',
// 动态码登陆验证码
'app\event\message\MessageLoginCode',
// 支付密码修改通知
'app\event\message\MessageMemberPayPassword',
// 设置密码
'app\event\message\MessageSetPassWord',
// 买家发起退款提醒
'app\event\message\MessageOrderRefundApply',
// 买家已退货提醒
'app\event\message\MessageOrderRefundDelivery',
// 买家支付通知商家
'app\event\message\MessageBuyerPaySuccess',
// 买家订单完成通知
'app\event\message\MessageBuyerOrderComplete',
// 会员申请提现通知
'app\event\message\MessageUserWithdrawalApply',
// 会员提现成功通知
'app\event\message\MessageUserWithdrawalSuccess',
// 会员提现失败通知
'app\event\message\MessageUserWithdrawalError',
// 分销申请提现通知
'app\event\message\MessageFenxiaoWithdrawalApply',
// 分销提现成功通知
'app\event\message\MessageFenxiaoWithdrawalSuccess',
// 分销提现失败通知
'app\event\message\MessageFenxiaoWithdrawalError',
// 分销佣金发放通知
'app\event\message\MessageOrderCommissionGrant',
// 会员注销成功通知
'app\event\message\MessageCancelSuccess',
// 会员注销失败通知
'app\event\message\MessageCancelFail',
// 会员注销申请通知
'app\event\message\MessageCancelApply',
// 会员账户变动通知通知
'app\event\message\MessageAccountChangeNotice',
// 收银台会员验证验证码
'app\event\message\MessageCashierMemberVerifyCode',
],
//发送短信
'sendSms' => [
],
/**********************************************************************网站进行初始化*********************************/
/**
* 店铺相关事件
* 完成店铺相关功能操作
*/
'AddSite' => [
'app\event\addsite\AddSiteDiyView',//增加默认自定义数据:主页主页、商品分类、底部导航
'app\event\addsite\AddMemberLevel',//增加默认会员等级
'app\event\addsite\AddRegisterAgreement',//增加默认会员注册协议
'app\event\addsite\AddSiteConfig',//增加默认配置项
'app\event\addsite\AddSiteDelivery',//增加默认配送管理数据
'app\event\addsite\AddSiteExpressCompany',//增加默认物流公司数据
'app\event\addsite\AddMemberClusterCronRefresh',//增加会员群体定时刷新任务
'app\event\addsite\AddSiteAdv', // 增加默认广告
'app\event\addsite\AddStoreDiyView', //增加门店主页装修
],
// 添加店铺演示数据
'AddYanshiData' => [
'app\event\addsite\AddYanshiData',//增加默认商品相关数据商品1~3个、商品分类、商品服务
],
],
'subscribe' => [
],
];
<?php
return [
'bind' => [
],
'listen' => [
'MerchRrderSettlement' => [
'app\event\merch\Merchsettlement'
],
//-----------
/**
* 系统基础事件
* 完成系统基础化操作执行
*/
//应用初始化事件
'AppInit' => [
'app\event\init\InitConfig',
'app\event\init\InitRoute',
'app\event\init\InitAddon',
'app\event\init\InitCron',
],
'HttpRun' => [],
'HttpEnd' => [],
'LogLevel' => [],
'LogWrite' => [],
/**
* 支付功能事件
* 对应支付相关功能调用
*/
//支付异步回调(支付插件完成,作用判定支付成功,返回对应支付编号)
'PayNotify' => [
],
'Qrcode' => [
'app\event\Qrcode'
],
//添加门店事件
'AddStore' => [
],
/******************************************************************营销活动相关事件********************************/
//关闭游戏
'CloseGame' => [
'app\event\promotion\CloseGame'
],
//开启游戏
'OpenGame' => [
'app\event\promotion\OpenGame'
],
//营销活动
'ShowPromotion' => [
'app\event\promotion\ShowPromotion'
],
/**
* 营销活动二维码
*/
'PromotionQrcode' => [
'app\event\promotion\PromotionQrcode'
],
'PromotionPage' => [
'app\event\promotion\PromotionPage'
],
/******************************************************************自定义装修事件*********************************/
// 自定义组件
'DiyViewUtils' => [
'app\event\diy\DiyViewUtils',
],
// 自定义页面编辑
'DiyViewEdit' => [
'app\event\diy\DiyViewEdit',
],
/*******************************************************************会员相关事件**********************************/
//添加会员账户数据
'AddMemberAccount' => [
'app\event\member\AddMemberAccount',//会员账户变化检测会员等级
],
//会员行为事件
'MemberAction' => [],
//会员营销活动标志
'MemberPromotion' => [],
//会员注册后执行事件
'MemberRegister' => [
],
'MemberDetail' => [
'app\event\member\MemberDetail'
],
'MemberLogin' => [
'app\event\member\MemberLogin'
],
//会员群体定时刷新
'CronMemberClusterRefresh' => [
'app\event\member\CronMemberClusterRefresh'
],
/*******************************************************************微信相关事件**********************************/
//微信分享数据
'WchatShareData' => [
'app\event\wechat\WchatShareData',
],
//微信分享配置
'WchatShareConfig' => [
'app\event\wechat\WchatShareConfig',
],
//小程序分享数据
'WeappShareData' => [
'app\event\wechat\WeappShareData',
],
//小程序分享配置
'WeappShareConfig' => [
'app\event\wechat\WeappShareConfig',
],
/********************************************************************商品相关事件*********************************/
//商品自动上架
'CronGoodsTimerOn' => [
'app\event\goods\CronGoodsTimerOn'
],
//商品自动下架
'CronGoodsTimerOff' => [
'app\event\goods\CronGoodsTimerOff'
],
//商品类型,用于商品添加,编辑,搜索
'GoodsClass' => [
'app\event\goods\GoodsClass',
'app\event\goods\VirtualGoodsClass'
],
// 商品删除检测
'DeleteGoodsCheck' => [
'app\event\goods\DeleteGoodsCheck',
],
/*******************************************************************订单核销相关功能事件(单独处理)*******************/
//核销类型
'VerifyType' => [
],
//核销
'Verify' => [
'app\event\verify\PickupOrderVerify',//自提订单核销
'app\event\verify\VirtualGoodsVerify',//虚拟商品核销
],
// 核销商品临期提醒
'VerifyOrderOutTime' => [
'app\event\verify\VerifyOrderOutTime'
],
// 核销码过期
'CronVerifyCodeExpire' => [
'app\event\verify\CronVerifyCodeExpire',
],
//核销商品到期自动下架
'CronVirtualGoodsVerifyOff' =>[
'app\event\goods\CronVirtualGoodsVerifyOff',
],
/*****************************************************************订单相关事件***********************************/
//订单创建后执行事件
'OrderCreate' => [
'app\event\order\OrderCreate',
],
'OrderCreateAfter' => [
'app\event\order\OrderCreateAfter',
],
// 订单催付通知(计划任务,针对临近期限)
'CronOrderUrgePayment' => [
'app\event\order\CronOrderUrgePayment'
],
//订单支付同步事件
'OrderPay' => [
'app\event\order\OrderPay',
],
//订单支付成功异步事件
'OrderPayAfter' => [
'app\event\order\OrderPayAfter',
],
//订单支付异步执行
'OrderPayNotify' => [
'app\event\order\OrderPayNotify',//商城订单支付异步回调
],
//订单发货事件
'OrderDelivery' => [],
//订单发货后自动收货时间
'CronOrderTakeDelivery' => [
'app\event\order\CronOrderTakeDelivery'
],
//订单收货事件(后期执行)
'orderTakeDeliveryAfter' => [], //订单收货
'OrderComplete' => [
//订单完成后执行 后续事件
'app\event\order\OrderComplete',
], //订单完成后执行事件
//自动执行订单自动完成
'CronOrderComplete' => [
'app\event\order\CronOrderComplete'
],
// 自动关闭订单售后
'CronOrderAfterSaleClose' => [
'app\event\order\CronOrderAfterSaleClose'
],
'OrderClose' => [], //订单关闭后执行事件
//订单未支付自动关闭
'CronOrderClose' => [
'app\event\order\CronOrderClose'
],
//订单项完成退款操作之后
'OrderRefundFinish' => [
'app\event\order\OrderRefundFinish'
],
//通过支付信息获取手机端订单详情路径
'WapOrderDetailPathByPayInfo' => [
'app\event\order\WapOrderDetailPathByPayInfo',
],
'OfflinePay' => [
'app\event\order\OfflinePay',
],
/**************************************************************************************************************/
// 支付转账结果查询
'CronPayTransferResult' => [
'app\event\pay\CronPayTransferResult'
],
/*****************************************************************统计相关事件***********************************/
//店铺统计更新(按日)
'CronStatShop' => [
'app\event\stat\CronStatShop'
],
//店铺统计更新(按时)
'CronStatShopHour' => [
'app\event\stat\CronStatShopHour'
],
//门店统计更新(按日)
'CronStatStore' => [
'app\event\stat\CronStatStore'
],
//门店统计更新(按时)
'CronStatStoreHour' => [
'app\event\stat\CronStatStoreHour'
],
/**************************************************************************************************************/
/******************************************************消息发送相关事件****************************************/
/**
* 消息发送
*/
//消息模板
'SendMessageTemplate' => [
// 订单核销通知
'app\event\message\MessageShopVerified',
// 核销商品临期提醒
'app\event\message\MessageVerifyOrderOutTime',
// 订单催付通知
'app\event\message\MessageOrderUrgePayment',
// 订单关闭
'app\event\message\MessageOrderClose',
// 订单完成
'app\event\message\MessageOrderComplete',
// 订单支付
'app\event\message\MessageOrderPaySuccess',
// 订单发货
'app\event\message\MessageOrderDelivery',
// 商家同意退款
'app\event\message\MessageShopRefundAgree',
// 商家拒绝退款
'app\event\message\MessageShopRefundRefuse',
// 核销通知
'app\event\message\MessageShopVerified',
// 核销码过期提醒
'app\event\message\MessageVerifyCodeExpire',
// 注册验证
'app\event\message\MessageRegisterCode',
// 找回密码
'app\event\message\MessageFindCode',
// 会员登陆成功
'app\event\message\MessageLogin',
// 帐户绑定验证码
'app\event\message\MessageBindCode',
// 动态码登陆验证码
'app\event\message\MessageLoginCode',
// 支付密码修改通知
'app\event\message\MessageMemberPayPassword',
// 设置密码
'app\event\message\MessageSetPassWord',
// 买家发起退款提醒
'app\event\message\MessageOrderRefundApply',
// 买家已退货提醒
'app\event\message\MessageOrderRefundDelivery',
// 买家支付通知商家
'app\event\message\MessageBuyerPaySuccess',
// 买家订单完成通知
'app\event\message\MessageBuyerOrderComplete',
// 会员申请提现通知
'app\event\message\MessageUserWithdrawalApply',
// 会员提现成功通知
'app\event\message\MessageUserWithdrawalSuccess',
// 会员提现失败通知
'app\event\message\MessageUserWithdrawalError',
// 分销申请提现通知
'app\event\message\MessageFenxiaoWithdrawalApply',
// 分销提现成功通知
'app\event\message\MessageFenxiaoWithdrawalSuccess',
// 分销提现失败通知
'app\event\message\MessageFenxiaoWithdrawalError',
// 分销佣金发放通知
'app\event\message\MessageOrderCommissionGrant',
// 会员注销成功通知
'app\event\message\MessageCancelSuccess',
// 会员注销失败通知
'app\event\message\MessageCancelFail',
// 会员注销申请通知
'app\event\message\MessageCancelApply',
// 会员账户变动通知通知
'app\event\message\MessageAccountChangeNotice',
// 收银台会员验证验证码
'app\event\message\MessageCashierMemberVerifyCode',
//外卖订单 指定配送员后 同步短信推送
'app\event\message\MessageLocalWaitDelivery',
],
//发送短信
'sendSms' => [
],
/**********************************************************************网站进行初始化*********************************/
/**
* 店铺相关事件
* 完成店铺相关功能操作
*/
'AddSite' => [
'app\event\addsite\AddSiteDiyView',//增加默认自定义数据:主页主页、商品分类、底部导航
'app\event\addsite\AddMemberLevel',//增加默认会员等级
'app\event\addsite\AddRegisterAgreement',//增加默认会员注册协议
'app\event\addsite\AddSiteConfig',//增加默认配置项
'app\event\addsite\AddSiteDelivery',//增加默认配送管理数据
'app\event\addsite\AddSiteExpressCompany',//增加默认物流公司数据
'app\event\addsite\AddMemberClusterCronRefresh',//增加会员群体定时刷新任务
'app\event\addsite\AddSiteAdv', // 增加默认广告
'app\event\addsite\AddStoreDiyView', //增加门店主页装修
],
// 添加店铺演示数据
'AddYanshiData' => [
'app\event\addsite\AddYanshiData',//增加默认商品相关数据商品1~3个、商品分类、商品服务
],
// 定时积分任务
'CronPointTask' => [
'app\event\account\CronPointTask',
],
],
'subscribe' => [
],
];

View File

@@ -1,36 +1,28 @@
<?php
/**
*/
namespace app\event;
use app\model\system\Qrcode as QrcodeModel;
/**
* 生成二维码
* @author Administrator
*
*/
class Qrcode
{
public function handle($param)
{
if (in_array($param[ "app_type" ], [ 'pc', 'h5', 'all', 'wechat', 'app' ])) {
if ($param[ "app_type" ] == 'pc') {
$param[ "app_type" ] = 'pc';
} else {
$param[ "app_type" ] = 'h5';
}
$qrcode = new QrcodeModel();
$res = $qrcode->createQrcode($param);
return $res;
}
}
}
<?php
namespace app\event;
use app\model\system\Qrcode as QrcodeModel;
/**
* 生成二维码
* @author Administrator
*
*/
class Qrcode
{
public function handle($param)
{
if (in_array($param[ "app_type" ], [ 'pc', 'h5', 'all', 'wechat', 'app' ])) {
if ($param[ "app_type" ] == 'pc') {
$param[ "app_type" ] = 'pc';
} else {
$param[ "app_type" ] = 'h5';
}
$qrcode = new QrcodeModel();
$res = $qrcode->createQrcode($param);
return $res;
}
}
}

View File

@@ -0,0 +1,16 @@
<?php
namespace app\event\account;
use app\model\account\Point as PointModel;
/**
* 登录成功发送通知
*/
class CronPointTask
{
public function handle($param)
{
return (new PointModel())->execPointTaskCron($param['relate_id']);
}
}

View File

@@ -1,27 +1,19 @@
<?php
/**
*/
namespace app\event\addsite;
use app\model\member\MemberCluster as MemberClusterModel;
/**
* 初始化添加会员群体定时刷新事件
*/
class AddMemberClusterCronRefresh
{
// 行为扩展的执行入口必须是run
public function handle()
{
$member_cluster_model = new MemberClusterModel();
$result = $member_cluster_model->addMemberClusterCronRefresh();
return $result;
}
<?php
namespace app\event\addsite;
use app\model\member\MemberCluster as MemberClusterModel;
/**
* 初始化添加会员群体定时刷新事件
*/
class AddMemberClusterCronRefresh
{
// 行为扩展的执行入口必须是run
public function handle()
{
$member_cluster_model = new MemberClusterModel();
$result = $member_cluster_model->addMemberClusterCronRefresh();
return $result;
}
}

View File

@@ -1,43 +1,34 @@
<?php
/**
*/
namespace app\event\addsite;
use app\model\member\MemberLevel;
/**
* 增加默认会员等级
*/
class AddMemberLevel
{
public function handle($param)
{
if (!empty($param['site_id'])) {
$member_level = new MemberLevel();
$data = [
'site_id' => $param['site_id'],
'level_name' => '普通会员',
'is_default' => 1,
'is_free_shipping' => 0,
'charge_rule' => '',
'charge_type' => 0
];
$res = $member_level->addMemberLevel($data);
return $res;
}
}
<?php
namespace app\event\addsite;
use app\model\member\MemberLevel;
/**
* 增加默认会员等级
*/
class AddMemberLevel
{
public function handle($param)
{
if (!empty($param['site_id'])) {
$member_level = new MemberLevel();
$data = [
'site_id' => $param['site_id'],
'level_name' => '普通会员',
'is_default' => 1,
'is_free_shipping' => 0,
'charge_rule' => '',
'charge_type' => 0
];
$res = $member_level->addMemberLevel($data);
return $res;
}
}
}

View File

@@ -1,35 +1,26 @@
<?php
/**
*/
namespace app\event\addsite;
use app\model\member\Config;
/**
* 增加默认会员注册协议
*/
class AddRegisterAgreement
{
public function handle($param)
{
if (!empty($param['site_id'])) {
$document_model = new Config();
$content = '注册协议内容';
$res = $document_model->setRegisterDocument('注册协议', $content, $param['site_id'], 'shop');
return $res;
}
}
<?php
namespace app\event\addsite;
use app\model\member\Config;
/**
* 增加默认会员注册协议
*/
class AddRegisterAgreement
{
public function handle($param)
{
if (!empty($param['site_id'])) {
$document_model = new Config();
$content = '注册协议内容';
$res = $document_model->setRegisterDocument('注册协议', $content, $param['site_id'], 'shop');
return $res;
}
}
}

View File

@@ -1,247 +1,239 @@
<?php
/**
*/
namespace app\event\addsite;
use app\model\web\Adv;
use app\model\web\AdvPosition;
/**
* 增加默认广告位 广告图
*/
class AddSiteAdv
{
private $adv_data = [
[
'ap_name' => 'PC端首页',
'keyword' => 'NS_PC_INDEX',
'ap_intro' => '',
'ap_width' => '763',
'ap_height' => '430',
'default_content' => '',
'ap_background_color' => '#FFFFFF',
'type' => 1,
'adv' => [
[
'adv_title' => '广告一',
'adv_url' => '',
'adv_image' => 'public/static/img/pc/gg_pc_index_carousel_1.png',
'background' => '#e7171f'
]
]
],
[
'ap_name' => 'PC端首页顶部',
'keyword' => 'NS_PC_INDEX_TOP',
'ap_intro' => '',
'ap_width' => '1210',
'ap_height' => '70',
'default_content' => '',
'ap_background_color' => '#FFFFFF',
'type' => 1,
'adv' => [
[
'adv_title' => '广告一',
'adv_url' => '',
'adv_image' => 'public/static/img/pc/gg_pc_index_top_carousel_1.png',
'background' => '#FF5726'
]
]
],
[
'ap_name' => 'PC端首页中部左侧',
'keyword' => 'NS_PC_INDEX_MID_LEFT',
'ap_intro' => '',
'ap_width' => '291',
'ap_height' => '372',
'default_content' => '',
'ap_background_color' => '#FFFFFF',
'type' => 1,
'adv' => [
[
'adv_title' => '广告一',
'adv_url' => '',
'adv_image' => 'public/static/img/pc/gg_pc_index_mid_left_1.png',
'background' => '#FFFFFF'
],
[
'adv_title' => '广告二',
'adv_url' => '',
'adv_image' => 'public/static/img/pc/gg_pc_index_mid_left_2.png',
'background' => '#FFFFFF'
]
]
],
[
'ap_name' => 'PC端首页中部右侧',
'keyword' => 'NS_PC_INDEX_MID_RIGHT',
'ap_intro' => '',
'ap_width' => '291',
'ap_height' => '180',
'default_content' => '',
'ap_background_color' => '#FFFFFF',
'type' => 1,
'adv' => [
[
'adv_title' => '广告一',
'adv_url' => '',
'adv_image' => 'public/static/img/pc/gg_pc_index_mid_right_1.png',
'background' => '#FFFFFF'
],
[
'adv_title' => '广告二',
'adv_url' => '',
'adv_image' => 'public/static/img/pc/gg_pc_index_mid_right_2.png',
'background' => '#FFFFFF'
],
[
'adv_title' => '广告三',
'adv_url' => '',
'adv_image' => 'public/static/img/pc/gg_pc_index_mid_right_3.png',
'background' => '#FFFFFF'
],
[
'adv_title' => '广告四',
'adv_url' => '',
'adv_image' => 'public/static/img/pc/gg_pc_index_mid_right_4.png',
'background' => '#FFFFFF'
]
]
],
[
'ap_name' => 'PC端首页分类下方',
'keyword' => 'NS_PC_INDEX_CATEGORY_BELOW',
'ap_intro' => '',
'ap_width' => '210',
'ap_height' => '1200',
'default_content' => '',
'ap_background_color' => '#FFFFFF',
'type' => 1,
'adv' => [
]
],
[
'ap_name' => 'PC端品牌专区',
'keyword' => 'NS_PC_BRAND',
'ap_intro' => '',
'ap_width' => '1200',
'ap_height' => '440',
'default_content' => '',
'ap_background_color' => '#FFFFFF',
'type' => 1,
'adv' => [
[
'adv_title' => '广告一',
'adv_url' => '',
'adv_image' => 'public/static/img/pc/gg_pc_brand_carousel_1.png',
'background' => '#FFFFFF'
]
]
],
[
'ap_name' => 'PC端领券中心',
'keyword' => 'NS_PC_COUPON',
'ap_intro' => '',
'ap_width' => '810',
'ap_height' => '406',
'default_content' => '',
'ap_background_color' => '#FFFFFF',
'type' => 1,
'adv' => [
[
'adv_title' => '广告一',
'adv_url' => '',
'adv_image' => 'public/static/img/pc/gg_pc_coupon_carousel_1.png',
'background' => '#FFFFFF'
]
]
],
[
'ap_name' => 'PC端团购专区',
'keyword' => 'NS_PC_GROUPBUY',
'ap_intro' => '',
'ap_width' => '1200',
'ap_height' => '440',
'default_content' => '',
'ap_background_color' => '#FFFFFF',
'type' => 1,
'adv' => [
[
'adv_title' => '广告一',
'adv_url' => '',
'adv_image' => 'public/static/img/pc/gg_pc_groupbuy_carousel_1.png',
'background' => '#FFFFFF'
]
]
],
[
'ap_name' => 'PC端秒杀专区',
'keyword' => 'NS_PC_SECKILL',
'ap_intro' => '',
'ap_width' => '1200',
'ap_height' => '440',
'default_content' => '',
'ap_background_color' => '#FFFFFF',
'type' => 1,
'adv' => [
[
'adv_title' => '广告一',
'adv_url' => '',
'adv_image' => 'public/static/img/pc/gg_pc_seckill_carousel_1.png',
'background' => '#FFFFFF'
]
]
],
[
'ap_name' => 'PC端登录',
'keyword' => 'NS_PC_LOGIN',
'ap_intro' => '',
'ap_width' => '800',
'ap_height' => '460',
'default_content' => '',
'ap_background_color' => '#FFFFFF',
'type' => 1,
'adv' => [
[
'adv_title' => '广告一',
'adv_url' => '',
'adv_image' => 'public/static/img/pc/gg_pc_login_carousel_1.png',
'background' => '#F53E45'
]
]
]
];
public function handle($param)
{
if (!empty($param[ 'site_id' ])) {
$adv_position_model = new AdvPosition();
$adv_model = new Adv();
foreach ($this->adv_data as $k => $v) {
$v[ 'site_id' ] = $param[ 'site_id' ];
$v[ 'is_system' ] = 1;
$adv_data = $v[ 'adv' ];
unset($v[ 'adv' ]);
$res_adv_position = $adv_position_model->addAdvPosition($v);
$ap_id = $res_adv_position[ 'data' ];
if (!empty($ap_id) && !empty($adv_data)) {
foreach ($adv_data as $ck => $cv) {
$cv[ 'site_id' ] = $param[ 'site_id' ];
$cv[ 'ap_id' ] = $ap_id;
$adv_model->addAdv($cv);
}
}
}
}
}
<?php
namespace app\event\addsite;
use app\model\web\Adv;
use app\model\web\AdvPosition;
/**
* 增加默认广告位 广告图
*/
class AddSiteAdv
{
private $adv_data = [
[
'ap_name' => 'PC端首页',
'keyword' => 'NS_PC_INDEX',
'ap_intro' => '',
'ap_width' => '763',
'ap_height' => '430',
'default_content' => '',
'ap_background_color' => '#FFFFFF',
'type' => 1,
'adv' => [
[
'adv_title' => '广告一',
'adv_url' => '',
'adv_image' => 'public/static/img/pc/gg_pc_index_carousel_1.png',
'background' => '#e7171f'
]
]
],
[
'ap_name' => 'PC端首页顶部',
'keyword' => 'NS_PC_INDEX_TOP',
'ap_intro' => '',
'ap_width' => '1210',
'ap_height' => '70',
'default_content' => '',
'ap_background_color' => '#FFFFFF',
'type' => 1,
'adv' => [
[
'adv_title' => '广告一',
'adv_url' => '',
'adv_image' => 'public/static/img/pc/gg_pc_index_top_carousel_1.png',
'background' => '#FF5726'
]
]
],
[
'ap_name' => 'PC端首页中部左侧',
'keyword' => 'NS_PC_INDEX_MID_LEFT',
'ap_intro' => '',
'ap_width' => '291',
'ap_height' => '372',
'default_content' => '',
'ap_background_color' => '#FFFFFF',
'type' => 1,
'adv' => [
[
'adv_title' => '广告一',
'adv_url' => '',
'adv_image' => 'public/static/img/pc/gg_pc_index_mid_left_1.png',
'background' => '#FFFFFF'
],
[
'adv_title' => '广告二',
'adv_url' => '',
'adv_image' => 'public/static/img/pc/gg_pc_index_mid_left_2.png',
'background' => '#FFFFFF'
]
]
],
[
'ap_name' => 'PC端首页中部右侧',
'keyword' => 'NS_PC_INDEX_MID_RIGHT',
'ap_intro' => '',
'ap_width' => '291',
'ap_height' => '180',
'default_content' => '',
'ap_background_color' => '#FFFFFF',
'type' => 1,
'adv' => [
[
'adv_title' => '广告一',
'adv_url' => '',
'adv_image' => 'public/static/img/pc/gg_pc_index_mid_right_1.png',
'background' => '#FFFFFF'
],
[
'adv_title' => '广告二',
'adv_url' => '',
'adv_image' => 'public/static/img/pc/gg_pc_index_mid_right_2.png',
'background' => '#FFFFFF'
],
[
'adv_title' => '广告三',
'adv_url' => '',
'adv_image' => 'public/static/img/pc/gg_pc_index_mid_right_3.png',
'background' => '#FFFFFF'
],
[
'adv_title' => '广告四',
'adv_url' => '',
'adv_image' => 'public/static/img/pc/gg_pc_index_mid_right_4.png',
'background' => '#FFFFFF'
]
]
],
[
'ap_name' => 'PC端首页分类下方',
'keyword' => 'NS_PC_INDEX_CATEGORY_BELOW',
'ap_intro' => '',
'ap_width' => '210',
'ap_height' => '1200',
'default_content' => '',
'ap_background_color' => '#FFFFFF',
'type' => 1,
'adv' => [
]
],
[
'ap_name' => 'PC端品牌专区',
'keyword' => 'NS_PC_BRAND',
'ap_intro' => '',
'ap_width' => '1200',
'ap_height' => '440',
'default_content' => '',
'ap_background_color' => '#FFFFFF',
'type' => 1,
'adv' => [
[
'adv_title' => '广告一',
'adv_url' => '',
'adv_image' => 'public/static/img/pc/gg_pc_brand_carousel_1.png',
'background' => '#FFFFFF'
]
]
],
[
'ap_name' => 'PC端领券中心',
'keyword' => 'NS_PC_COUPON',
'ap_intro' => '',
'ap_width' => '810',
'ap_height' => '406',
'default_content' => '',
'ap_background_color' => '#FFFFFF',
'type' => 1,
'adv' => [
[
'adv_title' => '广告一',
'adv_url' => '',
'adv_image' => 'public/static/img/pc/gg_pc_coupon_carousel_1.png',
'background' => '#FFFFFF'
]
]
],
[
'ap_name' => 'PC端团购专区',
'keyword' => 'NS_PC_GROUPBUY',
'ap_intro' => '',
'ap_width' => '1200',
'ap_height' => '440',
'default_content' => '',
'ap_background_color' => '#FFFFFF',
'type' => 1,
'adv' => [
[
'adv_title' => '广告一',
'adv_url' => '',
'adv_image' => 'public/static/img/pc/gg_pc_groupbuy_carousel_1.png',
'background' => '#FFFFFF'
]
]
],
[
'ap_name' => 'PC端秒杀专区',
'keyword' => 'NS_PC_SECKILL',
'ap_intro' => '',
'ap_width' => '1200',
'ap_height' => '440',
'default_content' => '',
'ap_background_color' => '#FFFFFF',
'type' => 1,
'adv' => [
[
'adv_title' => '广告一',
'adv_url' => '',
'adv_image' => 'public/static/img/pc/gg_pc_seckill_carousel_1.png',
'background' => '#FFFFFF'
]
]
],
[
'ap_name' => 'PC端登录',
'keyword' => 'NS_PC_LOGIN',
'ap_intro' => '',
'ap_width' => '800',
'ap_height' => '460',
'default_content' => '',
'ap_background_color' => '#FFFFFF',
'type' => 1,
'adv' => [
[
'adv_title' => '广告一',
'adv_url' => '',
'adv_image' => 'public/static/img/pc/gg_pc_login_carousel_1.png',
'background' => '#F53E45'
]
]
]
];
public function handle($param)
{
if (!empty($param[ 'site_id' ])) {
$adv_position_model = new AdvPosition();
$adv_model = new Adv();
foreach ($this->adv_data as $k => $v) {
$v[ 'site_id' ] = $param[ 'site_id' ];
$v[ 'is_system' ] = 1;
$adv_data = $v[ 'adv' ];
unset($v[ 'adv' ]);
$res_adv_position = $adv_position_model->addAdvPosition($v);
$ap_id = $res_adv_position[ 'data' ];
if (!empty($ap_id) && !empty($adv_data)) {
foreach ($adv_data as $ck => $cv) {
$cv[ 'site_id' ] = $param[ 'site_id' ];
$cv[ 'ap_id' ] = $ap_id;
$adv_model->addAdv($cv);
}
}
}
}
}
}

View File

@@ -1,32 +1,24 @@
<?php
/**
*/
namespace app\event\addsite;
use app\model\goods\Config;
/**
* 增加默认配置项
*/
class AddSiteConfig
{
public function handle($param)
{
if (!empty($param[ 'site_id' ])) {
$document_model = new Config();
$content = '售后保障协议';
$res = $document_model->setAfterSaleConfig('售后保障协议', $content, $param[ 'site_id' ]);
return $res;
}
}
<?php
namespace app\event\addsite;
use app\model\goods\Config;
/**
* 增加默认配置项
*/
class AddSiteConfig
{
public function handle($param)
{
if (!empty($param[ 'site_id' ])) {
$document_model = new Config();
$content = '售后保障协议';
$res = $document_model->setAfterSaleConfig('售后保障协议', $content, $param[ 'site_id' ]);
return $res;
}
}
}

View File

@@ -1,32 +1,24 @@
<?php
/**
*/
namespace app\event\addsite;
use app\model\express\Config as ConfigModel;
/**
* 增加默认配送管理数据
*/
class AddSiteDelivery
{
public function handle($param)
{
if (!empty($param[ 'site_id' ])) {
$config_model = new ConfigModel();
$data = array ();
$res = $config_model->setExpressConfig($data, 1, $param[ 'site_id' ]);
return $res;
}
}
<?php
namespace app\event\addsite;
use app\model\express\Config as ConfigModel;
/**
* 增加默认配送管理数据
*/
class AddSiteDelivery
{
public function handle($param)
{
if (!empty($param[ 'site_id' ])) {
$config_model = new ConfigModel();
$data = array ();
$res = $config_model->setExpressConfig($data, 1, $param[ 'site_id' ]);
return $res;
}
}
}

View File

@@ -1,37 +1,29 @@
<?php
/**
*/
namespace app\event\addsite;
use app\model\diy\Template;
/**
* 增加默认自定义数据:网站主页、商品分类、底部导航
*/
class AddSiteDiyView
{
public function handle($param)
{
if (!empty($param[ 'site_id' ])) {
$diy_template = new Template();
// 查询一条模板组
$template_goods_info = $diy_template->getFirstTemplateGoods([], 'goods_id', 'goods_id asc')[ 'data' ];
if (!empty($template_goods_info)) {
$res = $diy_template->useTemplate([
'site_id' => $param[ 'site_id' ],
'goods_id' => $template_goods_info[ 'goods_id' ],
]);
return $res;
}
}
}
<?php
namespace app\event\addsite;
use app\model\diy\Template;
/**
* 增加默认自定义数据:网站主页、商品分类、底部导航
*/
class AddSiteDiyView
{
public function handle($param)
{
if (!empty($param[ 'site_id' ])) {
$diy_template = new Template();
// 查询一条模板组
$template_goods_info = $diy_template->getFirstTemplateGoods([], 'goods_id', 'goods_id asc')[ 'data' ];
if (!empty($template_goods_info)) {
$res = $diy_template->useTemplate([
'site_id' => $param[ 'site_id' ],
'goods_id' => $template_goods_info[ 'goods_id' ],
]);
return $res;
}
}
}
}

View File

@@ -1,202 +1,194 @@
<?php
/**
*/
namespace app\event\addsite;
use app\model\express\ExpressCompany;
use app\model\express\ExpressCompanyTemplate;
/**
* 增加默认物流公司数据:
*/
class AddSiteExpressCompany
{
public function handle($param)
{
if (!empty($param[ 'site_id' ])) {
$template_model = new ExpressCompanyTemplate();
$express_company_model = new ExpressCompany();
$template_data = [
[
'company_name' => '顺丰速运',
'sort' => 1,
'logo' => 'public/static/img/express/shunfeng.png',
'url' => 'http://www.sf-express.com',
'express_no' => 'SF',
'express_no_kd100' => 'shunfeng',
'express_no_cainiao' => 'SF',
'content_json' => '[]',
'background_image' => '',
'font_size' => 14,
'width' => 766,
'height' => 510,
'scale' => 1.00,
'create_time' => time(),
'is_electronicsheet' => 1,
'print_style' => '[{"template_name":"二联 150 新","template_size":"15001"},{"template_name":"二联 180 新","template_size":"180"},{"template_name":"三联 210 新","template_size":"21001"}]'
],
[
'company_name' => '韵达速递',
'sort' => 2,
'logo' => 'public/static/img/express/yunda.png',
'url' => 'http://www.yundaex.com',
'express_no' => 'YD',
'express_no_kd100' => '',
'express_no_cainiao' => '',
'content_json' => '[]',
'background_image' => '',
'font_size' => 14,
'width' => 766,
'height' => 510,
'scale' => 1.00,
'create_time' => time(),
'is_electronicsheet' => 0,
'print_style' => ''
],
[
'company_name' => '百世快递',
'sort' => 3,
'logo' => 'public/static/img/express/huitongkuaidi.png',
'url' => 'http://www.800bestex.com/',
'express_no' => 'HTKY',
'express_no_kd100' => '',
'express_no_cainiao' => '',
'content_json' => '',
'background_image' => '',
'font_size' => 14,
'width' => 766,
'height' => 510,
'scale' => 1.00,
'create_time' => time(),
'is_electronicsheet' => 0,
'print_style' => ''
],
[
'company_name' => '圆通速递',
'sort' => 4,
'logo' => 'public/static/img/express/yuantong.png',
'url' => 'http://www.yto.net.cn/',
'express_no' => 'YTO',
'express_no_kd100' => '',
'express_no_cainiao' => '',
'content_json' => '',
'background_image' => '',
'font_size' => 14,
'width' => 766,
'height' => 510,
'scale' => 1.00,
'create_time' => time(),
'is_electronicsheet' => 0,
'print_style' => ''
],
[
'company_name' => '中通快递',
'sort' => 5,
'logo' => 'public/static/img/express/zhongtong.png',
'url' => 'https://www.zto.com/',
'express_no' => 'ZTO',
'express_no_kd100' => '',
'express_no_cainiao' => '',
'content_json' => '',
'background_image' => '',
'font_size' => 14,
'width' => 766,
'height' => 510,
'scale' => 1.00,
'create_time' => time(),
'is_electronicsheet' => 0,
'print_style' => ''
],
[
'company_name' => '申通快递',
'sort' => 6,
'logo' => 'public/static/img/express/shentong.png',
'url' => 'http://www.sto.cn/',
'express_no' => 'STO',
'express_no_kd100' => '',
'express_no_cainiao' => '',
'content_json' => '',
'background_image' => '',
'font_size' => 14,
'width' => 766,
'height' => 510,
'scale' => 1.00,
'create_time' => time(),
'is_electronicsheet' => 0,
'print_style' => ''
],
[
'company_name' => '邮政国内标快',
'sort' => 7,
'logo' => 'public/static/img/express/youzhengguonei.png',
'url' => 'http://yjcx.chinapost.com.cn/qps/yjcx',
'express_no' => 'YZBK',
'express_no_kd100' => '',
'express_no_cainiao' => '',
'content_json' => '',
'background_image' => '',
'font_size' => 14,
'width' => 766,
'height' => 510,
'scale' => 1.00,
'create_time' => time(),
'is_electronicsheet' => 1,
'print_style' => '[{"template_name":"二联 150","template_size":""}]'
],
[
'company_name' => '邮政快递包裹',
'sort' => 8,
'logo' => 'public/static/img/express/youzhengkd.png',
'url' => 'http://yjcx.chinapost.com.cn/qps/yjcx',
'express_no' => 'YZPY',
'express_no_kd100' => '',
'express_no_cainiao' => '',
'content_json' => '',
'background_image' => '',
'font_size' => 14,
'width' => 766,
'height' => 510,
'scale' => 1.00,
'create_time' => time(),
'is_electronicsheet' => 1,
'print_style' => '[{"template_name":"二联 180","template_size":""},{"template_name":"二联 180 新","template_size":"180"}]'
],
// [
// 'company_name' => '天天快递',
// 'sort' => 9,
// 'logo' => 'public/static/img/express/tiantian.png',
// 'url' => 'https://www.ttkdex.com/',
// 'express_no' => '',
// 'express_no_kd100' => '',
// 'express_no_cainiao' => '',
// 'content_json' => '',
// 'background_image' => '',
// 'font_size' => 14,
// 'width' => 766,
// 'height' => 510,
// 'scale' => 1.00,
// 'create_time' => time(),
// 'is_electronicsheet' => 0,
// 'print_style' => ''
// ]
];
foreach ($template_data as $item) {
$item[ 'site_id' ] = $param[ 'site_id' ];
$res = $template_model->addExpressCompanyTemplate($item);
if ($res[ 'code' ] >= 0) {
$express_company_model->addExpressCompany([ 'site_id' => $param[ 'site_id' ], 'company_id' => $res[ 'data' ] ]);
}
}
}
}
<?php
namespace app\event\addsite;
use app\model\express\ExpressCompany;
use app\model\express\ExpressCompanyTemplate;
/**
* 增加默认物流公司数据:
*/
class AddSiteExpressCompany
{
public function handle($param)
{
if (!empty($param[ 'site_id' ])) {
$template_model = new ExpressCompanyTemplate();
$express_company_model = new ExpressCompany();
$template_data = [
[
'company_name' => '顺丰速运',
'sort' => 1,
'logo' => 'public/static/img/express/shunfeng.png',
'url' => 'http://www.sf-express.com',
'express_no' => 'SF',
'express_no_kd100' => 'shunfeng',
'express_no_cainiao' => 'SF',
'content_json' => '[]',
'background_image' => '',
'font_size' => 14,
'width' => 766,
'height' => 510,
'scale' => 1.00,
'create_time' => time(),
'is_electronicsheet' => 1,
'print_style' => '[{"template_name":"二联 150 新","template_size":"15001"},{"template_name":"二联 180 新","template_size":"180"},{"template_name":"三联 210 新","template_size":"21001"}]'
],
[
'company_name' => '韵达速递',
'sort' => 2,
'logo' => 'public/static/img/express/yunda.png',
'url' => 'http://www.yundaex.com',
'express_no' => 'YD',
'express_no_kd100' => '',
'express_no_cainiao' => '',
'content_json' => '[]',
'background_image' => '',
'font_size' => 14,
'width' => 766,
'height' => 510,
'scale' => 1.00,
'create_time' => time(),
'is_electronicsheet' => 0,
'print_style' => ''
],
[
'company_name' => '百世快递',
'sort' => 3,
'logo' => 'public/static/img/express/huitongkuaidi.png',
'url' => 'http://www.800bestex.com/',
'express_no' => 'HTKY',
'express_no_kd100' => '',
'express_no_cainiao' => '',
'content_json' => '',
'background_image' => '',
'font_size' => 14,
'width' => 766,
'height' => 510,
'scale' => 1.00,
'create_time' => time(),
'is_electronicsheet' => 0,
'print_style' => ''
],
[
'company_name' => '圆通速递',
'sort' => 4,
'logo' => 'public/static/img/express/yuantong.png',
'url' => 'http://www.yto.net.cn/',
'express_no' => 'YTO',
'express_no_kd100' => '',
'express_no_cainiao' => '',
'content_json' => '',
'background_image' => '',
'font_size' => 14,
'width' => 766,
'height' => 510,
'scale' => 1.00,
'create_time' => time(),
'is_electronicsheet' => 0,
'print_style' => ''
],
[
'company_name' => '中通快递',
'sort' => 5,
'logo' => 'public/static/img/express/zhongtong.png',
'url' => 'https://www.zto.com/',
'express_no' => 'ZTO',
'express_no_kd100' => '',
'express_no_cainiao' => '',
'content_json' => '',
'background_image' => '',
'font_size' => 14,
'width' => 766,
'height' => 510,
'scale' => 1.00,
'create_time' => time(),
'is_electronicsheet' => 0,
'print_style' => ''
],
[
'company_name' => '申通快递',
'sort' => 6,
'logo' => 'public/static/img/express/shentong.png',
'url' => 'http://www.sto.cn/',
'express_no' => 'STO',
'express_no_kd100' => '',
'express_no_cainiao' => '',
'content_json' => '',
'background_image' => '',
'font_size' => 14,
'width' => 766,
'height' => 510,
'scale' => 1.00,
'create_time' => time(),
'is_electronicsheet' => 0,
'print_style' => ''
],
[
'company_name' => '邮政国内标快',
'sort' => 7,
'logo' => 'public/static/img/express/youzhengguonei.png',
'url' => 'http://yjcx.chinapost.com.cn/qps/yjcx',
'express_no' => 'YZBK',
'express_no_kd100' => '',
'express_no_cainiao' => '',
'content_json' => '',
'background_image' => '',
'font_size' => 14,
'width' => 766,
'height' => 510,
'scale' => 1.00,
'create_time' => time(),
'is_electronicsheet' => 1,
'print_style' => '[{"template_name":"二联 150","template_size":""}]'
],
[
'company_name' => '邮政快递包裹',
'sort' => 8,
'logo' => 'public/static/img/express/youzhengkd.png',
'url' => 'http://yjcx.chinapost.com.cn/qps/yjcx',
'express_no' => 'YZPY',
'express_no_kd100' => '',
'express_no_cainiao' => '',
'content_json' => '',
'background_image' => '',
'font_size' => 14,
'width' => 766,
'height' => 510,
'scale' => 1.00,
'create_time' => time(),
'is_electronicsheet' => 1,
'print_style' => '[{"template_name":"二联 180","template_size":""},{"template_name":"二联 180 新","template_size":"180"}]'
],
// [
// 'company_name' => '天天快递',
// 'sort' => 9,
// 'logo' => 'public/static/img/express/tiantian.png',
// 'url' => 'https://www.ttkdex.com/',
// 'express_no' => '',
// 'express_no_kd100' => '',
// 'express_no_cainiao' => '',
// 'content_json' => '',
// 'background_image' => '',
// 'font_size' => 14,
// 'width' => 766,
// 'height' => 510,
// 'scale' => 1.00,
// 'create_time' => time(),
// 'is_electronicsheet' => 0,
// 'print_style' => ''
// ]
];
foreach ($template_data as $item) {
$item[ 'site_id' ] = $param[ 'site_id' ];
$res = $template_model->addExpressCompanyTemplate($item);
if ($res[ 'code' ] >= 0) {
$express_company_model->addExpressCompany([ 'site_id' => $param[ 'site_id' ], 'company_id' => $res[ 'data' ] ]);
}
}
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,374 +1,363 @@
<?php
/**
*/
namespace app\event\addsite;
use app\model\goods\Goods as GoodsModel;
use app\model\goods\GoodsCategory as GoodsCategoryModel;
use app\model\goods\GoodsService as GoodsServiceModel;
/**
* 增加默认商品相关数据商品1~3个、商品分类、商品服务
*/
class AddYanshiData
{
public function handle($param)
{
if (!empty($param[ 'site_id' ])) {
// 商品服务
$goods_service_data = [
[
'site_id' => $param[ 'site_id' ],
'service_name' => '7天无理由退货',
'desc' => '支持7天无理由退货(拆封后不支持)',
'icon' => '{"imageUrl":"","icon":"icondiy icon-system-7days-return","iconType":"icon","style":{"fontSize":100,"iconBgColor":[],"iconBgColorDeg":0,"iconBgImg":"","bgRadius":0,"iconColor":["#888888","#888888"],"iconColorDeg":125}}'
],
[
'site_id' => $param[ 'site_id' ],
'service_name' => '闪电退款',
'desc' => '闪电退款为会员提供的快速退款服务',
'icon' => '{"imageUrl":"","icon":"icondiy icon-system-lightning-refund","iconType":"icon","style":{"fontSize":100,"iconBgColor":[],"iconBgColorDeg":0,"iconBgImg":"","bgRadius":0,"iconColor":["#888888","#888888"],"iconColorDeg":125}}'
],
[
'site_id' => $param[ 'site_id' ],
'service_name' => '货到付款',
'desc' => '支持送货上门后再收款支持现金、POS机刷卡等方式',
'icon' => '{"imageUrl":"","icon":"icondiy icon-system-cash-delivery","iconType":"icon","style":{"fontSize":100,"iconBgColor":[],"iconBgColorDeg":0,"iconBgImg":"","bgRadius":0,"iconColor":["#888888","#888888"],"iconColorDeg":125}}'
],
[
'site_id' => $param[ 'site_id' ],
'service_name' => '运费险',
'desc' => '卖家为您购买的商品投保退货运费险(保单生效以确认订单页展示的运费险为准)',
'icon' => '{"imageUrl":"","icon":"icondiy icon-system-freight","iconType":"icon","style":{"fontSize":100,"iconBgColor":[],"iconBgColorDeg":0,"iconBgImg":"","bgRadius":0,"iconColor":["#888888","#888888"],"iconColorDeg":125}}'
],
[
'site_id' => $param[ 'site_id' ],
'service_name' => '公益宝贝',
'desc' => '购买该商品,每笔成交都会有相应金额捐赠给公益。感谢您的支持,愿公益的快乐伴随您每一天',
'icon' => '{"imageUrl":"","icon":"icondiy icon-system-gongyi","iconType":"icon","style":{"fontSize":87,"iconBgColor":[],"iconBgColorDeg":0,"iconBgImg":"","bgRadius":0,"iconColor":["#888888","#888888"],"iconColorDeg":125}}'
]
];
$model = new GoodsServiceModel();
$res = $model->addServiceList($goods_service_data);
//传输数据时直接返回不增加分类和商品
return $res;
// 商品分类
$goods_category_model = new GoodsCategoryModel();
$category_data = [
[
'site_id' => $param[ 'site_id' ],
'category_name' => '分类一',
'level' => 1,
'is_show' => 0,
'category_full_name' => '分类一'
],
[
'site_id' => $param[ 'site_id' ],
'category_name' => '分类二',
'level' => 1,
'is_show' => 0,
'category_full_name' => '分类二'
],
[
'site_id' => $param[ 'site_id' ],
'category_name' => '分类三',
'level' => 1,
'is_show' => 0,
'category_full_name' => '分类三'
],
];
$category_ids = [];
foreach ($category_data as $ck => $cv) {
$category_res = $goods_category_model->addCategory($cv);
if (!empty($category_res[ 'data' ])) {
//修改category_id_
$update_data = [
'category_id' => $category_res[ 'data' ],
'category_id_1' => $category_res[ 'data' ],
'site_id' => $param[ 'site_id' ]
];
$goods_category_model->editCategory($update_data);
$category_ids[] = $category_res[ 'data' ];
}
}
// 商品
$goods_data = [
[
"goods_name" => '商品一',
"goods_attr_class" => "",
"goods_attr_name" => "",
"site_id" => $param[ 'site_id' ],
"category_id" => "," . $category_ids[ 0 ] . ",",
"category_json" => '[" ' . $category_ids[ 0 ] . '"]',
"goods_image" => "public/static/img/default_img/square.png",
"goods_content" => "<p>商品一</p>",
"goods_state" => "1",
"price" => "0.01",
"market_price" => "",
"cost_price" => "",
"sku_no" => "",
"weight" => "",
"volume" => "",
"goods_stock" => "100",
"goods_stock_alarm" => "",
"is_free_shipping" => "1",
"shipping_template" => "",
"goods_spec_format" => "",
"goods_attr_format" => "",
"introduction" => "",
"keywords" => "",
"unit" => "",
"sort" => "",
"video_url" => "",
"goods_sku_data" => json_encode([ [
"sku_id" => 0,
'sku_name' => '商品一',
"spec_name" => "",
"sku_no" => "",
"sku_spec_format" => "",
"price" => "0.01",
"market_price" => "",
"cost_price" => "",
"stock" => "100",
"weight" => "",
"volume" => "",
"sku_image" => "public/static/img/default_img/square.png",
"sku_images" => "public/static/img/default_img/square.png",
"virtual_sale" => 0,
"max_buy" => 0,
"min_buy" => 0,
"stock_alarm" => 0
] ]),
"goods_service_ids" => "",
"label_id" => "",
"brand_id" => 0,
"virtual_sale" => 0,
"max_buy" => 0,
"min_buy" => 0,
"recommend_way" => 0,
"timer_on" => 0,
"timer_off" => 0,
"is_consume_discount" => 0,
"sale_show" => 1,
"stock_show" => 1,
"market_price_show" => 1,
"barrage_show" => 1,
'support_trade_type' => 'express'
],
[
"goods_name" => '商品二',
"goods_attr_class" => "",
"goods_attr_name" => "",
"site_id" => $param[ 'site_id' ],
"category_id" => "," . $category_ids[ 1 ] . ",",
"category_json" => '[" ' . $category_ids[ 1 ] . '"]',
"goods_image" => "public/static/img/default_img/square.png",
"goods_content" => "<p>商品二</p>",
"goods_state" => "1",
"price" => "0.01",
"market_price" => "",
"cost_price" => "",
"sku_no" => "",
"weight" => "",
"volume" => "",
"goods_stock" => "100",
"goods_stock_alarm" => "",
"is_free_shipping" => "1",
"shipping_template" => "",
"goods_spec_format" => "",
"goods_attr_format" => "",
"introduction" => "",
"keywords" => "",
"unit" => "",
"sort" => "",
"video_url" => "",
"goods_sku_data" => json_encode([ [
"sku_id" => 0,
'sku_name' => '商品二',
"spec_name" => "",
"sku_no" => "",
"sku_spec_format" => "",
"price" => "0.01",
"market_price" => "",
"cost_price" => "",
"stock" => "100",
"weight" => "",
"volume" => "",
"sku_image" => "public/static/img/default_img/square.png",
"sku_images" => "public/static/img/default_img/square.png",
"virtual_sale" => 0,
"max_buy" => 0,
"min_buy" => 0,
"stock_alarm" => 0
] ]),
"goods_service_ids" => "",
"label_id" => "",
"brand_id" => 0,
"virtual_sale" => 0,
"max_buy" => 0,
"min_buy" => 0,
"recommend_way" => 0,
"timer_on" => 0,
"timer_off" => 0,
"is_consume_discount" => 0,
"sale_show" => 1,
"stock_show" => 1,
"market_price_show" => 1,
"barrage_show" => 1,
'support_trade_type' => 'express'
],
[
"goods_name" => '商品三',
"goods_attr_class" => "",
"goods_attr_name" => "",
"site_id" => $param[ 'site_id' ],
"category_id" => "," . $category_ids[ 2 ] . ",",
"category_json" => '[" ' . $category_ids[ 2 ] . '"]',
"goods_image" => "public/static/img/default_img/square.png",
"goods_content" => "<p>商品三</p>",
"goods_state" => "1",
"price" => "0.01",
"market_price" => "",
"cost_price" => "",
"sku_no" => "",
"weight" => "",
"volume" => "",
"goods_stock" => "100",
"goods_stock_alarm" => "",
"is_free_shipping" => "1",
"shipping_template" => "",
"goods_spec_format" => "",
"goods_attr_format" => "",
"introduction" => "",
"keywords" => "",
"unit" => "",
"sort" => "",
"video_url" => "",
"goods_sku_data" => json_encode([ [
"sku_id" => 0,
'sku_name' => '商品三',
"spec_name" => "",
"sku_no" => "",
"sku_spec_format" => "",
"price" => "0.01",
"market_price" => "",
"cost_price" => "",
"stock" => "100",
"weight" => "",
"volume" => "",
"sku_image" => "public/static/img/default_img/square.png",
"sku_images" => "public/static/img/default_img/square.png",
"virtual_sale" => 0,
"max_buy" => 0,
"min_buy" => 0,
"stock_alarm" => 0
] ]),
"goods_service_ids" => "",
"label_id" => "",
"brand_id" => 0,
"virtual_sale" => 0,
"max_buy" => 0,
"min_buy" => 0,
"recommend_way" => 0,
"timer_on" => 0,
"timer_off" => 0,
"is_consume_discount" => 0,
"sale_show" => 1,
"stock_show" => 1,
"market_price_show" => 1,
"barrage_show" => 1,
'support_trade_type' => 'express'
],
[
'goods_name' => '商品四',
"goods_attr_class" => "",
"goods_attr_name" => "",
"site_id" => $param[ 'site_id' ],
"category_id" => "," . $category_ids[ 2 ] . ",",
"category_json" => '[" ' . $category_ids[ 2 ] . '"]',
"goods_image" => "public/static/img/default_img/square.png",
"goods_content" => "<p>商品四</p>",
"goods_state" => "1",
"price" => "0.01",
"market_price" => "",
"cost_price" => "",
"sku_no" => "",
"weight" => "",
"volume" => "",
"goods_stock" => "100",
"goods_stock_alarm" => "",
"is_free_shipping" => "1",
"shipping_template" => "",
"goods_spec_format" => "",
"goods_attr_format" => "",
"introduction" => "",
"keywords" => "",
"unit" => "",
"sort" => "",
"video_url" => "",
"goods_sku_data" => json_encode([ [
"sku_id" => 0,
'sku_name' => '商品四',
"spec_name" => "",
"sku_no" => "",
"sku_spec_format" => "",
"price" => "0.01",
"market_price" => "",
"cost_price" => "",
"stock" => "100",
"weight" => "",
"volume" => "",
"sku_image" => "public/static/img/default_img/square.png",
"sku_images" => "public/static/img/default_img/square.png",
"virtual_sale" => 0,
"max_buy" => 0,
"min_buy" => 0,
"stock_alarm" => 0
] ]),
"goods_service_ids" => "",
"label_id" => "",
"brand_id" => 0,
"virtual_sale" => 0,
"max_buy" => 0,
"min_buy" => 0,
"recommend_way" => 0,
"timer_on" => 0,
"timer_off" => 0,
"is_consume_discount" => 0,
"sale_show" => 1,
"stock_show" => 1,
"market_price_show" => 1,
"barrage_show" => 1,
'support_trade_type' => 'express'
]
];
$goods_model = new GoodsModel();
foreach ($goods_data as $gk => $gv) {
$res = $goods_model->addGoods($gv);
}
return $res;
}
}
<?php
namespace app\event\addsite;
use app\model\goods\Goods as GoodsModel;
use app\model\goods\GoodsCategory as GoodsCategoryModel;
use app\model\goods\GoodsService as GoodsServiceModel;
/**
* 增加默认商品相关数据商品1~3个、商品分类、商品服务
*/
class AddYanshiData
{
public function handle($param)
{
if (!empty($param[ 'site_id' ])) {
// 商品服务
$goods_service_data = [
[
'site_id' => $param[ 'site_id' ],
'service_name' => '7天无理由退货',
'desc' => '支持7天无理由退货(拆封后不支持)',
'icon' => '{"imageUrl":"","icon":"icondiy icon-system-7days-return","iconType":"icon","style":{"fontSize":100,"iconBgColor":[],"iconBgColorDeg":0,"iconBgImg":"","bgRadius":0,"iconColor":["#888888","#888888"],"iconColorDeg":125}}'
],
[
'site_id' => $param[ 'site_id' ],
'service_name' => '闪电退款',
'desc' => '闪电退款为会员提供的快速退款服务',
'icon' => '{"imageUrl":"","icon":"icondiy icon-system-lightning-refund","iconType":"icon","style":{"fontSize":100,"iconBgColor":[],"iconBgColorDeg":0,"iconBgImg":"","bgRadius":0,"iconColor":["#888888","#888888"],"iconColorDeg":125}}'
],
[
'site_id' => $param[ 'site_id' ],
'service_name' => '货到付款',
'desc' => '支持送货上门后再收款支持现金、POS机刷卡等方式',
'icon' => '{"imageUrl":"","icon":"icondiy icon-system-cash-delivery","iconType":"icon","style":{"fontSize":100,"iconBgColor":[],"iconBgColorDeg":0,"iconBgImg":"","bgRadius":0,"iconColor":["#888888","#888888"],"iconColorDeg":125}}'
],
[
'site_id' => $param[ 'site_id' ],
'service_name' => '运费险',
'desc' => '卖家为您购买的商品投保退货运费险(保单生效以确认订单页展示的运费险为准)',
'icon' => '{"imageUrl":"","icon":"icondiy icon-system-freight","iconType":"icon","style":{"fontSize":100,"iconBgColor":[],"iconBgColorDeg":0,"iconBgImg":"","bgRadius":0,"iconColor":["#888888","#888888"],"iconColorDeg":125}}'
],
[
'site_id' => $param[ 'site_id' ],
'service_name' => '公益宝贝',
'desc' => '购买该商品,每笔成交都会有相应金额捐赠给公益。感谢您的支持,愿公益的快乐伴随您每一天',
'icon' => '{"imageUrl":"","icon":"icondiy icon-system-gongyi","iconType":"icon","style":{"fontSize":87,"iconBgColor":[],"iconBgColorDeg":0,"iconBgImg":"","bgRadius":0,"iconColor":["#888888","#888888"],"iconColorDeg":125}}'
]
];
$model = new GoodsServiceModel();
$res = $model->addServiceList($goods_service_data);
//传输数据时直接返回不增加分类和商品
return $res;
// 商品分类
$goods_category_model = new GoodsCategoryModel();
$category_data = [
[
'site_id' => $param[ 'site_id' ],
'category_name' => '分类一',
'level' => 1,
'is_show' => 0,
'category_full_name' => '分类一'
],
[
'site_id' => $param[ 'site_id' ],
'category_name' => '分类二',
'level' => 1,
'is_show' => 0,
'category_full_name' => '分类二'
],
[
'site_id' => $param[ 'site_id' ],
'category_name' => '分类三',
'level' => 1,
'is_show' => 0,
'category_full_name' => '分类三'
],
];
$category_ids = [];
foreach ($category_data as $ck => $cv) {
$category_res = $goods_category_model->addCategory($cv);
if (!empty($category_res[ 'data' ])) {
//修改category_id_
$update_data = [
'category_id' => $category_res[ 'data' ],
'category_id_1' => $category_res[ 'data' ],
'site_id' => $param[ 'site_id' ]
];
$goods_category_model->editCategory($update_data);
$category_ids[] = $category_res[ 'data' ];
}
}
// 商品
$goods_data = [
[
"goods_name" => '商品一',
"goods_attr_class" => "",
"goods_attr_name" => "",
"site_id" => $param[ 'site_id' ],
"category_id" => "," . $category_ids[ 0 ] . ",",
"category_json" => '[" ' . $category_ids[ 0 ] . '"]',
"goods_image" => "public/static/img/default_img/square.png",
"goods_content" => "<p>商品一</p>",
"goods_state" => "1",
"price" => "0.01",
"market_price" => "",
"cost_price" => "",
"sku_no" => "",
"weight" => "",
"volume" => "",
"goods_stock" => "100",
"goods_stock_alarm" => "",
"is_free_shipping" => "1",
"shipping_template" => "",
"goods_spec_format" => "",
"goods_attr_format" => "",
"introduction" => "",
"keywords" => "",
"unit" => "",
"sort" => "",
"video_url" => "",
"goods_sku_data" => json_encode([ [
"sku_id" => 0,
'sku_name' => '商品一',
"spec_name" => "",
"sku_no" => "",
"sku_spec_format" => "",
"price" => "0.01",
"market_price" => "",
"cost_price" => "",
"stock" => "100",
"weight" => "",
"volume" => "",
"sku_image" => "public/static/img/default_img/square.png",
"sku_images" => "public/static/img/default_img/square.png",
"virtual_sale" => 0,
"max_buy" => 0,
"min_buy" => 0,
"stock_alarm" => 0
] ]),
"goods_service_ids" => "",
"label_id" => "",
"brand_id" => 0,
"virtual_sale" => 0,
"max_buy" => 0,
"min_buy" => 0,
"recommend_way" => 0,
"timer_on" => 0,
"timer_off" => 0,
"is_consume_discount" => 0,
"sale_show" => 1,
"stock_show" => 1,
"market_price_show" => 1,
"barrage_show" => 1,
'support_trade_type' => 'express'
],
[
"goods_name" => '商品二',
"goods_attr_class" => "",
"goods_attr_name" => "",
"site_id" => $param[ 'site_id' ],
"category_id" => "," . $category_ids[ 1 ] . ",",
"category_json" => '[" ' . $category_ids[ 1 ] . '"]',
"goods_image" => "public/static/img/default_img/square.png",
"goods_content" => "<p>商品二</p>",
"goods_state" => "1",
"price" => "0.01",
"market_price" => "",
"cost_price" => "",
"sku_no" => "",
"weight" => "",
"volume" => "",
"goods_stock" => "100",
"goods_stock_alarm" => "",
"is_free_shipping" => "1",
"shipping_template" => "",
"goods_spec_format" => "",
"goods_attr_format" => "",
"introduction" => "",
"keywords" => "",
"unit" => "",
"sort" => "",
"video_url" => "",
"goods_sku_data" => json_encode([ [
"sku_id" => 0,
'sku_name' => '商品二',
"spec_name" => "",
"sku_no" => "",
"sku_spec_format" => "",
"price" => "0.01",
"market_price" => "",
"cost_price" => "",
"stock" => "100",
"weight" => "",
"volume" => "",
"sku_image" => "public/static/img/default_img/square.png",
"sku_images" => "public/static/img/default_img/square.png",
"virtual_sale" => 0,
"max_buy" => 0,
"min_buy" => 0,
"stock_alarm" => 0
] ]),
"goods_service_ids" => "",
"label_id" => "",
"brand_id" => 0,
"virtual_sale" => 0,
"max_buy" => 0,
"min_buy" => 0,
"recommend_way" => 0,
"timer_on" => 0,
"timer_off" => 0,
"is_consume_discount" => 0,
"sale_show" => 1,
"stock_show" => 1,
"market_price_show" => 1,
"barrage_show" => 1,
'support_trade_type' => 'express'
],
[
"goods_name" => '商品三',
"goods_attr_class" => "",
"goods_attr_name" => "",
"site_id" => $param[ 'site_id' ],
"category_id" => "," . $category_ids[ 2 ] . ",",
"category_json" => '[" ' . $category_ids[ 2 ] . '"]',
"goods_image" => "public/static/img/default_img/square.png",
"goods_content" => "<p>商品三</p>",
"goods_state" => "1",
"price" => "0.01",
"market_price" => "",
"cost_price" => "",
"sku_no" => "",
"weight" => "",
"volume" => "",
"goods_stock" => "100",
"goods_stock_alarm" => "",
"is_free_shipping" => "1",
"shipping_template" => "",
"goods_spec_format" => "",
"goods_attr_format" => "",
"introduction" => "",
"keywords" => "",
"unit" => "",
"sort" => "",
"video_url" => "",
"goods_sku_data" => json_encode([ [
"sku_id" => 0,
'sku_name' => '商品三',
"spec_name" => "",
"sku_no" => "",
"sku_spec_format" => "",
"price" => "0.01",
"market_price" => "",
"cost_price" => "",
"stock" => "100",
"weight" => "",
"volume" => "",
"sku_image" => "public/static/img/default_img/square.png",
"sku_images" => "public/static/img/default_img/square.png",
"virtual_sale" => 0,
"max_buy" => 0,
"min_buy" => 0,
"stock_alarm" => 0
] ]),
"goods_service_ids" => "",
"label_id" => "",
"brand_id" => 0,
"virtual_sale" => 0,
"max_buy" => 0,
"min_buy" => 0,
"recommend_way" => 0,
"timer_on" => 0,
"timer_off" => 0,
"is_consume_discount" => 0,
"sale_show" => 1,
"stock_show" => 1,
"market_price_show" => 1,
"barrage_show" => 1,
'support_trade_type' => 'express'
],
[
'goods_name' => '商品四',
"goods_attr_class" => "",
"goods_attr_name" => "",
"site_id" => $param[ 'site_id' ],
"category_id" => "," . $category_ids[ 2 ] . ",",
"category_json" => '[" ' . $category_ids[ 2 ] . '"]',
"goods_image" => "public/static/img/default_img/square.png",
"goods_content" => "<p>商品四</p>",
"goods_state" => "1",
"price" => "0.01",
"market_price" => "",
"cost_price" => "",
"sku_no" => "",
"weight" => "",
"volume" => "",
"goods_stock" => "100",
"goods_stock_alarm" => "",
"is_free_shipping" => "1",
"shipping_template" => "",
"goods_spec_format" => "",
"goods_attr_format" => "",
"introduction" => "",
"keywords" => "",
"unit" => "",
"sort" => "",
"video_url" => "",
"goods_sku_data" => json_encode([ [
"sku_id" => 0,
'sku_name' => '商品四',
"spec_name" => "",
"sku_no" => "",
"sku_spec_format" => "",
"price" => "0.01",
"market_price" => "",
"cost_price" => "",
"stock" => "100",
"weight" => "",
"volume" => "",
"sku_image" => "public/static/img/default_img/square.png",
"sku_images" => "public/static/img/default_img/square.png",
"virtual_sale" => 0,
"max_buy" => 0,
"min_buy" => 0,
"stock_alarm" => 0
] ]),
"goods_service_ids" => "",
"label_id" => "",
"brand_id" => 0,
"virtual_sale" => 0,
"max_buy" => 0,
"min_buy" => 0,
"recommend_way" => 0,
"timer_on" => 0,
"timer_off" => 0,
"is_consume_discount" => 0,
"sale_show" => 1,
"stock_show" => 1,
"market_price_show" => 1,
"barrage_show" => 1,
'support_trade_type' => 'express'
]
];
$goods_model = new GoodsModel();
foreach ($goods_data as $gk => $gv) {
$res = $goods_model->addGoods($gv);
}
return $res;
}
}
}

View File

@@ -1,32 +1,24 @@
<?php
/**
*/
namespace app\event\goods;
use app\model\goods\Goods;
/**
* 商品自动下架(计划任务)
* @author Administrator
*
*/
class CronGoodsTimerOff
{
public function handle($param)
{
$goods_model = new Goods();
$condition = [
[ 'goods_id', '=', $param[ 'relate_id' ] ]
];
$res = $goods_model->cronModifyGoodsState($condition, 0);
return $res;
}
}
<?php
namespace app\event\goods;
use app\model\goods\Goods;
/**
* 商品自动下架(计划任务)
* @author Administrator
*
*/
class CronGoodsTimerOff
{
public function handle($param)
{
$goods_model = new Goods();
$condition = [
[ 'goods_id', '=', $param[ 'relate_id' ] ]
];
$res = $goods_model->cronModifyGoodsState($condition, 0);
return $res;
}
}

View File

@@ -1,32 +1,24 @@
<?php
/**
*/
namespace app\event\goods;
use app\model\goods\Goods;
/**
* 商品自动上架(计划任务)
* @author Administrator
*
*/
class CronGoodsTimerOn
{
public function handle($param)
{
$goods_model = new Goods();
$condition = [
[ 'goods_id', '=', $param[ 'relate_id' ] ]
];
$res = $goods_model->cronModifyGoodsState($condition, 1);
return $res;
}
}
<?php
namespace app\event\goods;
use app\model\goods\Goods;
/**
* 商品自动上架(计划任务)
* @author Administrator
*
*/
class CronGoodsTimerOn
{
public function handle($param)
{
$goods_model = new Goods();
$condition = [
[ 'goods_id', '=', $param[ 'relate_id' ] ]
];
$res = $goods_model->cronModifyGoodsState($condition, 1);
return $res;
}
}

View File

@@ -0,0 +1,29 @@
<?php
namespace app\event\goods;
use app\model\goods\Goods;
/**
* 虚拟商品自动下架(计划任务)
* @author Administrator
*
*/
class CronVirtualGoodsVerifyOff
{
public function handle($param)
{
$goods_model = new Goods();
$condition = [
[ 'goods_id', '=', $param[ 'relate_id' ] ]
];
$res = $goods_model->getGoodsDetail($param[ 'relate_id' ])['data'];
if($res['goods_state'] == 1){
$res = $goods_model->cronModifyGoodsState($condition, 0);
}
return $res;
}
}

View File

@@ -0,0 +1,27 @@
<?php
namespace app\event\goods;
use app\model\order\Order;
use think\facade\Db;
class DeleteGoodsCheck
{
public function handle($param)
{
if(in_array($param['field'], ['goods_id', 'sku_id'])){
$order_close = Order::ORDER_CLOSE;
$order_complete = Order::ORDER_COMPLETE;
$cannot_delete_goods_list = model('order_goods')->getList([
['', 'exp', Db::raw("o.order_status not in ({$order_close},{$order_complete}) or (o.order_status = {$order_complete} and o.is_enable_refund = 1)")],
['og.'.$param['field'], 'in', $param['ids']],
], $param['field'], '', 'og', [['order o', 'og.order_id = o.order_id', 'inner']]);
$cannot_delete_ids = array_unique(array_column($cannot_delete_goods_list, $param['field']));
return [
'reason' => '存在进行中的订单',
'cannot_delete_ids' => $cannot_delete_ids,
];
}
}
}

View File

@@ -1,31 +1,23 @@
<?php
/**
*/
namespace app\event\goods;
use app\model\goods\Goods;
/**
* 商品类型(用于商品添加编辑自动寻找)
*/
class GoodsClass
{
public function handle()
{
return [
'goods_class' => (new Goods())->getGoodsClass()['id'],
'goods_class_name' => (new Goods())->getGoodsClass()['name'],
'is_virtual' => 0,
'add_url' => 'shop/goods/addGoods',
'edit_url' => 'shop/goods/editGoods'
];
}
<?php
namespace app\event\goods;
use app\model\goods\Goods;
/**
* 商品类型(用于商品添加编辑自动寻找)
*/
class GoodsClass
{
public function handle()
{
return [
'goods_class' => (new Goods())->getGoodsClass()['id'],
'goods_class_name' => (new Goods())->getGoodsClass()['name'],
'is_virtual' => 0,
'add_url' => 'shop/goods/addGoods',
'edit_url' => 'shop/goods/editGoods'
];
}
}

View File

@@ -1,31 +1,23 @@
<?php
/**
*/
namespace app\event\goods;
use app\model\goods\VirtualGoods;
/**
* 商品类型
*/
class VirtualGoodsClass
{
public function handle()
{
return [
'goods_class' => (new VirtualGoods())->getGoodsClass()['id'],
'goods_class_name' => (new VirtualGoods())->getGoodsClass()['name'],
'is_virtual' => 1,
'add_url' => 'shop/virtualgoods/addGoods',
'edit_url' => 'shop/virtualgoods/editGoods'
];
}
<?php
namespace app\event\goods;
use app\model\goods\VirtualGoods;
/**
* 商品类型
*/
class VirtualGoodsClass
{
public function handle()
{
return [
'goods_class' => (new VirtualGoods())->getGoodsClass()['id'],
'goods_class_name' => (new VirtualGoods())->getGoodsClass()['name'],
'is_virtual' => 1,
'add_url' => 'shop/virtualgoods/addGoods',
'edit_url' => 'shop/virtualgoods/editGoods'
];
}
}

View File

@@ -1,24 +1,16 @@
<?php
/**
*/
namespace app\event\init;
/**
* 应用结束
*/
class AppEnd
{
// 行为扩展的执行入口必须是run
public function handle()
{
return success();
}
<?php
namespace app\event\init;
/**
* 应用结束
*/
class AppEnd
{
// 行为扩展的执行入口必须是run
public function handle()
{
return success();
}
}

View File

@@ -1,68 +1,60 @@
<?php
/**
*/
namespace app\event\init;
use app\model\system\Addon;
use think\facade\Event;
use think\facade\Cache;
/**
* 初始化插件
*/
class InitAddon
{
// 行为扩展的执行入口必须是run
public function handle()
{
if (defined('BIND_MODULE') && BIND_MODULE === 'install') return;
$this->InitEvent();
}
/**
* 初始化事件
*/
private function InitEvent()
{
$cache = Cache::get("addon_event_list");
if (!defined("initroute_tag")) exit();
if (empty($cache)) {
$addon_model = new Addon();
$addon_data = $addon_model->getAddonList([], 'name');
$listen_array = [];
foreach ($addon_data[ 'data' ] as $k => $v) {
if (file_exists('addon/' . $v[ 'name' ] . '/config/event.php')) {
$addon_event = require_once 'addon/' . $v[ 'name' ] . '/config/event.php';
$listen = $addon_event['listen'] ?? [];
if (!empty($listen)) {
$listen_array[] = $listen;
}
}
}
Cache::tag("addon")->set("addon_event_list", $listen_array);
} else {
$listen_array = $cache;
}
if (!empty($listen_array)) {
foreach ($listen_array as $k => $listen) {
if (!empty($listen)) {
Event::listenEvents($listen);
}
}
}
}
<?php
namespace app\event\init;
use app\model\system\Addon;
use think\facade\Event;
use think\facade\Cache;
/**
* 初始化插件
*/
class InitAddon
{
// 行为扩展的执行入口必须是run
public function handle()
{
if (defined('BIND_MODULE') && BIND_MODULE === 'install') return;
$this->InitEvent();
}
/**
* 初始化事件
*/
private function InitEvent()
{
$cache = Cache::get("addon_event_list");
if (!defined("initroute_tag")) exit();
if (empty($cache)) {
$addon_model = new Addon();
$addon_data = $addon_model->getAddonList([], 'name');
$listen_array = [];
foreach ($addon_data[ 'data' ] as $k => $v) {
if (file_exists('addon/' . $v[ 'name' ] . '/config/event.php')) {
$addon_event = require_once 'addon/' . $v[ 'name' ] . '/config/event.php';
$listen = $addon_event['listen'] ?? [];
if (!empty($listen)) {
$listen_array[] = $listen;
}
}
}
Cache::tag("addon")->set("addon_event_list", $listen_array);
} else {
$listen_array = $cache;
}
if (!empty($listen_array)) {
foreach ($listen_array as $k => $listen) {
if (!empty($listen)) {
Event::listenEvents($listen);
}
}
}
}
}

View File

@@ -1,142 +1,134 @@
<?php
/**
*/
namespace app\event\init;
use think\facade\Config;
/**
* 初始化配置信息
* @author Administrator
*
*/
class InitConfig
{
public function handle()
{
// 初始化常量
$this->initConst();
//初始化配置信息
$this->initConfig();
}
/**
* 初始化常量
*/
private function initConst()
{
//加载版本信息
define('SHOP_MODULE', 'shop');
defined('SYS_VERSION_NO') or define('SYS_VERSION_NO', Config::get('info.version')); //版本号
defined('SYS_VERSION_NAME') or define('SYS_VERSION_NAME', Config::get('info.title')); //版本名称
defined('SYS_VERSION') or define('SYS_VERSION', Config::get('info.name')); //版本类型
defined('SYS_RELEASE') or define('SYS_RELEASE', Config::get('info.version_no')); //版本号
//是否展示帮助快捷链接
define('HELP_SHOW', 1);
//加载基础化配置信息
define('__ROOT__', str_replace([ '/index.php', '/install.php' ], '', request()->root(true)));
define('__PUBLIC__', __ROOT__ . '/public');
define('__UPLOAD__', 'upload');
//插件目录名称
define('ADDON_DIR_NAME', 'addon');
//插件目录路径
define('ADDON_PATH', 'addon/');
//分页每页数量
define('PAGE_LIST_ROWS', 10);
define('MEMBER_LEVEL', 10);
//伪静态模式是否开启
define('REWRITE_MODULE', true);
// public目录绝对路径
define('PUBLIC_PATH', root_path() . '/public/');
// 项目绝对路径
define('ROOT_PATH', root_path());
//兼容模式访问
if (!REWRITE_MODULE) {
define('ROOT_URL', request()->root(true) . '/?s=');
} else {
define('ROOT_URL', request()->root(true));
}
//检测网址访问
$url = request()->url(true);
$url = strtolower($url);
if (strstr($url, 'call_user_func_array') || strstr($url, 'invokefunction') || strstr($url, 'think\view')) {
die("非法请求");
}
// 应用模块
$GLOBALS[ 'system_array' ] = [ 'shop', 'install', 'cron', 'api', 'pay', 'public', 'app', 'index', SHOP_MODULE ];
$GLOBALS[ 'app_array' ] = [ 'shop', 'store' ];
}
/**
* 初始化配置信息
*/
private function initConfig()
{
$view_array = [
// 模板引擎类型使用Think
'type' => 'Think',
// 默认模板渲染规则 1 解析为小写+下划线 2 全部转换小写 3 保持操作方法
'auto_rule' => 1,
// 模板目录名
'view_dir_name' => 'view',
// 模板后缀
'view_suffix' => 'html',
// 模板文件名分隔符
'view_depr' => DIRECTORY_SEPARATOR,
// 模板引擎普通标签开始标记
'tpl_begin' => '{',
// 模板引擎普通标签结束标记
'tpl_end' => '}',
// 标签库标签开始标记
'taglib_begin' => '{',
// 标签库标签结束标记
'taglib_end' => '}',
'tpl_cache' => false, //模板缓存部署模式后改为true
'tpl_replace_string' => [
'__ROOT__' => __ROOT__,
'__PUBLIC__' => __PUBLIC__,
'ROOT_URL' => ROOT_URL,
'__STATIC__' => __PUBLIC__ . '/static',
'STATIC_EXT' => __PUBLIC__ . '/static/ext',
'STATIC_CSS' => __PUBLIC__ . '/static/css',
'STATIC_JS' => __PUBLIC__ . '/static/js',
'STATIC_IMG' => __PUBLIC__ . '/static/img',
'HOME_IMG' => __ROOT__ . '/app/home/view/public/img',
'HOME_CSS' => __ROOT__ . '/app/home/view/public/css',
'HOME_JS' => __ROOT__ . '/app/home/view/public/js',
'SHOP_IMG' => __ROOT__ . '/app/shop/view/public/img',
'SHOP_CSS' => __ROOT__ . '/app/shop/view/public/css',
'PLATFORM_CSS' => __ROOT__ . '/app/platform/view/public/css',
'PLATFORM_JS' => __ROOT__ . '/app/platform/view/public/js',
'MERCHANT_CSS' => __ROOT__ . '/app/merchant/view/public/css',
'MERCHANT_JS' => __ROOT__ . '/app/merchant/view/public/js',
'SHOP_JS' => __ROOT__ . '/app/shop/view/public/js',
'__UPLOAD__' => __UPLOAD__,
'INDEX_IMG' => __ROOT__ . '/app/index/view/public/img',
'INDEX_CSS' => __ROOT__ . '/app/index/view/public/css',
'INDEX_JS' => __ROOT__ . '/app/index/view/public/js',
]
];
Config::set($view_array, 'view');
}
}
<?php
namespace app\event\init;
use think\facade\Config;
/**
* 初始化配置信息
* @author Administrator
*
*/
class InitConfig
{
public function handle()
{
// 初始化常量
$this->initConst();
//初始化配置信息
$this->initConfig();
}
/**
* 初始化常量
*/
private function initConst()
{
//加载版本信息
define('SHOP_MODULE', 'shop');
defined('SYS_VERSION_NO') or define('SYS_VERSION_NO', Config::get('info.version')); //版本号
defined('SYS_VERSION_NAME') or define('SYS_VERSION_NAME', Config::get('info.title')); //版本名称
defined('SYS_VERSION') or define('SYS_VERSION', Config::get('info.name')); //版本类型
defined('SYS_RELEASE') or define('SYS_RELEASE', Config::get('info.version_no')); //版本号
//是否展示帮助快捷链接
define('HELP_SHOW', 1);
//加载基础化配置信息
define('__ROOT__', str_replace([ '/index.php', '/install.php' ], '', request()->root(true)));
define('__PUBLIC__', __ROOT__ . '/public');
define('__UPLOAD__', 'upload');
//插件目录名称
define('ADDON_DIR_NAME', 'addon');
//插件目录路径
define('ADDON_PATH', 'addon/');
//分页每页数量
define('PAGE_LIST_ROWS', 10);
define('MEMBER_LEVEL', 10);
//伪静态模式是否开启
define('REWRITE_MODULE', true);
// public目录绝对路径
define('PUBLIC_PATH', root_path() . '/public/');
// 项目绝对路径
define('ROOT_PATH', root_path());
//兼容模式访问
if (!REWRITE_MODULE) {
define('ROOT_URL', request()->root(true) . '/?s=');
} else {
define('ROOT_URL', request()->root(true));
}
//检测网址访问
$url = request()->url(true);
$url = strtolower($url);
if (strstr($url, 'call_user_func_array') || strstr($url, 'invokefunction') || strstr($url, 'think\view')) {
die("非法请求");
}
// 应用模块
$GLOBALS[ 'system_array' ] = [ 'shop', 'install', 'cron', 'api', 'pay', 'public', 'app', 'index', SHOP_MODULE ];
$GLOBALS[ 'app_array' ] = [ 'shop', 'store' ];
}
/**
* 初始化配置信息
*/
private function initConfig()
{
$view_array = [
// 模板引擎类型使用Think
'type' => 'Think',
// 默认模板渲染规则 1 解析为小写+下划线 2 全部转换小写 3 保持操作方法
'auto_rule' => 1,
// 模板目录名
'view_dir_name' => 'view',
// 模板后缀
'view_suffix' => 'html',
// 模板文件名分隔符
'view_depr' => DIRECTORY_SEPARATOR,
// 模板引擎普通标签开始标记
'tpl_begin' => '{',
// 模板引擎普通标签结束标记
'tpl_end' => '}',
// 标签库标签开始标记
'taglib_begin' => '{',
// 标签库标签结束标记
'taglib_end' => '}',
'tpl_cache' => false, //模板缓存部署模式后改为true
'tpl_replace_string' => [
'__ROOT__' => __ROOT__,
'__PUBLIC__' => __PUBLIC__,
'ROOT_URL' => ROOT_URL,
'__STATIC__' => __PUBLIC__ . '/static',
'STATIC_EXT' => __PUBLIC__ . '/static/ext',
'STATIC_CSS' => __PUBLIC__ . '/static/css',
'STATIC_JS' => __PUBLIC__ . '/static/js',
'STATIC_IMG' => __PUBLIC__ . '/static/img',
'HOME_IMG' => __ROOT__ . '/app/home/view/public/img',
'HOME_CSS' => __ROOT__ . '/app/home/view/public/css',
'HOME_JS' => __ROOT__ . '/app/home/view/public/js',
'SHOP_IMG' => __ROOT__ . '/app/shop/view/public/img',
'SHOP_CSS' => __ROOT__ . '/app/shop/view/public/css',
'PLATFORM_CSS' => __ROOT__ . '/app/platform/view/public/css',
'PLATFORM_JS' => __ROOT__ . '/app/platform/view/public/js',
'MERCHANT_CSS' => __ROOT__ . '/app/merchant/view/public/css',
'MERCHANT_JS' => __ROOT__ . '/app/merchant/view/public/js',
'SHOP_JS' => __ROOT__ . '/app/shop/view/public/js',
'__UPLOAD__' => __UPLOAD__,
'INDEX_IMG' => __ROOT__ . '/app/index/view/public/img',
'INDEX_CSS' => __ROOT__ . '/app/index/view/public/css',
'INDEX_JS' => __ROOT__ . '/app/index/view/public/js',
]
];
Config::set($view_array, 'view');
}
}

View File

@@ -1,94 +1,85 @@
<?php
/**
*/
namespace app\event\init;
use app\dict\system\ScheduleDict;
use app\model\system\Cron;
use think\facade\Cache;
/**
* 初始化计划任务启动
* @author Administrator
*
*/
class InitCron
{
public function handle()
{
log_write('InitCron计划任务初始化', 'debug');
try {
//根据计划任务类型来判断
if (config('cron.default') != ScheduleDict::default) {
log_write('InitCron计划任务未开启', 'warning');
return;
}
if (defined('BIND_MODULE') && BIND_MODULE === 'install') {
log_write('InitCron计划任务未开启安装模块时不执行计划任务', 'warning');
return;
}
$last_time = Cache::get("cron_last_load_time");
if (empty($last_time)) {
$last_time = 0;
}
$last_exec_time = Cache::get("cron_http_last_exec_time");
if (empty($last_exec_time)) {
$last_exec_time = 0;
}
$module = request()->module();
if ($module == 'cron') {
log_write('InitCron计划任务未开启, 请求模块是 cron 模块', 'warning');
return;
}
$enable_start = !defined('CRON_EXECUTE') && time() - $last_time > 100 && time() - $last_exec_time > 100;
if (!$enable_start) {
$content = sprintf('InitCron计划任务未启动[%s, %s, %s], cron_last_load_time: %s, cron_http_last_exec_time: %s, CRON_EXECUTE%s',
!defined('CRON_EXECUTE') ? '1' : '0',
time() - $last_time > 100 ? '1' : '0',
time() - $last_exec_time > 100 ? '1' : '0',
date('Y-m-d H:i:s', $last_time),
date('Y-m-d H:i:s', $last_exec_time),
defined('CRON_EXECUTE') ? 'true' : 'false'
);
log_write($content, 'debug');
return;
}
Cache::set("cron_http_last_exec_time", time());
defined('CRON_EXECUTE') or define('CRON_EXECUTE', 1);
$url = url('cron/task/cronExecute');
$ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HEADER, true);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_TIMEOUT, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
curl_exec($ch);
// 获取错误信息并打印
$error = curl_error($ch);
if ($error) {
//保存错误
Cron::setError(ScheduleDict::default, $error);
}
// 关闭cURL资源句柄
curl_close($ch);
log_write('InitCron计划任务已启动', 'debug');
} catch (\Exception $e) {
// 计划任务异常,直接返回
log_write('InitCron计划任务异常' . $e->getMessage(), 'error');
return;
}
}
}
<?php
namespace app\event\init;
use app\dict\system\ScheduleDict;
use app\model\system\Cron;
use think\facade\Cache;
/**
* 初始化计划任务启动
* @author Administrator
*
*/
class InitCron
{
public function handle()
{
log_write('InitCron计划任务初始化', 'debug');
try {
//根据计划任务类型来判断
if (config('cron.default') != ScheduleDict::default) {
log_write('InitCron计划任务未开启', 'warning');
return;
}
if (defined('BIND_MODULE') && BIND_MODULE === 'install') {
log_write('InitCron计划任务未开启安装模块时不执行计划任务', 'warning');
return;
}
$last_time = Cache::get("cron_last_load_time");
if (empty($last_time)) {
$last_time = 0;
}
$last_exec_time = Cache::get("cron_http_last_exec_time");
if (empty($last_exec_time)) {
$last_exec_time = 0;
}
$module = request()->module();
if ($module == 'cron') {
log_write('InitCron计划任务未开启, 请求模块是 cron 模块', 'warning');
return;
}
$enable_start = !defined('CRON_EXECUTE') && time() - $last_time > 100 && time() - $last_exec_time > 100;
if (!$enable_start) {
$content = sprintf('InitCron计划任务未启动[%s, %s, %s], cron_last_load_time: %s, cron_http_last_exec_time: %s, CRON_EXECUTE%s',
!defined('CRON_EXECUTE') ? '1' : '0',
time() - $last_time > 100 ? '1' : '0',
time() - $last_exec_time > 100 ? '1' : '0',
date('Y-m-d H:i:s', $last_time),
date('Y-m-d H:i:s', $last_exec_time),
defined('CRON_EXECUTE') ? 'true' : 'false'
);
log_write($content, 'debug');
return;
}
Cache::set("cron_http_last_exec_time", time());
defined('CRON_EXECUTE') or define('CRON_EXECUTE', 1);
$url = url('cron/task/cronExecute');
$ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HEADER, true);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_TIMEOUT, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
curl_exec($ch);
// 获取错误信息并打印
$error = curl_error($ch);
if ($error) {
//保存错误
Cron::setError(ScheduleDict::default, $error);
}
// 关闭cURL资源句柄
curl_close($ch);
log_write('InitCron计划任务已启动', 'debug');
} catch (\Exception $e) {
// 计划任务异常,直接返回
log_write('InitCron计划任务异常' . $e->getMessage(), 'error');
return;
}
}
}

View File

@@ -1,84 +1,76 @@
<?php
/**
*/
namespace app\event\member;
use addon\coupon\model\Coupon;
use app\model\member\MemberAccount;
use app\model\member\MemberLevel;
/**
* 会员账户变化引起会员相关等级变化
*/
class AddMemberAccount
{
// 行为扩展的执行入口必须是run
public function handle($data)
{
$member_account_model = new MemberAccount();
model('member_account')->startTrans();
try {
if ($data[ 'account_type' ] == 'growth') {
//成长值变化等级检测变化
$member_info = model('member')->getInfo([ [ 'member_id', '=', $data[ 'member_id' ] ] ], 'growth,member_level,member_level_type,nickname');
//查询会员等级
$member_level = new MemberLevel();
$level_list = $member_level->getMemberLevelList([ [ 'growth', '<=', $member_info[ 'growth' ] ], [ 'level_type', '=', 0 ], [ 'site_id', '=', $data[ 'site_id' ] ], [ 'status', '=', 1 ] ], 'level_id, level_name, sort, growth, send_point, send_balance, send_coupon', 'growth desc');
$level_detail = [];
if ($member_info[ 'member_level_type' ] == 0 && !empty($level_list[ 'data' ])) {
//检测升级
if ($member_info[ 'member_level' ] == 0) {
//将用户设置为最大等级
$level_detail = $level_list[ 'data' ][ 0 ];
} else {
$level_info = $member_level->getMemberLevelInfo([ [ 'level_id', '=', $member_info[ 'member_level' ] ] ]);
if (empty($level_info[ 'data' ])) {
$level_detail = $level_list[ 'data' ][ 0 ];
} else {
if ($level_info[ 'data' ][ 'growth' ] < $level_list[ 'data' ][ 0 ][ 'growth' ]) {
$level_detail = $level_list[ 'data' ][ 0 ];
}
}
}
}
// 如果存在已升级等级 发放升级奖励
if (!empty($level_detail)) {
// 添加会员卡变更记录
$member_level->addMemberLevelChangeRecord($data[ 'member_id' ], $data[ 'site_id' ], $level_detail[ 'level_id' ], 0, 'upgrade', $data[ 'member_id' ], 'member', $member_info[ 'nickname' ]);
if ($level_detail[ 'send_balance' ] > 0) {
//赠送红包
$balance = $level_detail[ 'send_balance' ];
$member_account_model->addMemberAccount($data[ 'site_id' ], $data[ 'member_id' ], 'balance', $balance, 'upgrade', '会员升级得红包' . $balance, '会员等级升级奖励');
}
if ($level_detail[ 'send_point' ] > 0) {
//赠送积分
$send_point = $level_detail[ 'send_point' ];
$member_account_model->addMemberAccount($data[ 'site_id' ], $data[ 'member_id' ], 'point', $send_point, 'upgrade', '会员升级得积分' . $send_point, '会员等级升级奖励');
}
//给用户发放优惠券
$coupon_model = new Coupon();
$coupon_array = empty($level_detail[ 'send_coupon' ]) ? [] : explode(',', $level_detail[ 'send_coupon' ]);
if (!empty($coupon_array)) {
foreach ($coupon_array as $k => $v) {
$coupon_model->receiveCoupon($v, $data[ 'site_id' ], $data[ 'member_id' ], 3);
}
}
}
}
model('member_account')->commit();
return $member_account_model->success();
} catch (\Exception $e) {
model('member_account')->rollback();
return $member_account_model->error('', $e->getMessage());
}
}
<?php
namespace app\event\member;
use addon\coupon\model\Coupon;
use app\model\member\MemberAccount;
use app\model\member\MemberLevel;
/**
* 会员账户变化引起会员相关等级变化
*/
class AddMemberAccount
{
// 行为扩展的执行入口必须是run
public function handle($data)
{
$member_account_model = new MemberAccount();
model('member_account')->startTrans();
try {
if ($data[ 'account_type' ] == 'growth') {
//成长值变化等级检测变化
$member_info = model('member')->getInfo([ [ 'member_id', '=', $data[ 'member_id' ] ] ], 'growth,member_level,member_level_type,nickname');
//查询会员等级
$member_level = new MemberLevel();
$level_list = $member_level->getMemberLevelList([ [ 'growth', '<=', $member_info[ 'growth' ] ], [ 'level_type', '=', 0 ], [ 'site_id', '=', $data[ 'site_id' ] ], [ 'status', '=', 1 ] ], 'level_id, level_name, sort, growth, send_point, send_balance, send_coupon', 'growth desc');
$level_detail = [];
if ($member_info[ 'member_level_type' ] == 0 && !empty($level_list[ 'data' ])) {
//检测升级
if ($member_info[ 'member_level' ] == 0) {
//将用户设置为最大等级
$level_detail = $level_list[ 'data' ][ 0 ];
} else {
$level_info = $member_level->getMemberLevelInfo([ [ 'level_id', '=', $member_info[ 'member_level' ] ] ]);
if (empty($level_info[ 'data' ])) {
$level_detail = $level_list[ 'data' ][ 0 ];
} else {
if ($level_info[ 'data' ][ 'growth' ] < $level_list[ 'data' ][ 0 ][ 'growth' ]) {
$level_detail = $level_list[ 'data' ][ 0 ];
}
}
}
}
// 如果存在已升级等级 发放升级奖励
if (!empty($level_detail)) {
// 添加会员卡变更记录
$member_level->addMemberLevelChangeRecord($data[ 'member_id' ], $data[ 'site_id' ], $level_detail[ 'level_id' ], 0, 'upgrade', $data[ 'member_id' ], 'member', $member_info[ 'nickname' ]);
if ($level_detail[ 'send_balance' ] > 0) {
//赠送红包
$balance = $level_detail[ 'send_balance' ];
$member_account_model->addMemberAccount($data[ 'site_id' ], $data[ 'member_id' ], 'balance', $balance, 'upgrade', '会员升级得红包' . $balance, '会员等级升级奖励');
}
if ($level_detail[ 'send_point' ] > 0) {
//赠送积分
$send_point = $level_detail[ 'send_point' ];
$member_account_model->addMemberAccount($data[ 'site_id' ], $data[ 'member_id' ], 'point', $send_point, 'upgrade', '会员升级得积分' . $send_point, '会员等级升级奖励');
}
//给用户发放优惠券
$coupon_model = new Coupon();
$coupon_array = empty($level_detail[ 'send_coupon' ]) ? [] : explode(',', $level_detail[ 'send_coupon' ]);
if (!empty($coupon_array)) {
foreach ($coupon_array as $k => $v) {
$coupon_model->receiveCoupon($v, $data[ 'site_id' ], $data[ 'member_id' ], 3);
}
}
}
}
model('member_account')->commit();
return $member_account_model->success();
} catch (\Exception $e) {
model('member_account')->rollback();
return $member_account_model->error('', $e->getMessage());
}
}
}

View File

@@ -1,27 +1,19 @@
<?php
/**
*/
namespace app\event\member;
use app\model\member\MemberCluster as MemberClusterModel;
/**
* 刷新会员群体会员信息(计划任务)
*/
class CronMemberClusterRefresh
{
// 行为扩展的执行入口必须是run
public function handle()
{
// $member_cluster_model = new MemberClusterModel();
// $result = $member_cluster_model->refreshMemberCluster();//会员群体定时刷新
// return $result;
}
<?php
namespace app\event\member;
use app\model\member\MemberCluster as MemberClusterModel;
/**
* 刷新会员群体会员信息(计划任务)
*/
class CronMemberClusterRefresh
{
// 行为扩展的执行入口必须是run
public function handle()
{
// $member_cluster_model = new MemberClusterModel();
// $result = $member_cluster_model->refreshMemberCluster();//会员群体定时刷新
// return $result;
}
}

View File

@@ -1,84 +1,76 @@
<?php
/**
*/
namespace app\event\member;
use addon\coupon\model\Coupon as CouponModel;
use app\Controller;
use app\model\member\MemberAccount as MemberAccountModel;
/**
* 会员详情账号明细
*/
class MemberDetail extends Controller
{
public function handle($param)
{
$this->assign("member_id", $param[ 'member_id' ]);
if ($param[ 'type' ] == 'account') {
// 账户余额、积分、成长值
$this->assign("account_type", $param[ 'account_type' ]);
$id = $param[ 'account_type' ];
if ($param[ 'account_type' ] == 'balance,balance_money') {
$id = 'balance';
}
$this->assign('table_id', $id);
//账户类型和来源类型
$member_account_model = new MemberAccountModel();
$account_type_arr = $member_account_model->getAccountType();
$from_type_arr = $member_account_model->getFromType();
$this->assign('account_type_arr', $account_type_arr);
$this->assign('from_type_arr', $from_type_arr[ $param[ 'account_type' ] ] ?? []);
$template = 'app/shop/view/member/account_detail.html';
return $this->fetch($template);
} elseif ($param[ 'type' ] == 'order') {
// 订单列表
$template = 'app/shop/view/member/order.html';
return $this->fetch($template);
} elseif ($param[ 'type' ] == 'address_detail') {
// 收货地址
$template = 'app/shop/view/member/address_detail.html';
return $this->fetch($template);
} elseif ($param[ 'type' ] == 'member_goods_collect') {
// 收藏记录
$template = 'app/shop/view/goods/member_goods_collect.html';
return $this->fetch($template);
} elseif ($param[ 'type' ] == 'member_goods_browse') {
// 浏览记录
$template = 'app/shop/view/goods/member_goods_browse.html';
return $this->fetch($template);
} elseif ($param[ 'type' ] == 'member_coupon') {
// 优惠券
$coupon_model = new CouponModel();
$this->assign('get_type', $coupon_model->getCouponGetType());
$template = 'app/shop/view/member/member_coupon.html';
return $this->fetch($template);
}
}
<?php
namespace app\event\member;
use addon\coupon\model\Coupon as CouponModel;
use app\Controller;
use app\model\member\MemberAccount as MemberAccountModel;
/**
* 会员详情账号明细
*/
class MemberDetail extends Controller
{
public function handle($param)
{
$this->assign("member_id", $param[ 'member_id' ]);
if ($param[ 'type' ] == 'account') {
// 账户余额、积分、成长值
$this->assign("account_type", $param[ 'account_type' ]);
$id = $param[ 'account_type' ];
if ($param[ 'account_type' ] == 'balance,balance_money') {
$id = 'balance';
}
$this->assign('table_id', $id);
//账户类型和来源类型
$member_account_model = new MemberAccountModel();
$account_type_arr = $member_account_model->getAccountType();
$from_type_arr = $member_account_model->getFromType();
$this->assign('account_type_arr', $account_type_arr);
$this->assign('from_type_arr', $from_type_arr[ $param[ 'account_type' ] ] ?? []);
$template = 'app/shop/view/member/account_detail.html';
return $this->fetch($template);
} elseif ($param[ 'type' ] == 'order') {
// 订单列表
$template = 'app/shop/view/member/order.html';
return $this->fetch($template);
} elseif ($param[ 'type' ] == 'address_detail') {
// 收货地址
$template = 'app/shop/view/member/address_detail.html';
return $this->fetch($template);
} elseif ($param[ 'type' ] == 'member_goods_collect') {
// 收藏记录
$template = 'app/shop/view/goods/member_goods_collect.html';
return $this->fetch($template);
} elseif ($param[ 'type' ] == 'member_goods_browse') {
// 浏览记录
$template = 'app/shop/view/goods/member_goods_browse.html';
return $this->fetch($template);
} elseif ($param[ 'type' ] == 'member_coupon') {
// 优惠券
$coupon_model = new CouponModel();
$this->assign('get_type', $coupon_model->getCouponGetType());
$template = 'app/shop/view/member/member_coupon.html';
return $this->fetch($template);
}
}
}

View File

@@ -1,29 +1,20 @@
<?php
/**
*/
namespace app\event\member;
use app\model\message\Message;
/**
* 登录成功发送通知
*/
class MemberLogin
{
public function handle($param)
{
// 发送通知
$message_model = new Message();
$message_model->sendMessage(["keywords" => "LOGIN", "member_id" => $param["member_id"], "site_id" => $param["site_id"]]);
}
<?php
namespace app\event\member;
use app\model\message\Message;
/**
* 登录成功发送通知
*/
class MemberLogin
{
public function handle($param)
{
// 发送通知
$message_model = new Message();
$message_model->sendMessage(["keywords" => "LOGIN", "member_id" => $param["member_id"], "site_id" => $param["site_id"]]);
}
}

View File

@@ -1,32 +1,24 @@
<?php
/**
*/
namespace app\event\message;
use app\model\member\MemberAccount;
/**
* 会员账户变动通知通知
*/
class MessageAccountChangeNotice
{
/**
* @param $param
* @return void|null
*/
public function handle($param)
{
if ($param[ "keywords" ] == "USER_BALANCE_CHANGE_NOTICE") {
$model = new MemberAccount();
return $model->messageAccountChangeNotice($param);
}
}
<?php
namespace app\event\message;
use app\model\member\MemberAccount;
/**
* 会员账户变动通知通知
*/
class MessageAccountChangeNotice
{
/**
* @param $param
* @return void|null
*/
public function handle($param)
{
if ($param[ "keywords" ] == "USER_BALANCE_CHANGE_NOTICE") {
$model = new MemberAccount();
return $model->messageAccountChangeNotice($param);
}
}
}

View File

@@ -1,31 +1,23 @@
<?php
/**
*/
namespace app\event\message;
use app\model\member\Member;
/**
* 绑定发送验证码
*/
class MessageBindCode
{
public function handle($param)
{
//发送订单消息
if ($param[ "keywords" ] == "MEMBER_BIND") {
$member_model = new Member();
$result = $member_model->bindCode($param);
return $result;
}
}
<?php
namespace app\event\message;
use app\model\member\Member;
/**
* 绑定发送验证码
*/
class MessageBindCode
{
public function handle($param)
{
//发送订单消息
if ($param[ "keywords" ] == "MEMBER_BIND") {
$member_model = new Member();
$result = $member_model->bindCode($param);
return $result;
}
}
}

View File

@@ -1,32 +1,24 @@
<?php
/**
*/
namespace app\event\message;
use app\model\order\OrderMessage;
/**
* 买家支付成功通知商家
*/
class MessageBuyerPaySuccess
{
/**
* @param $param
* @return array|mixed|void
*/
public function handle($param)
{
//发送订单消息
if ($param[ "keywords" ] == "BUYER_PAY") {
$model = new OrderMessage();
return $model->messageBuyerPaySuccess($param);
}
}
<?php
namespace app\event\message;
use app\model\order\OrderMessage;
/**
* 买家支付成功通知商家
*/
class MessageBuyerPaySuccess
{
/**
* @param $param
* @return array|mixed|void
*/
public function handle($param)
{
//发送订单消息
if ($param[ "keywords" ] == "BUYER_PAY") {
$model = new OrderMessage();
return $model->messageBuyerPaySuccess($param);
}
}
}

View File

@@ -1,32 +1,24 @@
<?php
/**
*/
namespace app\event\message;
use addon\membercancel\model\MemberCancel;
/**
* 会员注销申请通知
*/
class MessageCancelApply
{
/**
* @param $param
* @return array
*/
public function handle($param)
{
if ($param[ "keywords" ] == "USER_CANCEL_APPLY") {
$model = new MemberCancel();
return $model->memberCancelApply($param);
}
}
<?php
namespace app\event\message;
use addon\membercancel\model\MemberCancel;
/**
* 会员注销申请通知
*/
class MessageCancelApply
{
/**
* @param $param
* @return array
*/
public function handle($param)
{
if ($param[ "keywords" ] == "USER_CANCEL_APPLY") {
$model = new MemberCancel();
return $model->memberCancelApply($param);
}
}
}

View File

@@ -1,32 +1,24 @@
<?php
/**
*/
namespace app\event\message;
use addon\membercancel\model\MemberCancel;
/**
* 会员注销失败通知
*/
class MessageCancelFail
{
/**
* @param $param
* @return array
*/
public function handle($param)
{
if ($param[ "keywords" ] == "USER_CANCEL_FAIL") {
$model = new MemberCancel();
return $model->memberCancelFail($param);
}
}
<?php
namespace app\event\message;
use addon\membercancel\model\MemberCancel;
/**
* 会员注销失败通知
*/
class MessageCancelFail
{
/**
* @param $param
* @return array
*/
public function handle($param)
{
if ($param[ "keywords" ] == "USER_CANCEL_FAIL") {
$model = new MemberCancel();
return $model->memberCancelFail($param);
}
}
}

View File

@@ -1,33 +1,25 @@
<?php
/**
*/
namespace app\event\message;
use addon\membercancel\model\MemberCancel;
/**
* 会员注销成功通知
*/
class MessageCancelSuccess
{
/**
* @param $param
* @return array
*/
public function handle($param)
{
//发送订单消息
if ($param[ "keywords" ] == "USER_CANCEL_SUCCESS") {
$model = new MemberCancel();
return $model->memberCancelSuccess($param);
}
}
<?php
namespace app\event\message;
use addon\membercancel\model\MemberCancel;
/**
* 会员注销成功通知
*/
class MessageCancelSuccess
{
/**
* @param $param
* @return array
*/
public function handle($param)
{
//发送订单消息
if ($param[ "keywords" ] == "USER_CANCEL_SUCCESS") {
$model = new MemberCancel();
return $model->memberCancelSuccess($param);
}
}
}

View File

@@ -1,30 +1,22 @@
<?php
/**
*/
namespace app\event\message;
use app\model\member\Member;
/**
* 收银台会员验证验证码
*/
class MessageCashierMemberVerifyCode
{
public function handle($param)
{
//发送订单消息
if ($param[ "keywords" ] == "CASHIER_MEMBER_VERIFY_CODE") {
$result = ( new Member() )->bindCode($param);
return $result;
}
}
<?php
namespace app\event\message;
use app\model\member\Member;
/**
* 收银台会员验证验证码
*/
class MessageCashierMemberVerifyCode
{
public function handle($param)
{
//发送订单消息
if ($param[ "keywords" ] == "CASHIER_MEMBER_VERIFY_CODE") {
$result = ( new Member() )->bindCode($param);
return $result;
}
}
}

View File

@@ -1,35 +1,27 @@
<?php
/**
*/
namespace app\event\message;
use addon\fenxiao\model\FenxiaoWithdraw;
use GuzzleHttp\Exception\GuzzleException;
/**
* 分销提现申请发送消息
*/
class MessageFenxiaoWithdrawalApply
{
/**
* @param $param
* @return void|null
* @throws GuzzleException
*/
public function handle($param)
{
//发送订单消息
if ($param[ "keywords" ] == "FENXIAO_WITHDRAWAL_APPLY") {
$model = new FenxiaoWithdraw();
return $model->messageFenxiaoWithdrawalApply($param);
}
}
<?php
namespace app\event\message;
use addon\fenxiao\model\FenxiaoWithdraw;
use GuzzleHttp\Exception\GuzzleException;
/**
* 分销提现申请发送消息
*/
class MessageFenxiaoWithdrawalApply
{
/**
* @param $param
* @return void|null
* @throws GuzzleException
*/
public function handle($param)
{
//发送订单消息
if ($param[ "keywords" ] == "FENXIAO_WITHDRAWAL_APPLY") {
$model = new FenxiaoWithdraw();
return $model->messageFenxiaoWithdrawalApply($param);
}
}
}

View File

@@ -1,35 +1,27 @@
<?php
/**
*/
namespace app\event\message;
use addon\fenxiao\model\FenxiaoWithdraw;
use GuzzleHttp\Exception\GuzzleException;
/**
* 分销提现失败发送消息
*/
class MessageFenxiaoWithdrawalError
{
/**
* @param $param
* @return void|null
* @throws GuzzleException
*/
public function handle($param)
{
//发送订单消息
if ($param[ "keywords" ] == "FENXIAO_WITHDRAWAL_ERROR") {
$model = new FenxiaoWithdraw();
return $model->messageFenxiaoWithdrawalError($param);
}
}
<?php
namespace app\event\message;
use addon\fenxiao\model\FenxiaoWithdraw;
use GuzzleHttp\Exception\GuzzleException;
/**
* 分销提现失败发送消息
*/
class MessageFenxiaoWithdrawalError
{
/**
* @param $param
* @return void|null
* @throws GuzzleException
*/
public function handle($param)
{
//发送订单消息
if ($param[ "keywords" ] == "FENXIAO_WITHDRAWAL_ERROR") {
$model = new FenxiaoWithdraw();
return $model->messageFenxiaoWithdrawalError($param);
}
}
}

View File

@@ -1,35 +1,27 @@
<?php
/**
*/
namespace app\event\message;
use addon\fenxiao\model\FenxiaoWithdraw;
use GuzzleHttp\Exception\GuzzleException;
/**
* 分销提现成功发送消息
*/
class MessageFenxiaoWithdrawalSuccess
{
/**
* @param $param
* @return void|null
* @throws GuzzleException
*/
public function handle($param)
{
//发送订单消息
if ($param[ "keywords" ] == "FENXIAO_WITHDRAWAL_SUCCESS") {
$model = new FenxiaoWithdraw();
return $model->messageFenxiaoWithdrawalSuccess($param);
}
}
<?php
namespace app\event\message;
use addon\fenxiao\model\FenxiaoWithdraw;
use GuzzleHttp\Exception\GuzzleException;
/**
* 分销提现成功发送消息
*/
class MessageFenxiaoWithdrawalSuccess
{
/**
* @param $param
* @return void|null
* @throws GuzzleException
*/
public function handle($param)
{
//发送订单消息
if ($param[ "keywords" ] == "FENXIAO_WITHDRAWAL_SUCCESS") {
$model = new FenxiaoWithdraw();
return $model->messageFenxiaoWithdrawalSuccess($param);
}
}
}

View File

@@ -1,30 +1,22 @@
<?php
/**
*/
namespace app\event\message;
use app\model\member\Member;
/**
* 找回密码发送验证码
*/
class MessageFindCode
{
public function handle($param)
{
if ($param[ "keywords" ] == "FIND_PASSWORD") {
$member_model = new Member();
$result = $member_model->findCode($param);
return $result;
}
}
<?php
namespace app\event\message;
use app\model\member\Member;
/**
* 找回密码发送验证码
*/
class MessageFindCode
{
public function handle($param)
{
if ($param[ "keywords" ] == "FIND_PASSWORD") {
$member_model = new Member();
$result = $member_model->findCode($param);
return $result;
}
}
}

View File

@@ -0,0 +1,24 @@
<?php
namespace app\event\message;
use app\model\order\OrderMessage;
/**
* 外卖订单 指定配送员后 同步短信推送
*/
class MessageLocalWaitDelivery
{
public function handle($param)
{
//发送订单消息
if ($param["keywords"] == "MESSAGE_LOCAL_WAIT_DELIVERY") {
$model = new OrderMessage();
return $model->messageLocalWaitDelivery($param);
}
}
}

View File

@@ -1,31 +1,23 @@
<?php
/**
*/
namespace app\event\message;
use app\model\member\Login;
/**
* 登录成功发送通知
*/
class MessageLogin
{
public function handle($param)
{
//发送订单消息
if ($param[ "keywords" ] == "LOGIN") {
$login_model = new Login();
$result = $login_model->loginSuccess($param);
return $result;
}
}
<?php
namespace app\event\message;
use app\model\member\Login;
/**
* 登录成功发送通知
*/
class MessageLogin
{
public function handle($param)
{
//发送订单消息
if ($param[ "keywords" ] == "LOGIN") {
$login_model = new Login();
$result = $login_model->loginSuccess($param);
return $result;
}
}
}

View File

@@ -1,32 +1,23 @@
<?php
/**
*/
namespace app\event\message;
use app\model\member\Login;
/**
* 登录发送验证码
*/
class MessageLoginCode
{
public function handle($param)
{
//发送订单消息
if ($param["keywords"] == "LOGIN_CODE") {
$login_model = new Login();
$result = $login_model->loginCode($param);
return $result;
}
}
<?php
namespace app\event\message;
use app\model\member\Login;
/**
* 登录发送验证码
*/
class MessageLoginCode
{
public function handle($param)
{
//发送订单消息
if ($param["keywords"] == "LOGIN_CODE") {
$login_model = new Login();
$result = $login_model->loginCode($param);
return $result;
}
}
}

View File

@@ -1,32 +1,23 @@
<?php
/**
*/
namespace app\event\message;
use app\model\member\Member;
/**
* 登录成功发送通知
*/
class MessageMemberPayPassword
{
public function handle($param)
{
//发送订单消息
if ($param["keywords"] == "MEMBER_PAY_PASSWORD") {
$member_model = new Member();
$result = $member_model->paypasswordCode($param);
return $result;
}
}
<?php
namespace app\event\message;
use app\model\member\Member;
/**
* 登录成功发送通知
*/
class MessageMemberPayPassword
{
public function handle($param)
{
//发送订单消息
if ($param["keywords"] == "MEMBER_PAY_PASSWORD") {
$member_model = new Member();
$result = $member_model->paypasswordCode($param);
return $result;
}
}
}

View File

@@ -1,37 +1,28 @@
<?php
/**
*/
namespace app\event\message;
use app\model\order\OrderMessage;
use GuzzleHttp\Exception\GuzzleException;
/**
* 订单关闭发送消息
*/
class MessageOrderClose
{
/**
* @param $param
* @return void|null
* @throws GuzzleException
*/
public function handle($param)
{
//发送订单消息
if ($param["keywords"] == "ORDER_CLOSE") {
//发送订单消息
$model = new OrderMessage();
return $model->messageOrderClose($param);
}
}
<?php
namespace app\event\message;
use app\model\order\OrderMessage;
use GuzzleHttp\Exception\GuzzleException;
/**
* 订单关闭发送消息
*/
class MessageOrderClose
{
/**
* @param $param
* @return void|null
* @throws GuzzleException
*/
public function handle($param)
{
//发送订单消息
if ($param["keywords"] == "ORDER_CLOSE") {
//发送订单消息
$model = new OrderMessage();
return $model->messageOrderClose($param);
}
}
}

View File

@@ -1,36 +1,27 @@
<?php
/**
*/
namespace app\event\message;
use app\model\order\OrderMessage;
use GuzzleHttp\Exception\GuzzleException;
/**
* 订单关闭发送消息
*/
class MessageOrderComplete
{
/**
* @param $param
* @return void|null
* @throws GuzzleException
*/
public function handle($param)
{
// 发送订单消息
if ($param["keywords"] == "ORDER_COMPLETE") {
$model = new OrderMessage();
return $model->messageOrderComplete($param);
}
}
<?php
namespace app\event\message;
use app\model\order\OrderMessage;
use GuzzleHttp\Exception\GuzzleException;
/**
* 订单关闭发送消息
*/
class MessageOrderComplete
{
/**
* @param $param
* @return void|null
* @throws GuzzleException
*/
public function handle($param)
{
// 发送订单消息
if ($param["keywords"] == "ORDER_COMPLETE") {
$model = new OrderMessage();
return $model->messageOrderComplete($param);
}
}
}

View File

@@ -1,36 +1,27 @@
<?php
/**
*/
namespace app\event\message;
use app\model\order\OrderMessage;
use GuzzleHttp\Exception\GuzzleException;
/**
* 订单发货发送消息
*/
class MessageOrderDelivery
{
/**
* @param $param
* @return void|null
* @throws GuzzleException
*/
public function handle($param)
{
// 发送订单消息
if ($param["keywords"] == "ORDER_DELIVERY") {
$model = new OrderMessage();
return $model->messageOrderDelivery($param);
}
}
<?php
namespace app\event\message;
use app\model\order\OrderMessage;
use GuzzleHttp\Exception\GuzzleException;
/**
* 订单发货发送消息
*/
class MessageOrderDelivery
{
/**
* @param $param
* @return void|null
* @throws GuzzleException
*/
public function handle($param)
{
// 发送订单消息
if ($param["keywords"] == "ORDER_DELIVERY") {
$model = new OrderMessage();
return $model->messageOrderDelivery($param);
}
}
}

View File

@@ -1,34 +1,25 @@
<?php
/**
*/
namespace app\event\message;
use app\model\order\OrderMessage;
/**
* 订单创建发送消息
*/
class MessageOrderPaySuccess
{
/**
* @param $param
* @return array|mixed|void
*/
public function handle($param)
{
trace($param, '订单创建发送消息event'.json_encode($param));
//发送订单消息
if ($param["keywords"] == "ORDER_PAY") {
$model = new OrderMessage();
$model->messagePaySuccess($param);
}
}
<?php
namespace app\event\message;
use app\model\order\OrderMessage;
/**
* 订单创建发送消息
*/
class MessageOrderPaySuccess
{
/**
* @param $param
* @return array|mixed|void
*/
public function handle($param)
{
trace($param, '订单创建发送消息event'.json_encode($param));
//发送订单消息
if ($param["keywords"] == "ORDER_PAY") {
$model = new OrderMessage();
$model->messagePaySuccess($param);
}
}
}

View File

@@ -1,33 +1,24 @@
<?php
/**
*/
namespace app\event\message;
use app\model\order\OrderMessage;
use GuzzleHttp\Exception\GuzzleException;
class MessageOrderRefundApply
{
/**
* @param $param
* @return void|null
* @throws GuzzleException
*/
public function handle($param)
{
// 发送订单消息
if ($param["keywords"] == "BUYER_REFUND") {
$model = new OrderMessage();
return $model->messageOrderRefundApply($param);
}
}
<?php
namespace app\event\message;
use app\model\order\OrderMessage;
use GuzzleHttp\Exception\GuzzleException;
class MessageOrderRefundApply
{
/**
* @param $param
* @return void|null
* @throws GuzzleException
*/
public function handle($param)
{
// 发送订单消息
if ($param["keywords"] == "BUYER_REFUND") {
$model = new OrderMessage();
return $model->messageOrderRefundApply($param);
}
}
}

View File

@@ -1,32 +1,24 @@
<?php
/**
*/
namespace app\event\message;
use app\model\order\OrderMessage;
use GuzzleHttp\Exception\GuzzleException;
class MessageOrderRefundDelivery
{
/**
* @param $param
* @return void|null
* @throws GuzzleException
*/
public function handle($param)
{
// 发送订单消息
if ($param[ "keywords" ] == "BUYER_DELIVERY_REFUND") {
$model = new OrderMessage();
return $model->messageOrderRefundDelivery($param);
}
}
<?php
namespace app\event\message;
use app\model\order\OrderMessage;
use GuzzleHttp\Exception\GuzzleException;
class MessageOrderRefundDelivery
{
/**
* @param $param
* @return void|null
* @throws GuzzleException
*/
public function handle($param)
{
// 发送订单消息
if ($param[ "keywords" ] == "BUYER_DELIVERY_REFUND") {
$model = new OrderMessage();
return $model->messageOrderRefundDelivery($param);
}
}
}

View File

@@ -1,31 +1,23 @@
<?php
/**
*/
namespace app\event\message;
use app\model\member\Member;
/**
* 绑定发送验证码
*/
class MessagePayPasswordCode
{
public function handle($param)
{
//发送订单消息
if ($param[ "keywords" ] == "MEMBER_PAY_PASSWORD") {
$member_model = new Member();
$result = $member_model->paypasswordCode($param);
return $result;
}
}
<?php
namespace app\event\message;
use app\model\member\Member;
/**
* 绑定发送验证码
*/
class MessagePayPasswordCode
{
public function handle($param)
{
//发送订单消息
if ($param[ "keywords" ] == "MEMBER_PAY_PASSWORD") {
$member_model = new Member();
$result = $member_model->paypasswordCode($param);
return $result;
}
}
}

View File

@@ -1,35 +1,27 @@
<?php
/**
*/
namespace app\event\message;
use app\model\member\Register;
/**
* 注册发送验证码
*/
class MessageRegisterCode
{
/**
* @param $param
* @return array|mixed|void
*/
public function handle($param)
{
//发送订单消息
if ($param[ "keywords" ] == "REGISTER_CODE") {
$register_model = new Register();
$result = $register_model->registerCode($param);
return $result;
}
}
<?php
namespace app\event\message;
use app\model\member\Register;
/**
* 注册发送验证码
*/
class MessageRegisterCode
{
/**
* @param $param
* @return array|mixed|void
*/
public function handle($param)
{
//发送订单消息
if ($param[ "keywords" ] == "REGISTER_CODE") {
$register_model = new Register();
$result = $register_model->registerCode($param);
return $result;
}
}
}

View File

@@ -1,41 +1,33 @@
<?php
/**
*/
/**
*/
namespace app\event\message;
use app\model\member\Member;
/**
* 设置密码
*/
class MessageSetPassWord
{
public function handle($param)
{
//发送订单消息
if ($param[ "keywords" ] == "SET_PASSWORD") {
$member_model = new Member();
$result = $member_model->bindCode($param);
return $result;
}
}
<?php
/**
*/
namespace app\event\message;
use app\model\member\Member;
/**
* 设置密码
*/
class MessageSetPassWord
{
public function handle($param)
{
//发送订单消息
if ($param[ "keywords" ] == "SET_PASSWORD") {
$member_model = new Member();
$result = $member_model->bindCode($param);
return $result;
}
}
}

View File

@@ -1,33 +1,24 @@
<?php
/**
*/
namespace app\event\message;
use app\model\order\OrderMessage;
use GuzzleHttp\Exception\GuzzleException;
class MessageShopRefundAgree
{
/**
* @param $param
* @return void|null
* @throws GuzzleException
*/
public function handle($param)
{
// 发送订单消息
if ($param["keywords"] == "ORDER_REFUND_AGREE") {
$model = new OrderMessage();
return $model->messageOrderRefundAgree($param);
}
}
<?php
namespace app\event\message;
use app\model\order\OrderMessage;
use GuzzleHttp\Exception\GuzzleException;
class MessageShopRefundAgree
{
/**
* @param $param
* @return void|null
* @throws GuzzleException
*/
public function handle($param)
{
// 发送订单消息
if ($param["keywords"] == "ORDER_REFUND_AGREE") {
$model = new OrderMessage();
return $model->messageOrderRefundAgree($param);
}
}
}

View File

@@ -1,33 +1,24 @@
<?php
/**
*/
namespace app\event\message;
use app\model\order\OrderMessage;
use GuzzleHttp\Exception\GuzzleException;
class MessageShopRefundRefuse
{
/**
* @param $param
* @return void|null
* @throws GuzzleException
*/
public function handle($param)
{
// 发送订单消息
if ($param["keywords"] == "ORDER_REFUND_REFUSE") {
$model = new OrderMessage();
return $model->messageOrderRefundRefuse($param);
}
}
<?php
namespace app\event\message;
use app\model\order\OrderMessage;
use GuzzleHttp\Exception\GuzzleException;
class MessageShopRefundRefuse
{
/**
* @param $param
* @return void|null
* @throws GuzzleException
*/
public function handle($param)
{
// 发送订单消息
if ($param["keywords"] == "ORDER_REFUND_REFUSE") {
$model = new OrderMessage();
return $model->messageOrderRefundRefuse($param);
}
}
}

View File

@@ -1,33 +1,24 @@
<?php
/**
*/
namespace app\event\message;
use app\model\order\OrderMessage;
use GuzzleHttp\Exception\GuzzleException;
class MessageShopVerified
{
/**
* @param $param
* @return void|null
* @throws GuzzleException
*/
public function handle($param)
{
// 发送订单消息
if ($param["keywords"] == "VERIFY") {
$model = new OrderMessage();
return $model->messageOrderVerify($param);
}
}
<?php
namespace app\event\message;
use app\model\order\OrderMessage;
use GuzzleHttp\Exception\GuzzleException;
class MessageShopVerified
{
/**
* @param $param
* @return void|null
* @throws GuzzleException
*/
public function handle($param)
{
// 发送订单消息
if ($param["keywords"] == "VERIFY") {
$model = new OrderMessage();
return $model->messageOrderVerify($param);
}
}
}

View File

@@ -1,36 +1,27 @@
<?php
/**
*/
namespace app\event\message;
use app\model\member\Withdraw;
use GuzzleHttp\Exception\GuzzleException;
/**
* 会员提现申请发送消息
*/
class MessageUserWithdrawalApply
{
/**
* @param $param
* @return void|null
* @throws GuzzleException
*/
public function handle($param)
{
//发送订单消息
if ($param["keywords"] == "USER_WITHDRAWAL_APPLY") {
$model = new Withdraw();
return $model->messageUserWithdrawalApply($param);
}
}
<?php
namespace app\event\message;
use app\model\member\Withdraw;
use GuzzleHttp\Exception\GuzzleException;
/**
* 会员提现申请发送消息
*/
class MessageUserWithdrawalApply
{
/**
* @param $param
* @return void|null
* @throws GuzzleException
*/
public function handle($param)
{
//发送订单消息
if ($param["keywords"] == "USER_WITHDRAWAL_APPLY") {
$model = new Withdraw();
return $model->messageUserWithdrawalApply($param);
}
}
}

View File

@@ -1,36 +1,27 @@
<?php
/**
*/
namespace app\event\message;
use app\model\member\Withdraw;
use GuzzleHttp\Exception\GuzzleException;
/**
* 会员提现失败发送消息
*/
class MessageUserWithdrawalError
{
/**
* @param $param
* @return void|null
* @throws GuzzleException
*/
public function handle($param)
{
//发送订单消息
if ($param["keywords"] == "USER_WITHDRAWAL_ERROR") {
$model = new Withdraw();
return $model->messageUserWithdrawalError($param);
}
}
<?php
namespace app\event\message;
use app\model\member\Withdraw;
use GuzzleHttp\Exception\GuzzleException;
/**
* 会员提现失败发送消息
*/
class MessageUserWithdrawalError
{
/**
* @param $param
* @return void|null
* @throws GuzzleException
*/
public function handle($param)
{
//发送订单消息
if ($param["keywords"] == "USER_WITHDRAWAL_ERROR") {
$model = new Withdraw();
return $model->messageUserWithdrawalError($param);
}
}
}

View File

@@ -1,36 +1,27 @@
<?php
/**
*/
namespace app\event\message;
use app\model\member\Withdraw;
use GuzzleHttp\Exception\GuzzleException;
/**
* 会员提现成功发送消息
*/
class messageUserWithdrawalSuccess
{
/**
* @param $param
* @return void|null
* @throws GuzzleException
*/
public function handle($param)
{
//发送订单消息
if ($param["keywords"] == "USER_WITHDRAWAL_SUCCESS") {
$model = new Withdraw();
return $model->messageUserWithdrawalSuccess($param);
}
}
<?php
namespace app\event\message;
use app\model\member\Withdraw;
use GuzzleHttp\Exception\GuzzleException;
/**
* 会员提现成功发送消息
*/
class messageUserWithdrawalSuccess
{
/**
* @param $param
* @return void|null
* @throws GuzzleException
*/
public function handle($param)
{
//发送订单消息
if ($param["keywords"] == "USER_WITHDRAWAL_SUCCESS") {
$model = new Withdraw();
return $model->messageUserWithdrawalSuccess($param);
}
}
}

View File

@@ -1,27 +1,19 @@
<?php
/**
*/
namespace app\event\order;
use app\model\order\OrderCommon;
/**
* 订单完成之后达到时间自动关闭售后服务
*/
class CronOrderAfterSaleClose
{
// 行为扩展的执行入口必须是run
public function handle($data)
{
$order = new OrderCommon();
//订单自动完成
return $order->orderAfterSaleClose($data["relate_id"]);
}
<?php
namespace app\event\order;
use app\model\order\OrderCommon;
/**
* 订单完成之后达到时间自动关闭售后服务
*/
class CronOrderAfterSaleClose
{
// 行为扩展的执行入口必须是run
public function handle($data)
{
$order = new OrderCommon();
//订单自动完成
return $order->orderAfterSaleClose($data["relate_id"]);
}
}

View File

@@ -15,7 +15,7 @@ class CronOrderClose
{
$order = new OrderCommon();
$order_info = $order->getOrderInfo([ ['order_id', '=', $data['relate_id'] ] ], '*')['data'] ?? [];
if (!empty($order_info) && $order_info['order_status'] == 0) {
if (!empty($order_info) && $order_info['order_status'] == 0 && $order_info['pay_type'] != 'offlinepay') {
$result = $order->orderClose($data['relate_id'], [], '长时间未支付,订单自动关闭');//订单自动关闭
//todo 如果关闭失败,就再创建一个自动关闭任务
if(empty($result) && empty($result['code']) && $result['code'] < 0){

View File

@@ -1,31 +1,23 @@
<?php
/**
*/
namespace app\event\order;
use app\model\order\OrderCommon;
/**
* 订单自动收货
*/
class CronOrderTakeDelivery
{
// 行为扩展的执行入口必须是run
public function handle($data)
{
$order = new OrderCommon();
$order_info_result = $order->getOrderInfo([ ['order_id', '=', $data['relate_id'] ] ], 'order_status');
if (!empty($order_info_result) && $order_info_result['data']['order_status'] != 10) {
//订单自动收货
return $order->orderCommonTakeDelivery($data['relate_id']);
}
}
<?php
namespace app\event\order;
use app\model\order\OrderCommon;
/**
* 订单自动收货
*/
class CronOrderTakeDelivery
{
// 行为扩展的执行入口必须是run
public function handle($data)
{
$order = new OrderCommon();
$order_info_result = $order->getOrderInfo([ ['order_id', '=', $data['relate_id'] ] ], 'order_status');
if (isset($order_info_result['data']['order_status']) && $order_info_result['data']['order_status'] != 10) {
//订单自动收货
return $order->orderCommonTakeDelivery($data['relate_id']);
}
}
}

View File

@@ -0,0 +1,31 @@
<?php
namespace app\event\order;
use app\model\order\OrderCommon;
/**
* 订单支付成功同步事件
*/
class OfflinePay
{
/**
* 线下支付提交后记录支付方式
* @param $pay_info
* @return array|void
*/
public function handle($pay_info)
{
if($pay_info['event'] == 'OrderPayNotify'){
$order_model = new OrderCommon();
$pay_type_list = $order_model->getPayType();
$res = $order_model->orderUpdate([
'pay_type' => $pay_info['pay_type'],
'pay_type_name' => $pay_type_list[$pay_info['pay_type']] ?? '',
], [['out_trade_no', '=', $pay_info['out_trade_no']]]);
return $res;
}
}
}

View File

@@ -1,64 +1,56 @@
<?php
/**
*/
namespace app\event\order;
use app\model\member\Member;
use app\model\member\MemberAccount;
use app\model\member\MemberLevel;
use app\model\order\OrderCommon;
/**
* 订单完成事件
*/
class OrderComplete
{
// 行为扩展的执行入口必须是run
public function handle($data)
{
//订单返还积分
$order_model = new OrderCommon();
$condition = [
[ 'order_id', '=', $data[ 'order_id' ] ]
];
$order_info = $order_model->getOrderInfo($condition, 'order_money,order_status,site_id,member_id')[ 'data' ] ?? [];
//如果缺失已完成
if ($order_info[ 'order_status' ] == 10) {
//会员等级 计算积分返还比率
$site_id = $order_info[ 'site_id' ];
$member_id = $order_info[ 'member_id' ];
//存在散客的情况
if ($member_id > 0) {
$member_model = new Member();
$member_info_result = $member_model->getMemberInfo([ [ 'member_id', '=', $member_id ], [ 'site_id', '=', $site_id ] ], 'member_level');
$member_info = $member_info_result[ 'data' ];
if ($member_info[ 'member_level' ] > 0) {
$member_level_model = new MemberLevel();
$member_level_info_result = $member_level_model->getMemberLevelInfo([ [ 'level_id', '=', $member_info[ 'member_level' ] ], [ 'site_id', '=', $site_id ] ], 'point_feedback');
$member_level_info = $member_level_info_result[ 'data' ];
if ($member_level_info[ 'point_feedback' ] > 0) {
//计算返还的积分
$point = round($order_info[ 'order_money' ] * $member_level_info[ 'point_feedback' ]);
$member_account_model = new MemberAccount();
$result = $member_account_model->addMemberAccount($site_id, $member_id, 'point', $point, 'order', '会员消费回馈积分', '会员消费奖励发放');
if ($result[ 'code' ] < 0) {
return $result;
}
}
}
}
}
return $order_model->success();
}
<?php
namespace app\event\order;
use app\model\member\Member;
use app\model\member\MemberAccount;
use app\model\member\MemberLevel;
use app\model\order\OrderCommon;
/**
* 订单完成事件
*/
class OrderComplete
{
// 行为扩展的执行入口必须是run
public function handle($data)
{
//订单返还积分
$order_model = new OrderCommon();
$condition = [
[ 'order_id', '=', $data[ 'order_id' ] ]
];
$order_info = $order_model->getOrderInfo($condition, 'order_money,order_status,site_id,member_id')[ 'data' ] ?? [];
//如果缺失已完成
if ($order_info[ 'order_status' ] == 10) {
//会员等级 计算积分返还比率
$site_id = $order_info[ 'site_id' ];
$member_id = $order_info[ 'member_id' ];
//存在散客的情况
if ($member_id > 0) {
$member_model = new Member();
$member_info_result = $member_model->getMemberInfo([ [ 'member_id', '=', $member_id ], [ 'site_id', '=', $site_id ] ], 'member_level');
$member_info = $member_info_result[ 'data' ];
if ($member_info[ 'member_level' ] > 0) {
$member_level_model = new MemberLevel();
$member_level_info_result = $member_level_model->getMemberLevelInfo([ [ 'level_id', '=', $member_info[ 'member_level' ] ], [ 'site_id', '=', $site_id ] ], 'point_feedback');
$member_level_info = $member_level_info_result[ 'data' ];
if ($member_level_info[ 'point_feedback' ] > 0) {
//计算返还的积分
$point = round($order_info[ 'order_money' ] * $member_level_info[ 'point_feedback' ]);
$member_account_model = new MemberAccount();
$result = $member_account_model->addMemberAccount($site_id, $member_id, 'point', $point, 'order', '会员消费回馈积分', '会员消费奖励发放');
if ($result[ 'code' ] < 0) {
return $result;
}
}
}
}
}
return $order_model->success();
}
}

View File

@@ -1,43 +1,35 @@
<?php
/**
*/
namespace app\event\order;
use app\model\goods\Cart;
use app\model\system\Stat;
/**
* 订单支付后店铺点单计算
*/
class OrderCreate
{
/**
* 订单创建后事件
* @param unknown $data
*/
public function handle($data)
{
/** @var \app\model\order\OrderCreate $order_object */
$order_data = $data['create_data'];
$site_id = $order_data['site_id'];
$order_id = $order_data['order_id'];
$member_id = $order_data['member_id'];
//添加统计
$stat = new Stat();
return $stat->switchStat([ 'type' => 'order_create', 'data' => [
'site_id' => $site_id,
'order_id' => $order_id,
'member_id' => $member_id,
'order_data' => $order_data
] ]);
}
<?php
namespace app\event\order;
use app\model\goods\Cart;
use app\model\system\Stat;
/**
* 订单支付后店铺点单计算
*/
class OrderCreate
{
/**
* 订单创建后事件
* @param unknown $data
*/
public function handle($data)
{
/** @var \app\model\order\OrderCreate $order_object */
$order_data = $data['create_data'];
$site_id = $order_data['site_id'];
$order_id = $order_data['order_id'];
$member_id = $order_data['member_id'];
//添加统计
$stat = new Stat();
return $stat->switchStat([ 'type' => 'order_create', 'data' => [
'site_id' => $site_id,
'order_id' => $order_id,
'member_id' => $member_id,
'order_data' => $order_data
] ]);
}
}

View File

@@ -1,29 +1,21 @@
<?php
/**
*/
namespace app\event\order;
use app\model\system\Stat;
/**
* 订单支付成功同步事件
*/
class OrderPay
{
/**
* 传入订单信息
* @param unknown $data
*/
public function handle($data)
{
return success();
}
<?php
namespace app\event\order;
use app\model\system\Stat;
/**
* 订单支付成功同步事件
*/
class OrderPay
{
/**
* 传入订单信息
* @param unknown $data
*/
public function handle($data)
{
return success();
}
}

View File

@@ -1,31 +1,23 @@
<?php
/**
*/
namespace app\event\order;
use app\model\system\Stat;
/**
* 订单支付成功异步事件
*/
class OrderPayAfter
{
/**
* 传入订单信息
* @param unknown $data
*/
public function handle($data)
{
//添加统计
$stat = new Stat();
return $stat->switchStat([ 'type' => 'order_pay', 'data' => $data ]);
}
<?php
namespace app\event\order;
use app\model\system\Stat;
/**
* 订单支付成功异步事件
*/
class OrderPayAfter
{
/**
* 传入订单信息
* @param unknown $data
*/
public function handle($data)
{
//添加统计
$stat = new Stat();
return $stat->switchStat([ 'type' => 'order_pay', 'data' => $data ]);
}
}

View File

@@ -1,29 +1,20 @@
<?php
/**
*/
namespace app\event\order;
use app\model\order\OrderCommon;
/**
* 订单异步回调执行
*/
class OrderPayNotify
{
// 行为扩展的执行入口必须是run
public function handle($data)
{
$order = new OrderCommon();
return $order->orderOnlinePay($data);
}
<?php
namespace app\event\order;
use app\model\order\OrderCommon;
/**
* 订单异步回调执行
*/
class OrderPayNotify
{
// 行为扩展的执行入口必须是run
public function handle($data)
{
$order = new OrderCommon();
return $order->orderOnlinePay($data);
}
}

View File

@@ -1,68 +1,59 @@
<?php
/**
*/
namespace app\event\order;
use app\dict\order\OrderDict;
use app\model\member\Member;
use app\model\member\MemberAccount;
use app\model\member\MemberLevel;
use app\model\order\OrderCommon;
use app\model\verify\Verify;
/**
* 订单项退款完成后
*/
class OrderRefundFinish
{
// 行为扩展的执行入口必须是run
public function handle($data)
{
$order_info = $data['order_info'];
if (!empty($order_info) && in_array($order_info['order_type'], [OrderDict::store, OrderDict::virtual])) {
$order_goods_info = $data['order_goods_info'];
//核销商品操作
if ($order_info['order_type'] == OrderDict::store) {//自提订单
$verify_code = $order_info['delivery_code'];
} else //虚拟订单
$verify_code = $order_info['virtual_code'];
$verify_model = new Verify();
$verify_condition = [
['verify_code', '=', $verify_code]
];
$verify_info = $verify_model->getVerifyInfo($verify_condition)['data'] ?? [];
if (!empty($verify_info)) {
$json_data = $verify_info['data'];
$item_array = $json_data['item_array'];
foreach ($item_array as $k => $v) {
if ($v['order_goods_id'] == $order_goods_info['order_goods_id']) {
unset($item_array[$k]);
}
}
sort($item_array);
$json_data['item_array'] = $item_array;
$json_string = json_encode($json_data, JSON_UNESCAPED_UNICODE);
$verify_data = [
'verify_content_json' => $json_string
];
$verify_result = $verify_model->editVerify($verify_data, $verify_condition);
if ($verify_result['code'] < 0) {
return $verify_result;
}
}
}
}
<?php
namespace app\event\order;
use app\dict\order\OrderDict;
use app\model\member\Member;
use app\model\member\MemberAccount;
use app\model\member\MemberLevel;
use app\model\order\OrderCommon;
use app\model\verify\Verify;
/**
* 订单项退款完成后
*/
class OrderRefundFinish
{
// 行为扩展的执行入口必须是run
public function handle($data)
{
$order_info = $data['order_info'];
if (!empty($order_info) && in_array($order_info['order_type'], [OrderDict::store, OrderDict::virtual])) {
$order_goods_info = $data['order_goods_info'];
//核销商品操作
if ($order_info['order_type'] == OrderDict::store) {//自提订单
$verify_code = $order_info['delivery_code'];
} else //虚拟订单
$verify_code = $order_info['virtual_code'];
$verify_model = new Verify();
$verify_condition = [
['verify_code', '=', $verify_code]
];
$verify_info = $verify_model->getVerifyInfo($verify_condition)['data'] ?? [];
if (!empty($verify_info)) {
$json_data = $verify_info['data'];
$item_array = $json_data['item_array'];
foreach ($item_array as $k => $v) {
if ($v['order_goods_id'] == $order_goods_info['order_goods_id']) {
unset($item_array[$k]);
}
}
sort($item_array);
$json_data['item_array'] = $item_array;
$json_string = json_encode($json_data, JSON_UNESCAPED_UNICODE);
$verify_data = [
'verify_content_json' => $json_string
];
$verify_result = $verify_model->editVerify($verify_data, $verify_condition);
if ($verify_result['code'] < 0) {
return $verify_result;
}
}
}
}
}

View File

@@ -0,0 +1,22 @@
<?php
namespace app\event\order;
use app\model\order\OrderCommon;
/**
* 通过支付信息获取手机端订单详情路径
*/
class WapOrderDetailPathByPayInfo
{
public function handle($data)
{
if($data['event'] == 'OrderPayNotify'){
$order_common = new OrderCommon();
$order_info = $order_common->getOrderInfo([['out_trade_no', '=', $data['out_trade_no']]], 'order_id')['data'];
if(!empty($order_info)){
return '/pages/order/detail?order_id='.$order_info['order_id'];
}
}
}
}

View File

@@ -0,0 +1,20 @@
<?php
namespace app\event\pay;
use app\model\system\PayTransfer;
/**
* 定时查询转账结果
* @author Administrator
*
*/
class CronPayTransferResult
{
public function handle($param)
{
$model = new PayTransfer();
$result = $model->result($param['relate_id']);
return $result;
}
}

View File

@@ -1,29 +1,20 @@
<?php
/**
*/
namespace app\event\promotion;
use app\model\games\Games;
/**
* 关闭小游戏
* @author Administrator
*
*/
class CloseGame
{
public function handle($param)
{
$model = new Games();
$result = $model->cronCloseGames($param['relate_id']);
return $result;
}
}
<?php
namespace app\event\promotion;
use app\model\games\Games;
/**
* 关闭小游戏
* @author Administrator
*
*/
class CloseGame
{
public function handle($param)
{
$model = new Games();
$result = $model->cronCloseGames($param['relate_id']);
return $result;
}
}

View File

@@ -1,29 +1,20 @@
<?php
/**
*/
namespace app\event\promotion;
use app\model\games\Games;
/**
* 开启小游戏
* @author Administrator
*
*/
class OpenGame
{
public function handle($param)
{
$model = new Games();
$result = $model->cronOpenGames($param['relate_id']);
return $result;
}
}
<?php
namespace app\event\promotion;
use app\model\games\Games;
/**
* 开启小游戏
* @author Administrator
*
*/
class OpenGame
{
public function handle($param)
{
$model = new Games();
$result = $model->cronOpenGames($param['relate_id']);
return $result;
}
}

View File

@@ -0,0 +1,22 @@
<?php
namespace app\event\promotion;
/**
* 营销活动页面
*/
class PromotionPage
{
public function handle($params)
{
$page_list = [
[
'name' => 'GOODS_DETAIL',
'title' => '商品详情',
'wap_url' => '/pages/goods/detail?goods_id=$goods_id',
'web_url' => '',
],
];
return $page_list;
}
}

View File

@@ -1,67 +1,59 @@
<?php
/**
*/
namespace app\event\promotion;
use app\model\web\Config as ConfigModel;
/**
* 营销活动二维码
*/
class PromotionQrcode
{
/**
* 活动展示
* @param $params
* @return array
*/
public function handle($params)
{
$solitaire = [];
$qrcode_all = event('Qrcode', [
'site_id' => $params[ 'site_id' ],
'app_type' => $params[ 'app_type' ] ?? 'all',
'type' => 'create',
'data' => $params[ 'data' ],
'page' => $params[ 'page' ],
'qrcode_path' => $params[ 'qrcode_path' ],
'qrcode_name' => $params[ 'qrcode_name' ],
]);
if (!empty($qrcode_all)) {
foreach ($qrcode_all as $item) {
if ($item[ 'code' ] == 0) $solitaire[ $item[ 'data' ][ 'type' ] ] = $item[ 'data' ];
}
}
if (addon_is_exit('pc') == 1 && !empty($params[ 'pc_data' ]) && !empty($params[ 'pc_page' ])) {
$pc_qrcode = event('Qrcode', [
'site_id' => $params[ 'site_id' ],
'app_type' => 'pc',
'type' => 'create',
'data' => $params[ 'pc_data' ],
'page' => $params[ 'pc_page' ],
'qrcode_path' => $params[ 'qrcode_path' ],
'qrcode_name' => 'pc_' . $params[ 'qrcode_name' ],
], true);
if ($pc_qrcode[ 'code' ] >= 0) {
$solitaire[ 'pc' ][ 'path' ] = $pc_qrcode[ 'data' ][ 'path' ];
$config_model = new ConfigModel();
$domain_name_pc = $config_model->getPcDomainName()[ 'data' ][ 'value' ][ 'domain_name_pc' ];
$solitaire[ 'pc' ][ 'url' ] = $domain_name_pc . $params[ 'pc_path' ];
}
}
return $solitaire;
}
<?php
namespace app\event\promotion;
use app\model\web\Config as ConfigModel;
/**
* 营销活动二维码
*/
class PromotionQrcode
{
/**
* 活动展示
* @param $params
* @return array
*/
public function handle($params)
{
$solitaire = [];
$qrcode_all = event('Qrcode', [
'site_id' => $params[ 'site_id' ],
'app_type' => $params[ 'app_type' ] ?? 'all',
'type' => 'create',
'data' => $params[ 'data' ],
'page' => $params[ 'page' ],
'qrcode_path' => $params[ 'qrcode_path' ],
'qrcode_name' => $params[ 'qrcode_name' ],
]);
if (!empty($qrcode_all)) {
foreach ($qrcode_all as $item) {
if ($item[ 'code' ] == 0) $solitaire[ $item[ 'data' ][ 'type' ] ] = $item[ 'data' ];
}
}
if (addon_is_exit('pc') == 1 && !empty($params[ 'pc_data' ]) && !empty($params[ 'pc_page' ])) {
$pc_qrcode = event('Qrcode', [
'site_id' => $params[ 'site_id' ],
'app_type' => 'pc',
'type' => 'create',
'data' => $params[ 'pc_data' ],
'page' => $params[ 'pc_page' ],
'qrcode_path' => $params[ 'qrcode_path' ],
'qrcode_name' => 'pc_' . $params[ 'qrcode_name' ],
], true);
if ($pc_qrcode[ 'code' ] >= 0) {
$solitaire[ 'pc' ][ 'path' ] = $pc_qrcode[ 'data' ][ 'path' ];
$config_model = new ConfigModel();
$domain_name_pc = $config_model->getPcDomainName()[ 'data' ][ 'value' ][ 'domain_name_pc' ];
$solitaire[ 'pc' ][ 'url' ] = $domain_name_pc . $params[ 'pc_path' ];
}
}
return $solitaire;
}
}

View File

@@ -1,36 +1,28 @@
<?php
/**
*/
namespace app\event\promotion;
/**
* 平台推广营销类展示
*/
class ShowPromotion
{
/**
* 活动展示
* @return array
*/
public function handle()
{
$data = [
'admin' => [
],
'shop' => [
]
];
return $data;
}
<?php
namespace app\event\promotion;
/**
* 平台推广营销类展示
*/
class ShowPromotion
{
/**
* 活动展示
* @return array
*/
public function handle()
{
$data = [
'admin' => [
],
'shop' => [
]
];
return $data;
}
}

View File

@@ -1,26 +1,18 @@
<?php
/**
*/
namespace app\event\stat;
use app\model\stat\StatShop;
/**
* 店铺统计(计划任务)
*/
class CronStatShop
{
// 行为扩展的执行入口必须是run
public function handle($data)
{
$shop_stat = new StatShop();
$shop_stat->cronShopStat();
}
<?php
namespace app\event\stat;
use app\model\stat\StatShop;
/**
* 店铺统计(计划任务)
*/
class CronStatShop
{
// 行为扩展的执行入口必须是run
public function handle($data)
{
$shop_stat = new StatShop();
$shop_stat->cronShopStat();
}
}

View File

@@ -1,26 +1,18 @@
<?php
/**
*/
namespace app\event\stat;
use app\model\stat\StatShop;
/**
* 店铺小时统计(计划任务)
*/
class CronStatShopHour
{
// 行为扩展的执行入口必须是run
public function handle($data)
{
$shop_stat = new StatShop();
$shop_stat->cronShopStatHour();
}
<?php
namespace app\event\stat;
use app\model\stat\StatShop;
/**
* 店铺小时统计(计划任务)
*/
class CronStatShopHour
{
// 行为扩展的执行入口必须是run
public function handle($data)
{
$shop_stat = new StatShop();
$shop_stat->cronShopStatHour();
}
}

View File

@@ -1,26 +1,18 @@
<?php
/**
*/
namespace app\event\stat;
use app\model\stat\StatStore;
/**
* 门店统计计划任务
*/
class CronStatStore
{
// 行为扩展的执行入口必须是run
public function handle($data)
{
$shop_stat = new StatStore();
$shop_stat->cronStatStore();
}
<?php
namespace app\event\stat;
use app\model\stat\StatStore;
/**
* 门店统计计划任务
*/
class CronStatStore
{
// 行为扩展的执行入口必须是run
public function handle($data)
{
$shop_stat = new StatStore();
$shop_stat->cronStatStore();
}
}

View File

@@ -1,26 +1,18 @@
<?php
/**
*/
namespace app\event\stat;
use app\model\stat\StatStore;
/**
* 门店小时统计(计划任务)
*/
class CronStatStoreHour
{
// 行为扩展的执行入口必须是run
public function handle($data)
{
$shop_stat = new StatStore();
$shop_stat->cronStatStoreHour();
}
<?php
namespace app\event\stat;
use app\model\stat\StatStore;
/**
* 门店小时统计(计划任务)
*/
class CronStatStoreHour
{
// 行为扩展的执行入口必须是run
public function handle($data)
{
$shop_stat = new StatStore();
$shop_stat->cronStatStoreHour();
}
}

View File

@@ -1,3 +0,0 @@
array (
'relate_id' => 619,
)

View File

@@ -1,30 +1,25 @@
<?php
/**
*/
namespace app\event\verify;
use app\model\message\Message;
/**
* 核销码过期提醒
*/
class CronVerifyCodeExpire
{
// 行为扩展的执行入口必须是run
public function handle($data)
{
// 商品表
$goods_virtual_info = model('goods_virtual')->getInfo([ [ "order_id", "=", $data[ "relate_id" ] ], [ 'expire_time', '<=', time() ], [ 'is_veirfy', '=', 0 ] ]);
if (!empty($goods_virtual_info)) {
( new Message() )->sendMessage([ 'keywords' => 'VERIFY_CODE_EXPIRE', 'relate_id' => $data[ 'relate_id' ], 'site_id' => $goods_virtual_info[ 'site_id' ] ]);
}
return success();
}
<?php
namespace app\event\verify;
use app\model\message\Message;
use app\model\verify\Verify;
/**
* 核销码过期提醒
*/
class CronVerifyCodeExpire
{
// 行为扩展的执行入口必须是run
public function handle($data)
{
// 商品表
$goods_virtual_info = model('goods_virtual')->getInfo([["order_id", "=", $data["relate_id"]], ['expire_time', '<=', time()], ['is_veirfy', '=', 0]]);
if (!empty($goods_virtual_info)) {
(new Message())->sendMessage(['keywords' => 'VERIFY_CODE_EXPIRE', 'relate_id' => $data['relate_id'], 'site_id' => $goods_virtual_info['site_id']]);
(new Verify())->verifyCodeExpire($goods_virtual_info);
}
return success();
}
}

View File

@@ -1,31 +1,23 @@
<?php
/**
*/
namespace app\event\verify;
use app\model\order\StoreOrder;
/**
* 门店订单提货
*/
class PickupOrderVerify
{
public function handle($data)
{
if ($data[ 'verify_type' ] == 'pickup') {
$store_order = new StoreOrder();
$result = $store_order->verify($data[ 'verify_code' ]);
return $result;
}
return '';
}
<?php
namespace app\event\verify;
use app\model\order\StoreOrder;
/**
* 门店订单提货
*/
class PickupOrderVerify
{
public function handle($data)
{
if ($data[ 'verify_type' ] == 'pickup') {
$store_order = new StoreOrder();
$result = $store_order->verify($data[ 'verify_code' ]);
return $result;
}
return '';
}
}

View File

@@ -1,30 +1,22 @@
<?php
/**
*/
namespace app\event\verify;
use app\model\message\Message;
/**
* 核销商品临期提醒
*/
class VerifyOrderOutTime
{
// 行为扩展的执行入口必须是run
public function handle($data)
{
// 商品表
$goods_virtual_info = model('goods_virtual')->getInfo([ ["order_id", "=", $data["relate_id"] ] ]);
if(!empty($goods_virtual_info)){
(new Message())->sendMessage(['keywords' => 'ORDER_VERIFY_OUT_TIME', 'order_id' => $data['relate_id'], 'site_id' => $goods_virtual_info['site_id'] ]);
}
return success();
}
<?php
namespace app\event\verify;
use app\model\message\Message;
/**
* 核销商品临期提醒
*/
class VerifyOrderOutTime
{
// 行为扩展的执行入口必须是run
public function handle($data)
{
// 商品表
$goods_virtual_info = model('goods_virtual')->getInfo([ ["order_id", "=", $data["relate_id"] ] ]);
if(!empty($goods_virtual_info)){
(new Message())->sendMessage(['keywords' => 'ORDER_VERIFY_OUT_TIME', 'order_id' => $data['relate_id'], 'site_id' => $goods_virtual_info['site_id'] ]);
}
return success();
}
}

View File

@@ -1,31 +1,23 @@
<?php
/**
*/
namespace app\event\verify;
use app\model\goods\VirtualGoods;
/**
* 虚拟商品核销
*/
class VirtualGoodsVerify
{
public function handle($data)
{
if ($data[ 'verify_type' ] == 'virtualgoods') {
$virtual_goods_model = new VirtualGoods();
$res = $virtual_goods_model->verify($data[ "verify_code" ]);
return $res;
}
return '';
}
<?php
namespace app\event\verify;
use app\model\goods\VirtualGoods;
/**
* 虚拟商品核销
*/
class VirtualGoodsVerify
{
public function handle($data)
{
if ($data[ 'verify_type' ] == 'virtualgoods') {
$virtual_goods_model = new VirtualGoods();
$res = $virtual_goods_model->verify($data[ "verify_code" ]);
return $res;
}
return '';
}
}

View File

@@ -1,28 +1,19 @@
<?php
/**
*/
namespace app\event\wechat;
use app\model\share\WchatShare as ShareModel;
/**
* 获取分享配置
*/
class WchatShareConfig
{
public function handle($param)
{
$share_model = new ShareModel();
return $share_model->getShareConfig($param);
}
<?php
namespace app\event\wechat;
use app\model\share\WchatShare as ShareModel;
/**
* 获取分享配置
*/
class WchatShareConfig
{
public function handle($param)
{
$share_model = new ShareModel();
return $share_model->getShareConfig($param);
}
}

View File

@@ -1,28 +1,19 @@
<?php
/**
*/
namespace app\event\wechat;
use app\model\share\WchatShare as ShareModel;
/**
* 获取分享数据
*/
class WchatShareData
{
public function handle($param)
{
$share_model = new ShareModel();
return $share_model->getShareData($param);
}
<?php
namespace app\event\wechat;
use app\model\share\WchatShare as ShareModel;
/**
* 获取分享数据
*/
class WchatShareData
{
public function handle($param)
{
$share_model = new ShareModel();
return $share_model->getShareData($param);
}
}

View File

@@ -1,28 +1,19 @@
<?php
/**
*/
namespace app\event\wechat;
use app\model\share\WeappShare as ShareModel;
/**
* 获取分享配置
*/
class WeappShareConfig
{
public function handle($param)
{
$share_model = new ShareModel();
return $share_model->getShareConfig($param);
}
<?php
namespace app\event\wechat;
use app\model\share\WeappShare as ShareModel;
/**
* 获取分享配置
*/
class WeappShareConfig
{
public function handle($param)
{
$share_model = new ShareModel();
return $share_model->getShareConfig($param);
}
}

Some files were not shown because too many files have changed in this diff Show More