xielin 5 年之前
父节点
当前提交
523a4b5762
共有 3 个文件被更改,包括 6 次插入10 次删除
  1. 1 7
      app/Console/Commands/Trace.php
  2. 3 0
      app/Http/Controllers/MetaController.php
  3. 2 3
      routes/api.php

+ 1 - 7
app/Console/Commands/Trace.php

@@ -106,7 +106,7 @@ class Trace extends Command
             if (isset($row['transaction_id']) && $row['transaction_id']) {
                 $data['trans_id'] = $row['transaction_id'];
                 $data['block_height'] = $row['block_num'];
-                $data['block_time'] = Carbon::parse($row['block_time'])->toDateTimeString();
+                $data['block_time'] = date('Y-m-d H:i:s',strtotime($row['block_time'])+8*3600)();
                 $data['status'] = 1;
             } else {
                 $data['status'] = 2;
@@ -162,12 +162,6 @@ class Trace extends Command
                 $this->line("有个账号没钱了,快充钱");
                 return false;
             }
-            $this->line("准备打开钱包");
-            $walapi->open($walletName);
-            $this->line("钱包已打开");
-            $this->line("准备解锁钱包");
-            $walapi->unlock([$walletName, $walletPassword]);
-            $this->line("钱包已解锁");
             $this->line("准备发起交易");
             $rand = rand(0, 1);
             if ($rand == 0) {

+ 3 - 0
app/Http/Controllers/MetaController.php

@@ -11,6 +11,7 @@ namespace App\Http\Controllers;
 
 use App\Repositories\MetaRepository;
 use App\Transformers\MetaTransformer;
+use Carbon\Carbon;
 use Illuminate\Http\Request;
 use Illuminate\Support\Facades\Storage;
 use League\Fractal\Manager;
@@ -29,6 +30,8 @@ class MetaController extends Controller
 
     public function index(Request $request)
     {
+        $a="2019-12-06T02:01:34.500";
+        echo date('Y-m-d H:i:s',strtotime($a)+8*3600);
         $productList = $this->metaRepository->index($request->all());
         $fractal = new Manager();
         $resource = new Collection($productList, new MetaTransformer());

+ 2 - 3
routes/api.php

@@ -27,10 +27,9 @@ $api->version('v1', [
     //后台
     //登录
     $api->post('login', 'AuthController@authenticate');
-    $api->get('metas', 'MetaController@index');
-    $api->post('meta', 'MetaController@create');
     $api->group(['middleware' => 'jwt.chxq_auth'], function ($api) {
-
+        $api->get('metas', 'MetaController@index');
+        $api->post('meta', 'MetaController@create');
     });
 
 });