|
|
@@ -6,7 +6,7 @@ class RechargeChannel extends BaseModel
|
|
|
{
|
|
|
|
|
|
protected $table = 'recharge_channel';
|
|
|
- protected $fillable = ['key', 'name', 'type', 'rate','min','max' ,'fixed' ,'sort'];
|
|
|
+ protected $fillable = ['id','key', 'name', 'type', 'rate','min','max' ,'fixed' ,'sort'];
|
|
|
protected $hidden = [];
|
|
|
|
|
|
public function getFixedAttribute($value)
|
|
|
@@ -27,14 +27,15 @@ class RechargeChannel extends BaseModel
|
|
|
|
|
|
public static function getFormatChannel($recharge_channel_group_id = '')
|
|
|
{
|
|
|
- $where['status'] = 1;
|
|
|
+ $query = self::where(['status' => 1]);
|
|
|
+
|
|
|
if ($recharge_channel_group_id) {
|
|
|
$channel_ids = RechargeChannelGroup::where('id', $recharge_channel_group_id)->value('channel_ids');
|
|
|
if ($channel_ids) {
|
|
|
- $where['id'] = ['in', $channel_ids];
|
|
|
+ $query = $query->whereIn('id', $channel_ids);
|
|
|
}
|
|
|
}
|
|
|
- $product = self::where($where)->orderBy('sort', 'asc')->select(['name','type','min','max','fixed','rate'])->get()->toArray();
|
|
|
+ $product = $query->orderBy('sort', 'asc')->select(['id','name','type','min','max','fixed','rate'])->get()->toArray();
|
|
|
|
|
|
$list = [];
|
|
|
foreach($product as $key => $pv) {
|