瀏覽代碼

修改余额不足code值,增加配置参数,充值显示图片(未完工)

Jason 1 年之前
父節點
當前提交
aecb3860f6
共有 3 個文件被更改,包括 29 次插入7 次删除
  1. 5 4
      application/api/controller/Order.php
  2. 5 2
      application/extra/site.php
  3. 19 1
      public/assets/js/backend/trade/money_in.js

+ 5 - 4
application/api/controller/Order.php

@@ -78,10 +78,10 @@ class Order extends Api
         }
         if(bccomp($user['freeze'], 0, 2) ===-1){
             //冻结金额< 0时,需要充值
-            $this->error(__('余额不足'));
+            $this->error(__('余额不足'), '', 401);
         }
         if(!($user['balance'] > 0)){
-            $this->error(__('余额不足'));
+            $this->error(__('余额不足'), '', 401);
         }
         $day_tasks_num  = (new Config())->getValue('day_tasks_num');//单日任务数
         $task_income    = (new Config())->getValue('task_income');//单次收益
@@ -201,11 +201,11 @@ class Order extends Api
         }
 
         if($user['balance'] < 0){
-            $this->error(__('余额不足'));
+            $this->error(__('余额不足'), '', 401);
         }
 
         if($user['freeze'] < 0){
-            $this->error(__('余额不足'));
+            $this->error(__('余额不足'), '', 401);
         }
 
         if($order_info['status'] == OrderModel::Success){
@@ -248,6 +248,7 @@ class Order extends Api
                 ]);
             //向上级发放
 
+
             // 提交事务
             Db::commit();
         } catch (Exception $e) {

+ 5 - 2
application/extra/site.php

@@ -5,7 +5,7 @@ return array (
   'logo' => 'http://dapp-static.oss-cn-shenzhen.aliyuncs.com/tou-biao/202403/logo.png',
   'maintain_switch' => '1',
   'day_tasks_num' => '60',
-  'task_income' => '0.1',
+  'task_income' => '0.006',
   'categorytype' => 
   array (
     'default' => 'Default',
@@ -43,5 +43,8 @@ return array (
   'withdrawal_fee' => '0.2',
   'recharge_bank_card' => '银行卡号号码',
   'recharge_real_name' => '开户人姓名',
-  'withdraw_fee' => '1',
+  'balance_min' => '15',
+  'bonus_first' => '0.03',
+  'bonus_secend' => '0.02',
+  'bonus_three' => '0.01',
 );

+ 19 - 1
public/assets/js/backend/trade/money_in.js

@@ -33,7 +33,9 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
                         {field: 'bank_card', title: __('Bank_card'), operate: 'LIKE'},
                         {field: 'account_name', title: __('Account_name'), operate: false},
                         {field: 'amount', title: __('Amount'), operate: false},
-                        {field: 'status', title: __("Status"), 
+                        {field: 'img_url', title: __('充值截图'), formatter: Table.api.formatter.thumb, operate: false},
+                        {field: 'img_urls', title: __('Url'), formatter: Table.api.formatter.url, visible: false},
+                        {field: 'status', title: __("Status"),
                             searchList: {0:__('待支付'), 100:__('待处理'), 200:__('成功'), 400:__('失败'), 500:__('取消')},
                             formatter: Table.api.formatter.status
                         },
@@ -101,6 +103,22 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
         api: {
             bindevent: function () {
                 Form.api.bindevent($("form[role=form]"));
+            },
+            formatter: {
+                thumb: function (value, row, index) {
+                    var html = '';
+                    html = '<a href="' + row.img_url + '" target="_blank"><img src="' + row.img_url + '" alt="" style="max-height:60px;max-width:120px"></a>';
+                    return '<div style="width:120px;margin:0 auto;text-align:center;overflow:hidden;white-space: nowrap;text-overflow: ellipsis;">' + html + '</div>';
+                },
+                // url: function (value, row, index) {
+                //     return '<a href="' + row.img_url + '" target="_blank" class="label bg-green">' + row.url + '</a>';
+                // },
+                // filename: function (value, row, index) {
+                //     return '<div style="width:150px;margin:0 auto;text-align:center;overflow:hidden;white-space: nowrap;text-overflow: ellipsis;">' + Table.api.formatter.search.call(this, value, row, index) + '</div>';
+                // },
+                // mimetype: function (value, row, index) {
+                //     return '<div style="width:80px;margin:0 auto;text-align:center;overflow:hidden;white-space: nowrap;text-overflow: ellipsis;">' + Table.api.formatter.search.call(this, value, row, index) + '</div>';
+                // },
             }
         }
     };