后台会员级别及会员权益关联入会类型

This commit is contained in:
2026-04-25 14:20:30 +08:00
parent 3e735efd23
commit a9751ef42c
7 changed files with 45 additions and 22 deletions

View File

@@ -16,13 +16,13 @@ use think\Model;
class JoinConfig extends Model
{
// 表名
protected $name = 'wdsxh_member_join_config';
// 自动写入时间戳字段
protected $autoWriteTimestamp = false;
@@ -36,9 +36,9 @@ class JoinConfig extends Model
'type_text',
'status_text'
];
public function getTypeList()
{
return ['1' => __('Type 1'), '2' => __('Type 2'), '3' => __('Type 3')];
@@ -115,7 +115,12 @@ class JoinConfig extends Model
return $data;
}
public function getSimpleByStatus($status = 'normal')
{
return Self::field(['id', 'name'])->where(function($query) use ($status) {
if (null !== $status) {
$query->where('status', '=', $status);
}
})->order('weigh', 'asc')->select();
}
}