init: import production code mss.nahaichuan.com (exclude Runtime/Uploads/backups/logs)
这个提交包含在:
@@ -0,0 +1,911 @@
|
||||
<?php
|
||||
|
||||
namespace ShopCoupon\Business;
|
||||
|
||||
use Addons\Pay\WxPayV3;
|
||||
use Common\Business\AppInfo;
|
||||
use Common\Business\CreateFile;
|
||||
use Common\Business\MerchantConfig;
|
||||
use Common\Business\Store;
|
||||
use Common\Business\WxUpload;
|
||||
use Common\Model\RetailMerchantConfigModel;
|
||||
use Common\Model\RetailPaySetModel;
|
||||
use ShopCoupon\Model\ShopCouponModel;
|
||||
|
||||
/**
|
||||
* 商家券类
|
||||
* Class ShopCoupon
|
||||
* [
|
||||
* 微信参数 wxInfo
|
||||
* 下载券码 downloadCouponCode
|
||||
* 生成券码 generateCouponCode
|
||||
* 创建券码目录 createCodeCatalog
|
||||
* 下载券码的参数验证 downloadCouponCodeVerify
|
||||
* 核销商家券 verificationCoupon
|
||||
* 发放状态修改或者删除 suspendOperation
|
||||
* 图片上传至微信 wxUpload
|
||||
* 创建商家券 createCoupon
|
||||
* 创建商家券存表 addCoupon
|
||||
* 创建商家券参数转换 createCouponReplace
|
||||
* 创建商家券的参数验证 createCouponVerify
|
||||
* ]
|
||||
* @package ShopCoupon\Business
|
||||
*/
|
||||
class ShopCoupon
|
||||
{
|
||||
protected $mch_id; //商户号
|
||||
protected $serial_no; //证书序列号
|
||||
protected $apiclient_key; //私钥地址
|
||||
protected $son_mch_id; //子商户
|
||||
protected $appid; //创建时的appid
|
||||
protected $path; //小程序path
|
||||
protected $xcx_appid; //小程序的ppid
|
||||
protected $wx_appid; //公众号ppid
|
||||
|
||||
/**
|
||||
* 微信参数
|
||||
* @param $param
|
||||
* [
|
||||
* merchant_id
|
||||
* user_type 1普通支付模式 2服务商支付模式
|
||||
* type 1小程序 2公众号
|
||||
* ]
|
||||
*/
|
||||
protected function wxInfo($param)
|
||||
{
|
||||
$merchant_id = $param['merchant_id'];
|
||||
$type = $param['type'];
|
||||
$user_type = $param['user_type'];
|
||||
$paySetModel = new RetailPaySetModel();
|
||||
$paySet = $paySetModel->getFindMerchantPaySet($merchant_id);
|
||||
$this->path = '/pages/store/store';
|
||||
$this->wx_appid = $paySet['config']['wx_appid'];
|
||||
switch ($user_type) {
|
||||
case 1:
|
||||
//普通支付模式
|
||||
$this->xcx_appid = $paySet['config']['xcx_appid'];
|
||||
switch ($type) {
|
||||
case 1:
|
||||
//小程序
|
||||
$this->mch_id = $paySet['config']['xcx_mer_id'];
|
||||
$this->serial_no = $paySet['config']['wx_xcx_serial_no'];
|
||||
$this->apiclient_key = $paySet['config']['xcx_apiclient_key'];
|
||||
$this->appid = $paySet['config']['xcx_appid'];
|
||||
break;
|
||||
case 2:
|
||||
//公众号
|
||||
$this->mch_id = $paySet['config']['wx_mch_id'];
|
||||
$this->serial_no = $paySet['config']['wx_serial_no'];
|
||||
$this->apiclient_key = $paySet['config']['apiclient_key'];
|
||||
$this->appid = $paySet['config']['wx_appid'];
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
//服务商支付模式
|
||||
$this->xcx_appid = $paySet['config']['xcx_sub_appid'];
|
||||
$this->son_mch_id = $paySet['config']['xcx_sub_mchid'];
|
||||
$this->mch_id = $paySet['config']['systemConfig']['mch_id'];
|
||||
$this->serial_no = $paySet['config']['systemConfig']['wx_serial_no'];
|
||||
$this->apiclient_key = $paySet['config']['systemConfig']['wx_apiclient_key'];
|
||||
$this->appid = $paySet['config']['systemConfig']['wx_appid'];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 下载券码
|
||||
* @param $param
|
||||
* [
|
||||
* merchant_id
|
||||
* couponList 券列表
|
||||
* ]
|
||||
* @return mixed
|
||||
*/
|
||||
public function downloadCouponCode($param)
|
||||
{
|
||||
$verifyResult = $this->downloadCouponCodeVerify($param); //参数验证
|
||||
if ($verifyResult['status'] != 1) {
|
||||
return $verifyResult;
|
||||
}
|
||||
$path = $this->createCodeCatalog($param); //创建目录
|
||||
$param['path'] = $path;
|
||||
$codeResult = $this->generateCouponCode($param); //生成券码
|
||||
$store_arr = json_encode($codeResult['data']['store_arr']);//门店集合
|
||||
$coupon_arr = json_encode($codeResult['data']['coupon_arr']); //券集合
|
||||
return callBack(statusCode()['success'], "生成成功", ['path' => $path, 'store_arr' => $store_arr, 'coupon_arr' => $coupon_arr]);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 生成券码
|
||||
* @param $param
|
||||
* [
|
||||
* merchant_id
|
||||
* couponList 券列表
|
||||
* path 目录
|
||||
* ]
|
||||
* @return bool
|
||||
*/
|
||||
public function generateCouponCode($param)
|
||||
{
|
||||
$merchant_id = $param['merchant_id'];
|
||||
$couponList = $param['couponList'];
|
||||
$path = $param['path'];
|
||||
$time = time();
|
||||
$CreateFile = new CreateFile();
|
||||
$StoreClass = new Store();
|
||||
$storeInfo = $StoreClass->getStoreList([
|
||||
'merchant_id' => $merchant_id,
|
||||
]);//所有门店信息
|
||||
$arr1 = array_column($storeInfo, "id");
|
||||
$arr2 = array_column($storeInfo, "storetag");
|
||||
$store_arr = array_combine($arr1, $arr2);//门店新数组
|
||||
$arr1 = array_column($couponList, "id");
|
||||
$arr2 = array_column($couponList, "stock_name");
|
||||
$coupon_arr = array_combine($arr1, $arr2); //券新数组
|
||||
foreach ($couponList as $value) {
|
||||
if ($value['store_type'] == 1) {
|
||||
//所有门店
|
||||
$storeList = $storeInfo;
|
||||
} else {
|
||||
//指定门店
|
||||
$storeList = $StoreClass->getAppointStoreInfo([
|
||||
'merchant_id' => $merchant_id,
|
||||
'store_id_gather' => $value['store_id_gather'],
|
||||
'fields' => "id,storetag"
|
||||
]);
|
||||
}
|
||||
if (!empty($storeList)) {
|
||||
foreach ($storeList as $val) {
|
||||
$data = [
|
||||
'path' => "/pages/index/merCouponDetail/merCouponDetail?store_id=" . $val['id'] . '&genre=3&id=' . $value['id'],
|
||||
'merchant_id' => $merchant_id,
|
||||
'file_name' => $path . '/' . $val['id'] . '_' . $value['id'] . '_' . $time . '.jpg'
|
||||
];
|
||||
$CreateFile->createWxCode($data);
|
||||
}
|
||||
}
|
||||
}
|
||||
return callBack(statusCode()['success'], '生成成功', ['store_arr' => $store_arr, 'coupon_arr' => $coupon_arr]);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 创建券码目录
|
||||
* @param $param
|
||||
* [
|
||||
* merchant_id
|
||||
* ]
|
||||
* @return string
|
||||
*/
|
||||
public function createCodeCatalog($param)
|
||||
{
|
||||
$num = createKey();
|
||||
$path = "./Uploads/Merchant/ShopCoupon/{$param['merchant_id']}/{$num}";
|
||||
$CreateFileClass = new CreateFile();
|
||||
$CreateFileClass->createDir($path);
|
||||
return $path;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 下载券码的参数验证
|
||||
* @param $param
|
||||
* [
|
||||
* merchant_id
|
||||
* couponList 券列表
|
||||
* ]
|
||||
* @return mixed
|
||||
*/
|
||||
public function downloadCouponCodeVerify($param)
|
||||
{
|
||||
if (empty($param['merchant_id'])) {
|
||||
return callBack(statusCode()['error'], "缺少身份必要参数");
|
||||
}
|
||||
if (empty($param['couponList'])) {
|
||||
return callBack(statusCode()['error'], "请选择商家券");
|
||||
}
|
||||
$AppInfoClass = new AppInfo();
|
||||
$appInfo = $AppInfoClass->getAppInfo($param['merchant_id']);
|
||||
if (empty($appInfo)) {
|
||||
return callBack(statusCode()['error'], "请先去授权您的小程序再进行此操作");
|
||||
}
|
||||
return callBack(statusCode()['success'], "验证成功");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 发放状态修改或者删除
|
||||
* @param $param
|
||||
* [
|
||||
* merchant_id
|
||||
* coupon_id 商家券id
|
||||
* operation_type 1发放 2暂停 3删除
|
||||
* ]
|
||||
* @return mixed
|
||||
*/
|
||||
public function suspendOperation($param)
|
||||
{
|
||||
if (empty($param['merchant_id']) || empty($param['coupon_id']) || empty($param['operation_type'])) {
|
||||
return callBack(statusCode()['error'], "参数缺失");
|
||||
}
|
||||
switch ($param['operation_type']) {
|
||||
case 1:
|
||||
//开始发放
|
||||
$data['suspend_status'] = 1;
|
||||
break;
|
||||
case 2:
|
||||
//暂停发放
|
||||
$data['suspend_status'] = 2;
|
||||
break;
|
||||
case 3:
|
||||
//删除
|
||||
$data['status'] = 2;
|
||||
break;
|
||||
}
|
||||
$where = [
|
||||
'merchant_id' => $param['merchant_id'],
|
||||
'id' => $param['coupon_id']
|
||||
];
|
||||
$ShopCouponModel = new ShopCouponModel();
|
||||
$result = $ShopCouponModel->updateOrder($where, $data);
|
||||
if ($result) {
|
||||
return callBack(statusCode()['success'], "操作成功");
|
||||
} else {
|
||||
return callBack(statusCode()['success'], "暂无修改");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 核销商家券
|
||||
* @param $param
|
||||
* [
|
||||
* openid 用户小程序openid
|
||||
* service_openid 服务商下的openid
|
||||
* ordinary_openid 商户公众号的openid
|
||||
* merchant_id
|
||||
* user_type 1普通支付模式 2服务商支付模式
|
||||
* type 1小程序 2公众号
|
||||
* coupon_code 券code
|
||||
* app_id 公众账号ID
|
||||
* verification_available_type 核销场景 1小程序 2收银机 3公众号
|
||||
* verification_store_id 核销的门店
|
||||
* operator_id 核销人id 0为小程序用户购买核销
|
||||
* ]
|
||||
* @return mixed
|
||||
*/
|
||||
public function verificationCoupon($param)
|
||||
{
|
||||
if (empty($param['merchant_id']) || empty($param['user_type']) || empty($param['type']) || empty($param['coupon_code']) || empty($param['app_id']) || empty($param['verification_available_type']) || empty($param['verification_store_id'])) {
|
||||
return callBack(statusCode()['error'], "缺少参数");
|
||||
}
|
||||
$this->wxInfo($param);
|
||||
$time = time();
|
||||
$use_time = date("Y-m-d H:i:s", $time) . '+08:00';
|
||||
$use_time = str_replace(" ", "T", $use_time);
|
||||
$use_request_no = onlyCreateKey();
|
||||
$data = [
|
||||
'mch_id' => $this->mch_id,
|
||||
'serial_no' => $this->serial_no,
|
||||
'apiclient_key' => $this->apiclient_key,
|
||||
'data' => [
|
||||
'coupon_code' => $param['coupon_code'],
|
||||
'appid' => $param['app_id'],
|
||||
'use_time' => $use_time,
|
||||
'use_request_no' => $use_request_no,
|
||||
]
|
||||
];
|
||||
switch ($param['user_type']) {
|
||||
case 1:
|
||||
//普通支付模式
|
||||
switch ($param['type']) {
|
||||
case 1:
|
||||
//小程序
|
||||
if (!empty($param['openid'])) {
|
||||
$data['data']['openid'] = $param['openid'];
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
//公众号
|
||||
if (!empty($param['ordinary_openid'])) {
|
||||
$data['data']['openid'] = $param['ordinary_openid'];
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
//服务商支付模式
|
||||
if (!empty($param['service_openid'])) {
|
||||
$data['data']['openid'] = $param['service_openid'];
|
||||
}
|
||||
break;
|
||||
}
|
||||
$WxPayV3Class = new WxPayV3($data);
|
||||
$result = $WxPayV3Class->verificationCoupon();
|
||||
file_put_contents('./shop_coupon_write.txt', $result . PHP_EOL, FILE_APPEND);
|
||||
// file_put_contents('./shop_coupon2.txt',json_encode($data));
|
||||
$result = json_decode($result, true);
|
||||
if (!empty($result['stock_id'])) {
|
||||
return callBack(statusCode()['success'], "核销成功", ['use_time' => $time, 'wechatpay_use_time' => $result['wechatpay_use_time'], 'use_request_no' => $use_request_no]);
|
||||
} else {
|
||||
return callBack(statusCode()['error'], $result['message'], ['use_time' => $time, 'wechatpay_use_time' => $time, 'use_request_no' => $use_request_no]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 图片上传至微信
|
||||
* @param $param
|
||||
* [
|
||||
* user_type 1普通支付模式 2服务商支付模式
|
||||
* merchant_id
|
||||
* ]
|
||||
* @return array
|
||||
*/
|
||||
public function wxUpload($param)
|
||||
{
|
||||
if (empty($param['user_type'])) {
|
||||
return callBack(statusCode()['error'], "请选择支付模式");
|
||||
}
|
||||
$this->wxInfo([
|
||||
'merchant_id' => $param['merchant_id'],
|
||||
'type' => 1,
|
||||
'user_type' => $param['user_type']
|
||||
]);
|
||||
switch ($param['user_type']) {
|
||||
case 1:
|
||||
$image = $_FILES['label_img'];
|
||||
break;
|
||||
case 2:
|
||||
$image = $_FILES['label_img_service'];
|
||||
break;
|
||||
}
|
||||
$wxUploadClass = new WxUpload();
|
||||
$result = $wxUploadClass->wxUpload([
|
||||
'image' => $image,
|
||||
'mch_id' => $this->mch_id,
|
||||
'serial_no' => $this->serial_no,
|
||||
'apiclient_key' => $this->apiclient_key,
|
||||
'user_type' => $param['user_type']
|
||||
]);
|
||||
if ($result['status'] == 1) {
|
||||
$data['merchant_id'] = $param['merchant_id'];
|
||||
switch ($param['user_type']) {
|
||||
case 1:
|
||||
$data['shop_coupon_simple_image'] = $result['data']['image_path'];
|
||||
$data['shop_coupon_simple_wx_image'] = $result['data']['media_url'];
|
||||
break;
|
||||
case 2:
|
||||
$data['shop_coupon_service_image'] = $result['data']['image_path'];
|
||||
$data['shop_coupon_service_wx_image'] = $result['data']['media_url'];
|
||||
break;
|
||||
}
|
||||
$configClass = new MerchantConfig();
|
||||
$configClass->shopCouponImgSet($data);
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建商家券
|
||||
* @param $param
|
||||
* [
|
||||
* merchant_id
|
||||
* operator_id
|
||||
* data=>[
|
||||
* store_id_gather 门店集合
|
||||
* user_type 1普通支付模式 2服务商支付模式
|
||||
* type 1小程序 2公众号
|
||||
* stock_name 名称
|
||||
* goods_name 适用商品范围
|
||||
* stock_type 1满减 2折扣 3换购
|
||||
* available_time 有效时间
|
||||
* valid_time_type 生效时间类型
|
||||
* coupon_use_rule=>[
|
||||
* fixed_normal_coupon=>[
|
||||
* discount_amount 优惠金额
|
||||
* transaction_minimum 门槛
|
||||
* ],
|
||||
* coupon_available_time=>[
|
||||
* available_week=>[
|
||||
* week_day=>[],
|
||||
* available_day_time=>[
|
||||
* begin_time
|
||||
* end_time
|
||||
* ],
|
||||
* ]
|
||||
* irregulary_avaliable_time=>[
|
||||
* begin_time
|
||||
* end_time
|
||||
* ]
|
||||
* ]
|
||||
* ],
|
||||
* stock_send_rule=>[
|
||||
* max_amount 批次总预算
|
||||
* max_coupons_per_user 用户最大可领个数
|
||||
* ],
|
||||
* display_pattern_info=>[
|
||||
* merchant_name 商户名称
|
||||
* ]
|
||||
* ]
|
||||
* ]
|
||||
* @return mixed
|
||||
*/
|
||||
public function createCoupon($param)
|
||||
{
|
||||
$paySetModel = new RetailPaySetModel();
|
||||
$paySet = $paySetModel->getFindMerchantPaySet($param['merchant_id']);
|
||||
if (!empty($paySet['config']['xcx_sub_mchid']) && !empty($paySet['config']['systemConfig']['mch_id']) && !empty($paySet['config']['systemConfig']['wx_serial_no']) && !empty($paySet['config']['systemConfig']['wx_apiclient_key']) && !empty($paySet['config']['systemConfig']['wx_appid'])) {
|
||||
$param['data']['user_type'] = 2; //服务商模式
|
||||
} else if (!empty($paySet['config']['xcx_mer_id']) && !empty($paySet['config']['wx_xcx_serial_no']) && !empty($paySet['config']['xcx_apiclient_key']) && !empty($paySet['config']['xcx_appid'])) {
|
||||
$param['data']['user_type'] = 1; //普通模式
|
||||
} else {
|
||||
return callBack(statusCode()['error'], '请配置小程序支付参数');
|
||||
}
|
||||
if ($param['data']['user_type'] == 1) {
|
||||
if (count($param['data']['available_type']) > 1 || in_array(2, $param['data']['available_type'])) {
|
||||
$param['data']['type'] = 2; //公众号创建
|
||||
} else if (in_array(1, $param['data']['available_type'])) {
|
||||
$param['data']['type'] = 1; //小程序创建
|
||||
}
|
||||
} else {
|
||||
$param['data']['type'] = 2; //公众号创建
|
||||
}
|
||||
$this->wxInfo([
|
||||
'merchant_id' => $param['merchant_id'],
|
||||
'user_type' => $param['data']['user_type'],
|
||||
'type' => $param['data']['type'], //小程序创建
|
||||
]); //获取微信配置参数
|
||||
$verify = $this->createCouponVerify($param); //参数验证
|
||||
if ($verify['status'] != 1) {
|
||||
return $verify;
|
||||
}
|
||||
$new_param = $this->createCouponReplace($param); //去除多余参数
|
||||
switch ($param['data']['user_type']) {
|
||||
case 1:
|
||||
$new_param['belong_merchant'] = $this->mch_id;
|
||||
break;
|
||||
case 2:
|
||||
$new_param['belong_merchant'] = $this->son_mch_id;
|
||||
break;
|
||||
}
|
||||
$data = [
|
||||
'mch_id' => $this->mch_id,
|
||||
'serial_no' => $this->serial_no,
|
||||
'apiclient_key' => $this->apiclient_key,
|
||||
'data' => $new_param
|
||||
];
|
||||
$WxPayV3Class = new WxPayV3($data);
|
||||
$result = $WxPayV3Class->createShopCoupon();
|
||||
file_put_contents('./shop_coupon.txt', $result . PHP_EOL, FILE_APPEND);
|
||||
$result = json_decode($result, true);
|
||||
if (!empty($result['stock_id'])) {
|
||||
$param['stock_id'] = $result['stock_id'];
|
||||
$param['out_request_no'] = $new_param['out_request_no'];
|
||||
$result = $this->addCoupon($param); //存入表
|
||||
return $result;
|
||||
} else {
|
||||
return callBack(statusCode()['error'], $result['message']);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 创建商家券存表
|
||||
* @param $param
|
||||
* [
|
||||
* merchant_id
|
||||
* operator_id
|
||||
* data=>[
|
||||
* store_id_gather 门店集合
|
||||
* user_type 1普通支付模式 2服务商支付模式
|
||||
* type 1小程序 2公众号
|
||||
* stock_name 名称
|
||||
* goods_name 适用商品范围
|
||||
* stock_type 1满减 2折扣 3换购
|
||||
* available_time 有效时间
|
||||
* valid_time_type 生效时间类型
|
||||
* coupon_use_rule=>[
|
||||
* fixed_normal_coupon=>[
|
||||
* discount_amount 优惠金额
|
||||
* transaction_minimum 门槛
|
||||
* ],
|
||||
* coupon_available_time=>[
|
||||
* available_week=>[
|
||||
* week_day=>[],
|
||||
* available_day_time=>[
|
||||
* begin_time
|
||||
* end_time
|
||||
* ],
|
||||
* ]
|
||||
* irregulary_avaliable_time=>[
|
||||
* begin_time
|
||||
* end_time
|
||||
* ]
|
||||
* ]
|
||||
* ],
|
||||
* stock_send_rule=>[
|
||||
* max_amount 批次总预算
|
||||
* max_coupons_per_user 用户最大可领个数
|
||||
* ],
|
||||
* display_pattern_info=>[
|
||||
* merchant_name 商户名称
|
||||
* ]
|
||||
* ]
|
||||
* ]
|
||||
* @return mixed
|
||||
*/
|
||||
public function addCoupon($param)
|
||||
{
|
||||
$data = $param['data'];
|
||||
$discount_amount = $data['coupon_use_rule']['fixed_normal_coupon']['discount_amount'];
|
||||
$max_amount = $data['stock_send_rule']['max_amount'];
|
||||
$coupon_num = intval(floor($max_amount / $discount_amount));
|
||||
$data['coupon_use_rule']['coupon_available_time']['available_begin_time'] = $data['available_time'][0];
|
||||
$data['coupon_use_rule']['coupon_available_time']['available_end_time'] = $data['available_time'][1];
|
||||
$content = [
|
||||
'merchant_id' => $param['merchant_id'],
|
||||
'app_id' => $this->appid,
|
||||
'operator_id' => $param['operator_id'],
|
||||
'belong_merchant' => $this->mch_id,
|
||||
'stock_id' => $param['stock_id'],
|
||||
'user_type' => $data['user_type'],
|
||||
'type' => $data['type'],
|
||||
'stock_name' => $data['stock_name'],
|
||||
'goods_name' => $data['goods_name'],
|
||||
'stock_type' => $data['stock_type'],
|
||||
'available_begin_time' => strtotime($data['coupon_use_rule']['coupon_available_time']['available_begin_time']),
|
||||
'available_end_time' => strtotime($data['coupon_use_rule']['coupon_available_time']['available_end_time']),
|
||||
'valid_time_type' => $data['valid_time_type'] ? $data['valid_time_type'] : 0,
|
||||
'coupon_use_rule' => json_encode($data['coupon_use_rule']),
|
||||
'stock_send_rule' => json_encode($data['stock_send_rule']),
|
||||
'display_pattern_info' => json_encode($data['display_pattern_info']),
|
||||
'create_time' => time(),
|
||||
'out_request_no' => $param['out_request_no'],
|
||||
'store_type' => $data['store_type'],
|
||||
'goods_type' => $data['goods_type'],
|
||||
'available_type' => implode(',', $data['available_type']),
|
||||
'coupon_num' => $coupon_num,
|
||||
'operation_num' => $coupon_num
|
||||
];
|
||||
if (!empty($data['store_id_gather'])) {
|
||||
$content['store_id_gather'] = implode(',', $data['store_id_gather']);
|
||||
}
|
||||
if (!empty($data['goodsList'])) {
|
||||
$content['goods_list'] = json_encode($data['goodsList']);
|
||||
$content['goods_id_gather'] = implode(',', array_column($data['goodsList'], 'goods_id'));
|
||||
}
|
||||
if (!empty($data['logo_image'])) {
|
||||
$content['logo_image'] = $data['logo_image'];
|
||||
}
|
||||
$ShopCouponModel = new ShopCouponModel();
|
||||
$coupon_id = $ShopCouponModel->addOrder($content);
|
||||
if (!empty($coupon_id)) {
|
||||
return callBack(statusCode()['success'], "添加成功");
|
||||
} else {
|
||||
return callBack(statusCode()['error'], "创建成功,记录添加失败");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 创建商家券参数转换
|
||||
* @param $param
|
||||
* [
|
||||
* merchant_id
|
||||
* operator_id
|
||||
* data=>[
|
||||
* store_id_gather 门店集合
|
||||
* user_type 1普通支付模式 2服务商支付模式
|
||||
* type 1小程序 2公众号
|
||||
* stock_name 名称
|
||||
* goods_name 适用商品范围
|
||||
* stock_type 1满减 2折扣 3换购
|
||||
* available_time 有效时间
|
||||
* valid_time_type 生效时间类型
|
||||
* coupon_use_rule=>[
|
||||
* fixed_normal_coupon=>[
|
||||
* discount_amount 优惠金额
|
||||
* transaction_minimum 门槛
|
||||
* ],
|
||||
* coupon_available_time=>[
|
||||
* available_week=>[
|
||||
* week_day=>[],
|
||||
* available_day_time=>[
|
||||
* begin_time
|
||||
* end_time
|
||||
* ],
|
||||
* ]
|
||||
* irregulary_avaliable_time=>[
|
||||
* begin_time
|
||||
* end_time
|
||||
* ]
|
||||
* ]
|
||||
* ],
|
||||
* stock_send_rule=>[
|
||||
* max_amount 批次总预算
|
||||
* max_coupons_per_user 用户最大可领个数
|
||||
* ],
|
||||
* display_pattern_info=>[
|
||||
* merchant_name 商户名称
|
||||
* ]
|
||||
* ]
|
||||
* ]
|
||||
* @return mixed
|
||||
*/
|
||||
public function createCouponReplace($param)
|
||||
{
|
||||
$new_param = $param['data'];
|
||||
switch ($new_param['stock_type']) {
|
||||
case 1:
|
||||
$new_param['stock_type'] = 'NORMAL';
|
||||
break;
|
||||
case 2:
|
||||
$new_param['stock_type'] = 'DISCOUNT';
|
||||
break;
|
||||
case 3:
|
||||
$new_param['stock_type'] = 'EXCHANGE';
|
||||
break;
|
||||
}
|
||||
if (!empty($new_param['coupon_use_rule']['coupon_available_time']['available_day_after_receive'])) {
|
||||
$new_param['coupon_use_rule']['coupon_available_time']['available_day_after_receive'] = intval($new_param['coupon_use_rule']['coupon_available_time']['available_day_after_receive']);
|
||||
} else {
|
||||
unset($new_param['coupon_use_rule']['coupon_available_time']['available_day_after_receive']);
|
||||
}
|
||||
if (!empty($new_param['valid_time_type'])) {
|
||||
switch ($new_param['valid_time_type']) {
|
||||
case 1:
|
||||
//无规律时间段
|
||||
$new_param['coupon_use_rule']['coupon_available_time']['irregulary_avaliable_time'][] = ['begin_time' => $new_param['coupon_use_rule']['coupon_available_time']['irregulary_avaliable_time']['irregular_time'][0] . '+08:00', 'end_time' => $new_param['coupon_use_rule']['coupon_available_time']['irregulary_avaliable_time']['irregular_time'][1] . '+08:00'];
|
||||
unset($new_param['coupon_use_rule']['coupon_available_time']['available_week']);
|
||||
unset($new_param['coupon_use_rule']['coupon_available_time']['wait_days_after_receive']);
|
||||
break;
|
||||
case 2:
|
||||
//固定周期
|
||||
$time = strtotime(date('Y-m-d', time()));
|
||||
$new_param['coupon_use_rule']['coupon_available_time']['available_week']['available_day_time'][] = ['begin_time' => strtotime($new_param['coupon_use_rule']['coupon_available_time']['available_week']['available_day_time']['begin_time']) - $time, 'end_time' => strtotime($new_param['coupon_use_rule']['coupon_available_time']['available_week']['available_day_time']['end_time']) - $time];
|
||||
if (empty($new_param['coupon_use_rule']['coupon_available_time']['available_week']['week_day'])) {
|
||||
unset($new_param['coupon_use_rule']['coupon_available_time']['available_week']['week_day']);
|
||||
} else {
|
||||
$new_param['coupon_use_rule']['coupon_available_time']['available_week']['week_day'] = array_map('int', $new_param['coupon_use_rule']['coupon_available_time']['available_week']['week_day']);
|
||||
}
|
||||
unset($new_param['coupon_use_rule']['coupon_available_time']['irregulary_avaliable_time']);
|
||||
unset($new_param['coupon_use_rule']['coupon_available_time']['wait_days_after_receive']);
|
||||
unset($new_param['coupon_use_rule']['coupon_available_time']['available_week']['available_day_time']['begin_time']);
|
||||
unset($new_param['coupon_use_rule']['coupon_available_time']['available_week']['available_day_time']['end_time']);
|
||||
break;
|
||||
case 3:
|
||||
//领取后N天开始生效
|
||||
$new_param['coupon_use_rule']['coupon_available_time']['wait_days_after_receive'] = intval($new_param['coupon_use_rule']['coupon_available_time']['wait_days_after_receive']);
|
||||
unset($new_param['coupon_use_rule']['coupon_available_time']['irregulary_avaliable_time']);
|
||||
unset($new_param['coupon_use_rule']['coupon_available_time']['available_week']);
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
unset($new_param['coupon_use_rule']['coupon_available_time']);
|
||||
}
|
||||
$new_param['coupon_use_rule']['fixed_normal_coupon']['discount_amount'] = $new_param['coupon_use_rule']['fixed_normal_coupon']['discount_amount'] * 100;
|
||||
$new_param['coupon_use_rule']['fixed_normal_coupon']['transaction_minimum'] = $new_param['coupon_use_rule']['fixed_normal_coupon']['transaction_minimum'] * 100;
|
||||
$new_param['stock_send_rule']['max_amount'] = $new_param['stock_send_rule']['max_amount'] * 100;
|
||||
$new_param['stock_send_rule']['max_coupons_per_user'] = intval($new_param['stock_send_rule']['max_coupons_per_user']);
|
||||
$new_param['coupon_use_rule']['coupon_available_time']['available_begin_time'] = $new_param['available_time'][0] . '+08:00';
|
||||
$new_param['coupon_use_rule']['coupon_available_time']['available_end_time'] = $new_param['available_time'][1] . '+08:00';
|
||||
if (count($param['data']['available_type']) > 1 || in_array(2, $param['data']['available_type'])) {
|
||||
$new_param['coupon_use_rule']['use_method'] = 'PAYMENT_CODE'; //线下实体店
|
||||
} else {
|
||||
$new_param['coupon_use_rule']['use_method'] = 'MINI_PROGRAMS';
|
||||
}
|
||||
$new_param['coupon_use_rule']['mini_programs_appid'] = $this->xcx_appid;
|
||||
$new_param['coupon_use_rule']['mini_programs_path'] = $this->path;
|
||||
$new_param['out_request_no'] = createOrderTradeNo($param['merchant_id']); //随机字符串
|
||||
$new_param['coupon_code_mode'] = 'WECHATPAY_MODE';
|
||||
$new_param['custom_entrance']['code_display_mode'] = 'BARCODE';
|
||||
$new_param['custom_entrance']['mini_programs_info']['mini_programs_appid'] = $this->xcx_appid;
|
||||
$new_param['custom_entrance']['mini_programs_info']['mini_programs_path'] = $this->path;
|
||||
$new_param['custom_entrance']['mini_programs_info']['entrance_words'] = '欢迎选购';
|
||||
$new_param['custom_entrance']['appid'] = $this->wx_appid;
|
||||
if (empty($new_param['display_pattern_info']['merchant_name'])) {
|
||||
unset($new_param['display_pattern_info']['merchant_name']);
|
||||
}
|
||||
switch ($new_param['user_type']) {
|
||||
case 1:
|
||||
//普通
|
||||
$image_path = 'shop_coupon_simple_wx_image';
|
||||
break;
|
||||
case 2:
|
||||
//服务商
|
||||
$image_path = 'shop_coupon_service_wx_image';
|
||||
break;
|
||||
}
|
||||
$configModel = new RetailMerchantConfigModel();
|
||||
$merchant_logo_url = $configModel->getFindField([
|
||||
'merchant_id' => $param['merchant_id']
|
||||
], $image_path);
|
||||
if (!empty($merchant_logo_url)) {
|
||||
$new_param['display_pattern_info']['merchant_logo_url'] = $merchant_logo_url;
|
||||
}
|
||||
$description = '不能与其他优惠券同时使用, '; //使用须知
|
||||
if ($new_param['stock_type'] == 2) {
|
||||
$StoreClass = new Store();
|
||||
$storeResult = $StoreClass->storeNameList([
|
||||
'store_id_gather' => $new_param['store_id_gather']
|
||||
]);
|
||||
if ($storeResult['status'] == 1) {
|
||||
$description .= '可使用门店为' . implode(',', $storeResult['data']['list']) . ' ';
|
||||
}
|
||||
}
|
||||
if (count($new_param['available_type']) > 1) {
|
||||
$description .= '支持小程序商城与实体店使用 ';
|
||||
} else {
|
||||
if (in_array(1, $new_param['available_type'])) {
|
||||
$description .= '支持小程序商城使用 ';
|
||||
}
|
||||
if (in_array(2, $new_param['available_type'])) {
|
||||
$description .= '支持实体店使用 ';
|
||||
}
|
||||
}
|
||||
if ($new_param['goods_type'] == 1) {
|
||||
$description .= '针对全部商品';
|
||||
} else if ($new_param['goods_type'] == 2) {
|
||||
$goods_name = array_column($new_param['goodsList'], 'goods_name');
|
||||
$description .= '针对' . implode(',', $goods_name) . '商品';
|
||||
}
|
||||
$new_param['display_pattern_info']['description'] = $description;
|
||||
unset($new_param['goodsList']);
|
||||
unset($new_param['store_id_gather']);
|
||||
unset($new_param['store_type']);
|
||||
unset($new_param['goods_type']);
|
||||
unset($new_param['user_type']);
|
||||
unset($new_param['type']);
|
||||
unset($new_param['available_time']);
|
||||
unset($new_param['valid_time_type']);
|
||||
unset($new_param['coupon_use_rule']['coupon_available_time']['irregulary_avaliable_time']['irregular_time']);
|
||||
unset($new_param['available_type']);
|
||||
// print_r($new_param);exit;
|
||||
return $new_param;
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 创建商家券的参数验证
|
||||
* @param $param
|
||||
* [
|
||||
* merchant_id
|
||||
* operator_id
|
||||
* data=>[
|
||||
* store_id_gather 门店集合
|
||||
* user_type 1普通支付模式 2服务商支付模式
|
||||
* type 1小程序 2公众号
|
||||
* stock_name 名称
|
||||
* goods_name 适用商品范围
|
||||
* stock_type 1满减 2折扣 3换购
|
||||
* available_time 有效时间
|
||||
* valid_time_type 生效时间类型
|
||||
* coupon_use_rule=>[
|
||||
* fixed_normal_coupon=>[
|
||||
* discount_amount 优惠金额
|
||||
* transaction_minimum 门槛
|
||||
* ],
|
||||
* coupon_available_time=>[
|
||||
* available_week=>[
|
||||
* week_day=>[],
|
||||
* available_day_time=>[
|
||||
* begin_time
|
||||
* end_time
|
||||
* ],
|
||||
* ]
|
||||
* irregulary_avaliable_time=>[
|
||||
* begin_time
|
||||
* end_time
|
||||
* ]
|
||||
* ]
|
||||
* ],
|
||||
* stock_send_rule=>[
|
||||
* max_amount 批次总预算
|
||||
* max_coupons_per_user 用户最大可领个数
|
||||
* ],
|
||||
* display_pattern_info=>[
|
||||
* merchant_name 商户名称
|
||||
* ]
|
||||
* ]
|
||||
* ]
|
||||
* @return mixed
|
||||
*/
|
||||
public function createCouponVerify($param)
|
||||
{
|
||||
$reg = "/^[+]{0,1}(\d+)$|^[+]{0,1}(\d+\.\d{0,2})$/";
|
||||
$reg2 = "/^\+?[0-9][0-9]*$/";
|
||||
if (empty($param['merchant_id']) || empty($param['operator_id'])) {
|
||||
return callBack(statusCode()['error'], "登录超时");
|
||||
}
|
||||
if (empty($this->mch_id) || empty($this->serial_no) || empty($this->apiclient_key)) {
|
||||
return callBack(statusCode()['error'], "请检查支付配置,商户号,Api证书号,私钥证书");
|
||||
}
|
||||
$data = $param['data'];
|
||||
$discount_amount = $data['coupon_use_rule']['fixed_normal_coupon']['discount_amount'];
|
||||
$transaction_minimum = $data['coupon_use_rule']['fixed_normal_coupon']['transaction_minimum'];
|
||||
$max_amount = $data['stock_send_rule']['max_amount'];
|
||||
$max_coupons_per_user = $data['stock_send_rule']['max_coupons_per_user'];
|
||||
if (empty($data['available_type'])) return callBack(statusCode()['error'], "请选择可用场景");
|
||||
if (empty($data['stock_type'])) return callBack(statusCode()['error'], "请选择商家券类型");
|
||||
if (empty($data['stock_name'])) return callBack(statusCode()['error'], "请输入商家券名称");
|
||||
if (strlen($data['stock_name']) > 20) return callBack(statusCode()['error'], "商家券名称最多20个字符");
|
||||
if (empty($data['goods_name'])) return callBack(statusCode()['error'], "请输入适用商品范围");
|
||||
if (strlen($data['goods_name']) > 15) return callBack(statusCode()['error'], "适用商品范围最多15个字符");
|
||||
switch ($data['stock_type']) {
|
||||
case 1:
|
||||
//满减券
|
||||
if (empty($discount_amount) || $discount_amount < 0.01 || $discount_amount > 100000 || !preg_match($reg, $discount_amount)) {
|
||||
return callBack(statusCode()['error'], "请输入正确优惠金额");
|
||||
}
|
||||
if (empty($transaction_minimum) || $transaction_minimum <= $discount_amount || $transaction_minimum > 100000 || !preg_match($reg, $transaction_minimum)) {
|
||||
return callBack(statusCode()['error'], "请输入正确消费门槛");
|
||||
}
|
||||
if (empty($max_amount) || $max_amount < 0.01 || $max_amount > 1000000000 || !preg_match($reg, $max_amount)) {
|
||||
return callBack(statusCode()['error'], "请输入正确批次总预算");
|
||||
}
|
||||
if (intval($max_amount * 10000 / ($discount_amount * 10000)) != ($max_amount * 10000 / ($discount_amount * 10000))) {
|
||||
return callBack(statusCode()['error'], "总预算必须能除尽优惠金额");
|
||||
}
|
||||
break;
|
||||
}
|
||||
if (empty($max_coupons_per_user) || $max_coupons_per_user < 1 || $max_coupons_per_user > 100 || !preg_match($reg2, $max_coupons_per_user)) {
|
||||
return callBack(statusCode()['error'], "请输入正确用户最大可领个数");
|
||||
}
|
||||
if (empty($data['available_time'])) {
|
||||
return callBack(statusCode()['error'], "请选择券可核销时间");
|
||||
}
|
||||
if (!empty($data['coupon_use_rule']['coupon_available_time']['available_day_after_receive']) && !preg_match($reg2, $data['coupon_use_rule']['coupon_available_time']['available_day_after_receive'])) {
|
||||
return callBack(statusCode()['error'], "请输入正确的生效后N天内有效");
|
||||
}
|
||||
if (!empty($data['valid_time_type'])) {
|
||||
switch ($data['valid_time_type']) {
|
||||
case 1:
|
||||
if (empty($data['coupon_use_rule']['coupon_available_time']['irregulary_avaliable_time']['irregular_time'])) {
|
||||
return callBack(statusCode()['error'], "请选择无规律有效时间段");
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
if (empty($data['coupon_use_rule']['coupon_available_time']['available_week']['available_day_time']['begin_time']) || empty($data['coupon_use_rule']['coupon_available_time']['available_week']['available_day_time']['end_time'])) {
|
||||
return callBack(statusCode()['error'], "请选择固定周期有效时间段");
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
if (empty($data['coupon_use_rule']['coupon_available_time']['wait_days_after_receive']) || !preg_match($reg2, $data['coupon_use_rule']['coupon_available_time']['wait_days_after_receive'])) {
|
||||
return callBack(statusCode()['error'], "请输入领取后N天开始生效");
|
||||
}
|
||||
if (empty($data['coupon_use_rule']['coupon_available_time']['available_day_after_receive'])) {
|
||||
return callBack(statusCode()['error'], "该类型必须与生效后N天内有效一起使用");
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
switch ($data['store_type']) {
|
||||
case 1:
|
||||
if ($data['goods_type'] != 1) {
|
||||
return callBack(statusCode()['error'], "所有门店必须选择所有商品");
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
if (count($data['store_id_gather']) == 0) {
|
||||
return callBack(statusCode()['error'], "请选择门店");
|
||||
}
|
||||
if ($data['goods_type'] == 2) {
|
||||
if (count($data['store_id_gather']) != 1) {
|
||||
return callBack(statusCode()['error'], "该类型只能选择一个门店");
|
||||
}
|
||||
if (count($data['goodsList']) == 0) {
|
||||
return callBack(statusCode()['error'], "请选择商品");
|
||||
}
|
||||
if (count($data['goodsList']) > 20) {
|
||||
return callBack(statusCode()['error'], "最多只能选择20种商品");
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
return callBack(statusCode()['success'], "验证成功");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,328 @@
|
||||
<?php
|
||||
|
||||
namespace ShopCoupon\Business;
|
||||
|
||||
use Common\Business\Store;
|
||||
use Common\Model\JurisdictionUserModel;
|
||||
use Common\Model\RetailStoreModel;
|
||||
use ShopCoupon\Model\ShopCouponModel;
|
||||
use ShopCoupon\Model\ShopCouponRecordModel;
|
||||
|
||||
/**
|
||||
* 商家券列表类
|
||||
* Class ShopCouponRecord
|
||||
* [
|
||||
* 发放记录列表 recordList
|
||||
* 发放记录列表的where条件 recordListTerm
|
||||
* 商家券详情 couponInfo
|
||||
* 商家券列表 couponList
|
||||
* 商家券列表的where条件 couponListTerm
|
||||
* 门店列表 getStoreList
|
||||
* ]
|
||||
* @package ShopCoupon\Business
|
||||
*/
|
||||
class ShopCouponRecord
|
||||
{
|
||||
/**
|
||||
* 发放记录列表
|
||||
* @param $param
|
||||
* [
|
||||
* merchant_id
|
||||
* page
|
||||
* limit
|
||||
* searchText 会员名称/商家券名称/手机号/发放的商家券ID
|
||||
* wechatpay_use_time 核销日期
|
||||
* verification_store_id 核销门店
|
||||
* verification_available_type 核销门店
|
||||
* use_type 使用状态
|
||||
* verification_type 核销状态
|
||||
* ]
|
||||
* @return mixed
|
||||
*/
|
||||
public function recordList($param)
|
||||
{
|
||||
$where = $this->recordListTerm($param);
|
||||
$page = $param['page'] ? $param['page'] : 1;
|
||||
$limit = $param['limit'] ? $param['limit'] : 10;
|
||||
$fields = 'c.user_type,c.available_type,c.stock_name,c.stock_type,r.stock_id,r.openid,v.name,v.nickname,v.mobile_phone
|
||||
,r.add_time,s.storetag,r.verification_available_type,j.name as operator_name,r.wechatpay_use_time,r.verification_store_id';
|
||||
try {
|
||||
$ShopCouponRecordModel = new ShopCouponRecordModel();
|
||||
$list = $ShopCouponRecordModel->recordList($fields, $where, $page, $limit);
|
||||
} catch (\Exception $e) {
|
||||
return callBack(statusCode()['success'], "查询成功", ['list' => [], 'count' => 0]);
|
||||
}
|
||||
if ($list) {
|
||||
$count = $ShopCouponRecordModel->recordCount($where);
|
||||
$storeModel = new RetailStoreModel();
|
||||
foreach ($list as $key => &$val) {
|
||||
$val['index'] = $key + 1;
|
||||
$val['vip_name'] = $val['name'] ? $val['name'] : $val['nickname'];
|
||||
$val['add_time'] = date('Y-m-d H:i:s', $val['add_time']);
|
||||
if (!empty($val['verification_store_id'])) {
|
||||
$val['use_storetag'] = $storeModel->getFindField([
|
||||
'id' => $val['verification_store_id']
|
||||
], 'storetag');
|
||||
} else {
|
||||
$val['use_storetag'] = '';
|
||||
}
|
||||
$available_type = explode(',', $val['available_type']);
|
||||
$val['available_type_name'] = '';
|
||||
if (in_array(1, $available_type)) {
|
||||
$val['available_type_name'] .= '线上';
|
||||
}
|
||||
if (in_array(2, $available_type)) {
|
||||
$val['available_type_name'] .= '线下';
|
||||
}
|
||||
if (!empty($val['wechatpay_use_time'])) {
|
||||
$val['wechatpay_use_time'] = date('Y-m-d H:i:s', $val['wechatpay_use_time']);
|
||||
}
|
||||
switch ($val['user_type']) {
|
||||
case 1:
|
||||
$val['user_type_name'] = '普通支付模式';
|
||||
break;
|
||||
case 2:
|
||||
$val['user_type_name'] = '服务商支付模式';
|
||||
break;
|
||||
}
|
||||
switch ($val['stock_type']) {
|
||||
case 1:
|
||||
$val['stock_type_name'] = '满减券';
|
||||
break;
|
||||
case 2:
|
||||
$val['stock_type_name'] = '折扣券';
|
||||
break;
|
||||
case 3:
|
||||
$val['stock_type_name'] = '换购券';
|
||||
break;
|
||||
}
|
||||
switch ($val['verification_available_type']) {
|
||||
case 1:
|
||||
$val['verification_available_name'] = '线上';
|
||||
break;
|
||||
case 2:
|
||||
$val['verification_available_name'] = '线下';
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return callBack(statusCode()['success'], "查询成功", ['list' => $list, 'count' => $count ? $count : 0]);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 发放记录列表的where条件
|
||||
* @param $param
|
||||
* [
|
||||
* merchant_id
|
||||
* page
|
||||
* limit
|
||||
* searchText 会员名称/商家券名称/手机号/发放的商家券ID
|
||||
* wechatpay_use_time 核销日期
|
||||
* verification_store_id 核销门店
|
||||
* verification_available_type 核销场景
|
||||
* use_type 使用状态
|
||||
* verification_type 核销状态
|
||||
* ]
|
||||
* @return mixed
|
||||
*/
|
||||
public function recordListTerm($param)
|
||||
{
|
||||
if (!empty($param['searchText'])) {
|
||||
$param['searchText'] = trim($param['searchText']);
|
||||
$where['v.mobile_phone|v.nickname|v.name|c.stock_name|r.stock_id'] = ["like", "%{$param['searchText']}%"];
|
||||
}
|
||||
if (!empty($param['wechatpay_use_time'])) {
|
||||
$start_time = strtotime($param['wechatpay_use_time'][0] . '00:00:00');
|
||||
$end_time = strtotime($param['wechatpay_use_time'][1] . '23:59:59');
|
||||
$where['r.wechatpay_use_time'] = ['between', [$start_time, $end_time]];
|
||||
}
|
||||
if (!empty($param['use_type'])) {
|
||||
$where['r.used_type'] = $param['use_type'];
|
||||
}
|
||||
if (!empty($param['verification_type'])) {
|
||||
$where['r.verification_type'] = $param['verification_type'];
|
||||
}
|
||||
if (!empty($param['verification_store_id'])) {
|
||||
$where['r.verification_store_id'] = $param['verification_store_id'];
|
||||
}
|
||||
if (!empty($param['verification_available_type'])) {
|
||||
$where['r.verification_available_type'] = $param['verification_available_type'];
|
||||
}
|
||||
$where['r.merchant_id'] = $param['merchant_id'];
|
||||
if(!empty($param['available_type'])){
|
||||
$where['c.available_type'] = implode(',',$param['available_type']);
|
||||
}
|
||||
return $where;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 商家券详情
|
||||
* @param $param
|
||||
* [
|
||||
* merchant_id
|
||||
* id 商家券id
|
||||
* ]
|
||||
* @return mixed
|
||||
*/
|
||||
public function couponInfo($param)
|
||||
{
|
||||
if (empty($param['merchant_id']) || empty($param['id'])) {
|
||||
return callBack(statusCode()['error'], '参数缺失');
|
||||
}
|
||||
$where = [
|
||||
'merchant_id' => $param['merchant_id'],
|
||||
'id' => $param['id']
|
||||
];
|
||||
$fields = 'stock_name,goods_name,stock_type,coupon_use_rule,stock_send_rule,display_pattern_info,valid_time_type,user_type,store_id_gather,store_type,goods_type,goods_list,available_type,type';
|
||||
try {
|
||||
$ShopCouponModel = new ShopCouponModel();
|
||||
$info = $ShopCouponModel->getFind($where, $fields);
|
||||
$info['user_type'] = intval($info['user_type']);
|
||||
$info['type'] = intval($info['type']);
|
||||
$info['available_type'] = array_map('int', explode(',', $info['available_type']));;
|
||||
$info['coupon_use_rule'] = json_decode($info['coupon_use_rule'], true);
|
||||
$info['available_time'][] = $info['coupon_use_rule']['coupon_available_time']['available_begin_time'];
|
||||
$info['available_time'][] = $info['coupon_use_rule']['coupon_available_time']['available_end_time'];
|
||||
$info['stock_send_rule'] = json_decode($info['stock_send_rule'], true);
|
||||
$info['display_pattern_info'] = json_decode($info['display_pattern_info'], true);
|
||||
$info['store_id_gather'] = explode(',', $info['store_id_gather']);
|
||||
if (!empty($info['goods_list'])) {
|
||||
$info['goodsList'] = json_decode($info['goods_list'], true);
|
||||
}
|
||||
return callBack(statusCode()['success'], "查询成功", ['info' => $info]);
|
||||
} catch (\Exception $e) {
|
||||
return callBack(statusCode()['success'], "查询成功", ['info' => []]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 商家券列表
|
||||
* @param $param
|
||||
* [
|
||||
* merchant_id
|
||||
* stock_name
|
||||
* suspend_status
|
||||
* add_time
|
||||
* ]
|
||||
* @return mixed
|
||||
*/
|
||||
public function couponList($param)
|
||||
{
|
||||
$where = $this->couponListTerm($param);
|
||||
$page = $param['page'] ? $param['page'] : 1;
|
||||
$limit = $param['limit'] ? $param['limit'] : 10;
|
||||
$fields = "id,user_type,type,stock_type,stock_id,stock_name,stock_send_rule,coupon_use_rule,operator_id,suspend_status,available_type,coupon_num,operation_num,store_id_gather,store_type";
|
||||
try {
|
||||
$shopCouponModel = new ShopCouponModel();
|
||||
$list = $shopCouponModel->getSelect($where, $fields, 'id desc', $page . ',' . $limit);
|
||||
} catch (\Exception $e) {
|
||||
return callBack(statusCode()['success'], "查询成功", ['list' => [], 'count' => 0]);
|
||||
}
|
||||
if ($list) {
|
||||
$count = $shopCouponModel->getCount($where);
|
||||
$JurisdictionUserModel = new JurisdictionUserModel();
|
||||
foreach ($list as $key => &$val) {
|
||||
$val['index'] = $key + 1;
|
||||
switch ($val['user_type']) {
|
||||
case 1:
|
||||
$val['user_name'] = '普通支付模式';
|
||||
break;
|
||||
case 2:
|
||||
$val['user_name'] = '服务商支付模式';
|
||||
break;
|
||||
}
|
||||
switch ($val['type']) {
|
||||
case 1:
|
||||
$val['type_name'] = '小程序';
|
||||
break;
|
||||
case 2:
|
||||
$val['type_name'] = '公众号';
|
||||
break;
|
||||
}
|
||||
switch ($val['stock_type']) {
|
||||
case 1:
|
||||
$val['stock_type_name'] = '满减券';
|
||||
break;
|
||||
case 2:
|
||||
$val['stock_type_name'] = '折扣券';
|
||||
break;
|
||||
case 3:
|
||||
$val['stock_type_name'] = '换购券';
|
||||
break;
|
||||
}
|
||||
switch ($val['suspend_status']) {
|
||||
case 1:
|
||||
$val['suspend_name'] = '正在发放';
|
||||
break;
|
||||
case 2:
|
||||
$val['suspend_name'] = '暂停发放';
|
||||
break;
|
||||
}
|
||||
$available_type = explode(',', $val['available_type']);
|
||||
$val['available_name'] = '';
|
||||
if (in_array(1, $available_type)) {
|
||||
$val['available_name'] .= '线上';
|
||||
}
|
||||
if (in_array(2, $available_type)) {
|
||||
$val['available_name'] .= '线下';
|
||||
}
|
||||
$coupon_use_rule = json_decode($val['coupon_use_rule'], true);
|
||||
$stock_send_rule = json_decode($val['stock_send_rule'], true);
|
||||
$val['coupon_available_time'] = $coupon_use_rule['coupon_available_time']['available_begin_time'] . '-' . $coupon_use_rule['coupon_available_time']['available_end_time'];
|
||||
$val['max_amount'] = round($stock_send_rule['max_amount'], 2);
|
||||
$val['operator_name'] = $JurisdictionUserModel->getFindField(['id' => $val['operator_id']], "name");
|
||||
}
|
||||
}
|
||||
return callBack(statusCode()['success'], "查询成功", ['list' => $list, 'count' => $count ? $count : 0]);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 商家券列表的where条件
|
||||
* @param $param
|
||||
* [
|
||||
* merchant_id
|
||||
* stock_name
|
||||
* suspend_status
|
||||
* add_time
|
||||
* ]
|
||||
* @return mixed
|
||||
*/
|
||||
public function couponListTerm($param)
|
||||
{
|
||||
if (!empty($param['stock_name'])) {
|
||||
$param['stock_name'] = trim($param['stock_name']);
|
||||
$where['stock_name|stock_id'] = ["like", "%{$param['stock_name']}%"];
|
||||
}
|
||||
if (!empty($param['suspend_status'])) {
|
||||
$where['suspend_status'] = $param['suspend_status'];
|
||||
}
|
||||
if (!empty($param['stock_type'])) {
|
||||
$where['stock_type'] = $param['stock_type'];
|
||||
}
|
||||
if (!empty($param['add_time'])) {
|
||||
$start_time = strtotime($param['add_time'][0]);
|
||||
$end_time = strtotime($param['add_time'][1]);
|
||||
$where['create_time'] = ['between', [$start_time, $end_time]];
|
||||
}
|
||||
$where['merchant_id'] = $param['merchant_id'];
|
||||
$where['status'] = 1;
|
||||
return $where;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 门店列表
|
||||
* @param $param
|
||||
* @return mixed
|
||||
*/
|
||||
public function getStoreList($param)
|
||||
{
|
||||
$storeClass = new Store();
|
||||
$list = $storeClass->getStoreList($param);
|
||||
return callBack(statusCode()['success'], "查询成功", ['list' => $list]);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,217 @@
|
||||
<?php
|
||||
|
||||
namespace ShopCoupon\Controller;
|
||||
|
||||
use Common\Business\DownFile;
|
||||
use Common\Business\Goods;
|
||||
use Common\Business\GoodsClassify;
|
||||
use Common\Model\RetailMerchantConfigModel;
|
||||
use Common\Model\RetailPaySetModel;
|
||||
use Retail\Controller\BaseController;
|
||||
use ShopCoupon\Business\ShopCoupon;
|
||||
use ShopCoupon\Business\ShopCouponRecord;
|
||||
|
||||
class IndexController extends BaseController
|
||||
{
|
||||
public function index()
|
||||
{
|
||||
$arr = [
|
||||
'search' => '/index.php/ShopCoupon/Index/index',
|
||||
'coupon' => '/index.php/ShopCoupon/Index/createCoupon',
|
||||
'coupon_info' => '/index.php/ShopCoupon/Index/couponInfo',
|
||||
'suspendOperation' => '/index.php/ShopCoupon/Index/suspendOperation',
|
||||
'deleteOperation' => '/index.php/ShopCoupon/Index/deleteOperation',
|
||||
'record' => '/index.php/ShopCoupon/Index/record',
|
||||
'download'=>'/index.php/ShopCoupon/Index/downloadCoupon'
|
||||
];
|
||||
$authArr = checkFunction($arr);
|
||||
$this->assign('auth', $authArr);
|
||||
$paySetModel = new RetailPaySetModel();
|
||||
$paySet = $paySetModel->getFindMerchantPaySet($this->merchant_id);
|
||||
$ordinary_pay_state = false; //普通支付模式
|
||||
$service_pay_state = false; //服务商支付模式
|
||||
if (!empty($paySet['config']['xcx_mer_id'])) {
|
||||
//普通支付模式
|
||||
$ordinary_pay_state = true;
|
||||
}
|
||||
if (!empty($paySet['config']['systemConfig']['mch_id'])) {
|
||||
//服务商支付模式
|
||||
$service_pay_state = true;
|
||||
}
|
||||
$configModel = new RetailMerchantConfigModel();
|
||||
$config = $configModel->getFind([
|
||||
'merchant_id' => $this->merchant_id
|
||||
], "shop_coupon_simple_image,shop_coupon_service_image");
|
||||
$url = ($_SERVER['HTTPS'] === 'on' ? 'https://' : 'http://') . $_SERVER['HTTP_HOST'];
|
||||
if (!empty($config['shop_coupon_simple_image'])) {
|
||||
$shop_coupon_simple_image = $url . $config['shop_coupon_simple_image'];
|
||||
}
|
||||
if (!empty($config['shop_coupon_service_image'])) {
|
||||
$shop_coupon_service_image = $url . $config['shop_coupon_service_image'];
|
||||
}
|
||||
$this->assign('local_img', $shop_coupon_simple_image ? $shop_coupon_simple_image : '');
|
||||
$this->assign('service_img', $shop_coupon_service_image ? $shop_coupon_service_image : '');
|
||||
$this->assign('ordinary_pay_state', $ordinary_pay_state);
|
||||
$this->assign('service_pay_state', $service_pay_state);
|
||||
$this->display();
|
||||
}
|
||||
|
||||
//发放记录
|
||||
public function record()
|
||||
{
|
||||
$data = I('post.');
|
||||
$data['merchant_id'] = $this->merchant_id;
|
||||
$ShopCouponRecordClass = new ShopCouponRecord();
|
||||
$result = $ShopCouponRecordClass->recordList($data);
|
||||
$this->ajaxReturn($result);
|
||||
}
|
||||
|
||||
//查看详情
|
||||
public function couponInfo()
|
||||
{
|
||||
$data = I('post.');
|
||||
$data['merchant_id'] = $this->merchant_id;
|
||||
$ShopCouponRecordClass = new ShopCouponRecord();
|
||||
$result = $ShopCouponRecordClass->couponInfo($data);
|
||||
$this->ajaxReturn($result);
|
||||
}
|
||||
|
||||
//删除
|
||||
public function deleteOperation()
|
||||
{
|
||||
$data = I("post.");
|
||||
$data['operation_type'] = 3;
|
||||
$data['merchant_id'] = $this->merchant_id;
|
||||
$ShopCouponClass = new ShopCoupon();
|
||||
$result = $ShopCouponClass->suspendOperation($data);
|
||||
$this->ajaxReturn($result);
|
||||
}
|
||||
|
||||
//暂停或者发放或者删除
|
||||
public function suspendOperation()
|
||||
{
|
||||
$data = I("post.");
|
||||
$data['merchant_id'] = $this->merchant_id;
|
||||
$ShopCouponClass = new ShopCoupon();
|
||||
$result = $ShopCouponClass->suspendOperation($data);
|
||||
if ($result['status'] == 1) {
|
||||
switch ($data['operation_type']) {
|
||||
case 1:
|
||||
$desc = "发放商家券";
|
||||
break;
|
||||
case 2:
|
||||
$desc = "暂停商家券";
|
||||
break;
|
||||
case 3:
|
||||
$desc = "删除商家券";
|
||||
break;
|
||||
}
|
||||
$param = [
|
||||
'source' => 0,
|
||||
'type' => 3,
|
||||
'request_data' => $_POST,
|
||||
'desc' => $desc
|
||||
];
|
||||
action_log_v2($param);
|
||||
}
|
||||
$this->ajaxReturn($result);
|
||||
}
|
||||
|
||||
//创建商家券
|
||||
public function createCoupon()
|
||||
{
|
||||
$data = json_decode(I('post.add_form'), true);
|
||||
$ShopCouponClass = new ShopCoupon();
|
||||
$result = $ShopCouponClass->createCoupon([
|
||||
'merchant_id' => $this->merchant_id,
|
||||
'operator_id' => session("jurisdiction_user")['id'],
|
||||
'data' => $data
|
||||
]);
|
||||
if ($result['status'] == 1) {
|
||||
$param = [
|
||||
'source' => 0,
|
||||
'type' => 3,
|
||||
'request_data' => $_POST,
|
||||
'desc' => '创建商家券'
|
||||
];
|
||||
action_log_v2($param);
|
||||
}
|
||||
$this->ajaxReturn($result);
|
||||
}
|
||||
|
||||
|
||||
//商家券列表
|
||||
public function CouponList()
|
||||
{
|
||||
$data = I("post.");
|
||||
$data['merchant_id'] = $this->merchant_id;
|
||||
$ShopCouponRecordClass = new ShopCouponRecord();
|
||||
$result = $ShopCouponRecordClass->couponList($data);
|
||||
$this->ajaxReturn($result);
|
||||
}
|
||||
|
||||
//门店商品列表
|
||||
public function storeGoodsList()
|
||||
{
|
||||
$data = I("post.");
|
||||
$goodsClass = new Goods();
|
||||
$result = $goodsClass->getStoreGoodsList($data);
|
||||
$this->ajaxReturn($result);
|
||||
}
|
||||
|
||||
//分类
|
||||
public function getGoodsClass1()
|
||||
{
|
||||
$goodsClass = new GoodsClassify();
|
||||
$result = $goodsClass->getGoodsClassTopLevel($this->merchant_id);
|
||||
$this->ajaxReturn($result);
|
||||
}
|
||||
|
||||
//门店列表
|
||||
public function store()
|
||||
{
|
||||
$shopCouponRecordClass = new ShopCouponRecord();
|
||||
$result = $shopCouponRecordClass->getStoreList([
|
||||
'merchant_id' => $this->merchant_id
|
||||
]);
|
||||
$this->ajaxReturn($result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 上传Logo
|
||||
*/
|
||||
public function uploadWx()
|
||||
{
|
||||
$data = I('post.');
|
||||
$payCouponClass = new ShopCoupon();
|
||||
$result = $payCouponClass->wxUpload([
|
||||
'merchant_id' => $this->merchant_id,
|
||||
'user_type' => $data['user_type']
|
||||
]);
|
||||
$this->ajaxReturn($result);
|
||||
}
|
||||
|
||||
//下载券码
|
||||
public function downloadCoupon()
|
||||
{
|
||||
ini_set('memory_limit', -1);
|
||||
$data = I('post.');
|
||||
$data['merchant_id'] = $this->merchant_id;
|
||||
$ShopCouponClass = new ShopCoupon();
|
||||
$result = $ShopCouponClass->downloadCouponCode($data);
|
||||
$this->ajaxReturn($result);
|
||||
}
|
||||
|
||||
//下载券码压缩包
|
||||
public function downloadCouponZip()
|
||||
{
|
||||
ini_set('memory_limit', -1);
|
||||
$data = I('get.');
|
||||
$data['zip_name'] = 'sjq';
|
||||
$data['file_type'] = 'jpg';
|
||||
$data['store_arr'] = json_decode($data['store_arr'], true);
|
||||
$data['file_name_arr'] = json_decode($data['coupon_arr'], true);
|
||||
$DownFileClass = new DownFile();
|
||||
$DownFileClass->downloadZip($data);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
namespace ShopCoupon\Model;
|
||||
|
||||
use Common\Model\BaseModel;
|
||||
|
||||
class ShopCouponModel extends BaseModel
|
||||
{
|
||||
protected $tableName = 'shop_coupon';
|
||||
protected $fields = [
|
||||
'id',
|
||||
'merchant_id',
|
||||
'app_id', //创券的appid
|
||||
'stock_name', //名称
|
||||
'comment', //备注
|
||||
'belong_merchant', //批次归属商户号
|
||||
'goods_name', //适用范围
|
||||
'stock_type', //批次类型 1为NORMAL固定面额满减券,2为DISCOUNT折扣券使用规则,3为EXCHANGE换购券使用规则
|
||||
'available_begin_time', //开始时间
|
||||
'available_end_time', //结束时间
|
||||
'coupon_use_rule', //核销规则
|
||||
'stock_send_rule', //发放规则
|
||||
'out_request_no', //商户请求单号
|
||||
'custom_entrance', //自定义入口
|
||||
'display_pattern_info', //样式信息
|
||||
'coupon_code_mode', //券code模式券code模式WECHATPAY_MODE:系统分配券code。(固定22位纯数字)MERCHANT_API:商户发放时接口指定券code。MERCHANT_UPLOAD:商户上传自定义code,发券时系统随机选取上传的券code
|
||||
'notify_config', //事件通知配置
|
||||
'valid_time_type', //1 无规律的有效时间段 2固定周期有效时间段
|
||||
'status', //1正常 2删除
|
||||
'stock_id', //创建成功后的批次号
|
||||
'create_time', //创建时间
|
||||
'type', //创建方式1小程序 2公众号
|
||||
'suspend_status', //1允许发放 2暂停发放
|
||||
'user_type', //1普通支付模式 2服务商支付模式
|
||||
'operator_id', //操作人id
|
||||
'store_id_gather', //使用的门店
|
||||
'store_type', //1所有门店 2指定门店
|
||||
'goods_type', //所以商品 2指定商品
|
||||
'goods_id_gather', //商品id集合
|
||||
'goods_list', //商品信息
|
||||
'available_type', //可用场景1线上 2线下
|
||||
'coupon_num', //总优惠券张
|
||||
'operation_num', //剩余数量
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,144 @@
|
||||
<?php
|
||||
|
||||
namespace ShopCoupon\Model;
|
||||
|
||||
use Common\Model\BaseModel;
|
||||
|
||||
class ShopCouponRecordModel extends BaseModel
|
||||
{
|
||||
protected $tableName = 'shop_coupon_record';
|
||||
protected $fields = [
|
||||
'id',
|
||||
'merchant_id',
|
||||
'coupon_id', //商家券主键id
|
||||
'xcx_id', //领取的小程序用户id
|
||||
'stock_id', //发券批次号
|
||||
'receive_stock_id', //领券批次号
|
||||
'openid', //用户在公众号的唯一标识
|
||||
'coupon_code', //券码
|
||||
'use_time', //请求核销时间
|
||||
'wechatpay_use_time', //核销时间
|
||||
'use_request_no', //核销请求单据号
|
||||
'operator_id', //核销人id 0为小程序用户购买核销
|
||||
'verification_store_id', //核销的门店
|
||||
'verification_available_type', //核销场景 1小程序 2收银机 3公众号
|
||||
'verification_type', //核销状态1未核销 2已核销
|
||||
'used_type', //使用状态1未使用 2已使用
|
||||
'add_time', //领取时间
|
||||
'bill_id', //订单id
|
||||
'store_id' //门店id
|
||||
];
|
||||
|
||||
|
||||
/**
|
||||
* 商家券信息
|
||||
* @param $fields
|
||||
* @param $where
|
||||
* @return mixed
|
||||
*/
|
||||
public function verificationCouponInfo($fields, $where)
|
||||
{
|
||||
$info = $this->alias('r')
|
||||
->join('ls_shop_coupon as s on r.coupon_id=s.id')
|
||||
->field($fields)
|
||||
->where($where)
|
||||
->find();
|
||||
return $info;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 发放记录
|
||||
* @param $fields
|
||||
* @param $where
|
||||
* @param $page
|
||||
* @param $limit
|
||||
* @return mixed
|
||||
*/
|
||||
public function recordList($fields, $where, $page, $limit)
|
||||
{
|
||||
$list = $this->alias('r')
|
||||
->join('ls_shop_coupon as c on r.coupon_id=c.id')
|
||||
->join('ls_retail_xcxvip as x on r.xcx_id=x.id')
|
||||
->join('ls_retail_vip as v on x.vid=v.id', 'LEFT')
|
||||
->join('ls_retail_store as s on r.store_id = s.id', 'LEFT')
|
||||
->join('ls_retail_cashier as j on r.operator_id=j.id', 'LEFT')
|
||||
->field($fields)
|
||||
->where($where)
|
||||
->page($page, $limit)
|
||||
->order('r.id desc')
|
||||
->select();
|
||||
return $list;
|
||||
}
|
||||
|
||||
/**
|
||||
* 发放记录总数
|
||||
* @param $where
|
||||
* @return mixed
|
||||
*/
|
||||
public function recordCount($where)
|
||||
{
|
||||
$count = $this->alias('r')
|
||||
->join('ls_shop_coupon as c on r.coupon_id=c.id')
|
||||
->join('ls_retail_xcxvip as x on r.xcx_id=x.id')
|
||||
->join('ls_retail_vip as v on x.vid=v.id', 'LEFT')
|
||||
->join('ls_retail_store as s on r.verification_store_id = s.id', 'LEFT')
|
||||
->join('ls_jurisdiction_user as j on r.operator_id=j.id', 'LEFT')
|
||||
->where($where)
|
||||
->count();
|
||||
return $count;
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户的商家券列表分页
|
||||
* @param $fields
|
||||
* @param $where
|
||||
* @param $page
|
||||
* @param $limit
|
||||
* @return mixed
|
||||
*/
|
||||
public function userCouponList($fields, $where, $page, $limit)
|
||||
{
|
||||
$list = $this->alias('s')
|
||||
->join('ls_shop_coupon as c on s.coupon_id=c.id')
|
||||
->field($fields)
|
||||
->where($where)
|
||||
->page($page, $limit)
|
||||
->order('s.id desc')
|
||||
->select();
|
||||
return $list;
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户的商家券列表无分页
|
||||
* @param $fields
|
||||
* @param $where
|
||||
* @return mixed
|
||||
*/
|
||||
public function PlaceOrderCouponList($fields, $where)
|
||||
{
|
||||
$info = $this->alias('r')
|
||||
->join('ls_shop_coupon as s on r.coupon_id=s.id')
|
||||
->field($fields)
|
||||
->where($where)
|
||||
->order('r.id desc')
|
||||
->select();
|
||||
return $info;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据的用户商家券的id获取服务商下的openid
|
||||
* @param $fields
|
||||
* @param $where
|
||||
* @return mixed
|
||||
*/
|
||||
public function basisIdGetOpenid($fields='x.service_openid,x.openid',$where)
|
||||
{
|
||||
$xcx_info = $this->alias('s')
|
||||
->join('ls_retail_xcxvip as x on s.xcx_id=x.id')
|
||||
->field($fields)
|
||||
->where($where)
|
||||
->find();
|
||||
return $xcx_info;
|
||||
}
|
||||
}
|
||||
1524
Application/ShopCoupon/View/Index/index.html
可执行文件
1524
Application/ShopCoupon/View/Index/index.html
可执行文件
文件差异内容过多而无法显示
加载差异
在新工单中引用
屏蔽一个用户