调整补贴列表
This commit is contained in:
parent
c2d6ece975
commit
de9a758c22
@ -744,4 +744,22 @@ class StoreCouponRepository extends BaseRepository
|
||||
return $merchantCart;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取补贴类型
|
||||
* @param $type
|
||||
* @return string
|
||||
*/
|
||||
public static function getTypename($type)
|
||||
{
|
||||
if ($type == self::TYPE_STORE_COUPON) {
|
||||
return '春耕采购补贴';
|
||||
} elseif ($type == self::TYPE_SALE_SUBSIDY) {
|
||||
return '增收补贴';
|
||||
} elseif ($type == self::TYPE_PLATFORM_CARD) {
|
||||
return '春耕采购余额';
|
||||
} else {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -26,6 +26,8 @@ class Subsidy extends BaseController
|
||||
$query->with(['merchant' => function (Query $query) {
|
||||
$query->field('mer_id,uid,mer_name');
|
||||
}])->field('uid,nickname,avatar');
|
||||
}, 'coupon' => function (Query $query) {
|
||||
$query->field('coupon_id,type');
|
||||
}])
|
||||
->where('status', StoreCouponDetail::STATUS_INVALID)
|
||||
->where('type', StoreCouponDetail::TYPE_INCOME);
|
||||
@ -48,6 +50,10 @@ class Subsidy extends BaseController
|
||||
$list = $query->page($page, $limit)->order('send_status asc')->order('id desc')->select()->toArray();
|
||||
$append = ['field' => 'send_status', 'value' => 'send_status_name', 'relation' => StoreCouponDetail::SEND_STATUS_MAP];
|
||||
$list = append_to_array($list, $append);
|
||||
foreach ($list as &$item) {
|
||||
$item['coupon_type_name'] = StoreCouponRepository::getTypename($item['coupon']['type']);
|
||||
unset($item['coupon']);
|
||||
}
|
||||
return app('json')->success(['count' => $count, 'list'=> $list]);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user