Просмотр исходного кода

Weenier 168otc项目部署 0630

wesmiler 3 лет назад
Родитель
Сommit
c7ec8cbf16

+ 14 - 0
app/Helpers/common.php

@@ -597,6 +597,20 @@ if (!function_exists('format_account')) {
     }
 }
 
+if (!function_exists('format_address')) {
+
+    /**
+     * 格式化微信号或支付宝账号
+     * @param string $mobile 手机号码
+     * @return string 返回结果
+     * @author laravel开发员
+     * @date 2019/5/23
+     */
+    function format_address($address)
+    {
+        return substr($address, 0, 5) . "..." . substr($address, -5, 5);
+    }
+}
 
 if (!function_exists('format_realname')) {
 

+ 3 - 1
app/Http/Validator/CoinValidator.php

@@ -7,6 +7,7 @@ class CoinValidator extends BaseValidator
         'id' => 'required',
         'change_type' => 'required',
         'contact_type' => 'required',
+        'coin_type' => 'required',
         'google_code' => 'required',
         'to_address' => 'required',
         'trade_password' => 'required',
@@ -28,6 +29,7 @@ class CoinValidator extends BaseValidator
         'id' => 'ID',
         'change_type' => '交易类型',
         'contact_type' => '合约类型',
+        'coin_type' => '币种类型',
         'google_code' => '谷歌验证码',
         'trade_password' => '交易密码',
         'to_address' => '提币地址',
@@ -38,7 +40,7 @@ class CoinValidator extends BaseValidator
     public static $scenes = [
         'info'=> ['id'],
         'withdraw'=> ['change_type','contact_type','google_code','to_address','trade_password','num'],
-        'out'=> ['contact_type','trade_password','to_address','num'],
+        'out'=> ['coin_type','trade_password','to_address','num'],
         'confirm'=> ['id'],
     ];
 

+ 2 - 0
app/Services/Common/CoinLogService.php

@@ -113,6 +113,8 @@ class CoinLogService extends BaseService
         $list = $list? $list->toArray() :[];
         if($list){
             foreach($list['data'] as &$item){
+                $item['from_address_text'] = $item['from_address']? format_address($item['from_address']):'';
+                $item['to_address_text'] = $item['to_address']? format_address($item['to_address']):'';
                 $item['time_text'] = $item['create_time']? datetime(strtotime($item['create_time']), 'm-d H:i'):'';
             }
         }