zhaoyang пре 1 година
родитељ
комит
39fbb64f9e

+ 19 - 0
modules/Channel/Http/Controllers/PayTemplateController.php

@@ -148,6 +148,13 @@ class PayTemplateController extends CatchController
                 $item->type == 'FIRST_COIN';
             }
             $item->type_name = $type_list->where('value',$item->type)->first()['name'];
+            if($item->type == 'COIN' || $item->type == 'FIRST_COIN'){
+                $item->charge_coin = (int)($item->price*100);
+            }else{
+                $item->charge_coin = $item->type_name;
+            }
+
+            
             $item->sequence_text = $this->sequence_map[$item->sequence];
             $item->default_text = $item->is_default? '默认项':"非默认项";
         }
@@ -310,4 +317,16 @@ class PayTemplateController extends CatchController
             ['name'=>'包年','value'=>'YEAR']
         ];
     }
+
+
+    public function optionSequence(){
+        return [
+            ['name'=>'选项一','value'=>1],
+            ['name'=>'选项二','value'=>2],
+            ['name'=>'选项三','value'=>3],
+            ['name'=>'选项四','value'=>4],
+            ['name'=>'选项五','value'=>5],
+            ['name'=>'选项六','value'=>6]
+        ];
+    }
 }

+ 2 - 1
modules/Channel/routes/route.php

@@ -19,7 +19,8 @@ Route::prefix('channel')->group(function () {
 
     //支付模板
     Route::prefix('paytemplate')->group(function(){
-        Route::get('optionTypeList',[PayTemplateController::class,'optionTypeList']);
+        Route::get('optionTypeList',[PayTemplateController::class,'optionTypeList'])->withoutMiddleware(config('catch.route.middlewares'));
+        Route::get('optionSequence',[PayTemplateController::class,'optionSequence'])->withoutMiddleware(config('catch.route.middlewares'));
         Route::get('list',[PayTemplateController::class,'index']);
         Route::get('show/{id}',[PayTemplateController::class,'show']);
         Route::post('store',[PayTemplateController::class,'store']);

+ 2 - 1
tests/Feature/MiniprogramTest.php

@@ -52,7 +52,8 @@ class MiniprogramTest extends TestCase
     public function test_index(): void
     {
         $name = '亿';
-        $response = $this->getJson('/api/channel/paytemplate/show/5');
+        //$response = $this->getJson('/api/channel/paytemplate/show/5');
+        $response = $this->getJson('/api/channel/paytemplate/optionSequence');
         echo $response->getContent();
         $response->dd();
     }