fix(shopro): 优化到店自提核销码生成与过期判断
到店自提:支付成功后为实物商品自动生成核销码,无需依赖门店手动发货后再出码。 自提模板过期:固定截至日期已过期时不再写入 expiretime,避免核销码创建即失效。 核销状态:expiretime 为 0 或空视为未过期;CanUse 查询与后台模型状态判断保持一致。 纳入版本库:addons 下 OrderOperSendGet、Verify 相关改动(原被 .gitignore 忽略,使用 git add -f 跟踪)。 Co-authored-by: Cursor <cursoragent@cursor.com>
这个提交包含在:
@@ -36,7 +36,7 @@ class Verify extends Model
|
||||
public function scopeCanUse($query)
|
||||
{
|
||||
return $query->where('usetime', null)->where(function ($query) {
|
||||
$query->where('expiretime', null)->whereOr('expiretime', '>', time());
|
||||
$query->where('expiretime', null)->whereOr('expiretime', 0)->whereOr('expiretime', '>', time());
|
||||
});
|
||||
}
|
||||
|
||||
@@ -79,7 +79,7 @@ class Verify extends Model
|
||||
$status_code = 'used';
|
||||
} else {
|
||||
// 未使用
|
||||
if (is_null($data['expiretime']) || $data['expiretime'] > time()) {
|
||||
if (empty($data['expiretime']) || $data['expiretime'] > time()) {
|
||||
// 不过期,或者过期时间大于当前时间
|
||||
$status_code = 'nouse';
|
||||
} else {
|
||||
|
||||
在新工单中引用
屏蔽一个用户