|
@@ -13,27 +13,12 @@ class merchant_refillControl extends mbMerchantControl
|
|
|
|
|
|
public function goodsOp()
|
|
public function goodsOp()
|
|
{
|
|
{
|
|
- $goods = refill\RefillFactory::instance()->goods();
|
|
|
|
|
|
+ global $config;
|
|
|
|
+ $oil_amount = $config['refill_oil_specs'];
|
|
|
|
+ $phone_amount = $config['refill_phone_specs'];
|
|
|
|
+ $phone_small_amount = $config['refill_phone_small_specs'];
|
|
|
|
|
|
- $result['oil_amount'] = [];
|
|
|
|
- $result['phone_amount'] = [];
|
|
|
|
- foreach ($goods as $type => $specs)
|
|
|
|
- {
|
|
|
|
- if($type == mtopcard\SinopecCard || $type == mtopcard\PetroChinaCard) {
|
|
|
|
- foreach ($specs as $spec) {
|
|
|
|
- $result['oil_amount'][] = $spec;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- else {
|
|
|
|
- foreach ($specs as $spec) {
|
|
|
|
- $result['phone_amount'][] = $spec;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- $oil_amount = array_unique($result['oil_amount']);
|
|
|
|
- sort($oil_amount);
|
|
|
|
- $phone_amount = array_unique($result['phone_amount']);
|
|
|
|
|
|
+ $phone_amount = array_merge($phone_amount, $phone_small_amount);
|
|
sort($phone_amount);
|
|
sort($phone_amount);
|
|
|
|
|
|
return self::outsuccess(['oil_amount' => $oil_amount,'phone_amount' => $phone_amount]);
|
|
return self::outsuccess(['oil_amount' => $oil_amount,'phone_amount' => $phone_amount]);
|