ソースを参照

wesmiler ECY 画画交易平台

APPLE 3 年 前
コミット
be32a6862d

+ 23 - 9
application/api/controller/Index.php

@@ -129,7 +129,7 @@ class Index extends Api
 
 
             // 用户信息
             // 用户信息
             $user = \app\common\model\User::where(['id'=> $tradeUserId,'status'=>1])
             $user = \app\common\model\User::where(['id'=> $tradeUserId,'status'=>1])
-                ->field('id,bonus,nickname')
+                ->field('id,usdt,nickname,username')
                 ->find();
                 ->find();
             if(empty($user)){
             if(empty($user)){
                 $fail++;
                 $fail++;
@@ -138,15 +138,29 @@ class Index extends Api
 
 
             // 释放到余额
             // 释放到余额
             Db::startTrans();
             Db::startTrans();
-            $changedata = [
-                'type' => 17,
-                'money' => $usdt,
-                'userid' => $tradeUserId,
-                'relevant_userid' => $tradeUserId,
-                'remark' => '释放USDT到账',
+            $balance = $user->usdt;
+            $user->usdt = $user->usdt+$usdt;
+            $user->updatetime = time();
+            if(!$user->save()){
+                $fail++;
+                Db::rollback();
+                continue;
+            }
+
+            // 流水明细
+            $changedata=[
+                'userid'=>$tradeUserId,
+                'type'=> 17,
+                'money'=> $usdt,
+                'balance'=>$balance,
+                'relevant_userid'=>$tradeUserId,
+                'status'=>1,
+                'create_time'=>time(),
+                'remark'=>'转售产品给平台释放USDT到账',
+                'user_name'=>$user->username? $user->username : '系统',
+                'relevant_name'=>$user->username? $user->username : '系统',
             ];
             ];
-            $res = caiwu($changedata, 'bonus');
-            if(!$res){
+            if(!Db::name('detailed_bouns')->insertGetId($changedata)){
                 $fail++;
                 $fail++;
                 Db::rollback();
                 Db::rollback();
                 continue;
                 continue;

+ 1 - 1
application/api/controller/Shop.php

@@ -43,7 +43,7 @@ class Shop extends Api
 			$this->error('缺少参数页码');
 			$this->error('缺少参数页码');
 		}
 		}
 		$map['on_sale']=1;
 		$map['on_sale']=1;
-//		$map['on_resale']=2;
+		$map['on_resale']=2;
 		$pagesize=10;
 		$pagesize=10;
         $map['istrade']=0;
         $map['istrade']=0;
         /*获取茶室*/
         /*获取茶室*/

+ 3 - 1
application/api/controller/Trade.php

@@ -660,6 +660,7 @@ class Trade extends Api
     function gethostdraw()
     function gethostdraw()
     {
     {
         $map['on_sale']=1;
         $map['on_sale']=1;
+        $map['on_resale']=2;
         $map['stuid'] = $this->auth->stuid;
         $map['stuid'] = $this->auth->stuid;
         $p = $this->request->post('p');
         $p = $this->request->post('p');
         $data_list = db('goods')->where($map)->page($p, 10)->order("id desc")->select();
         $data_list = db('goods')->where($map)->page($p, 10)->order("id desc")->select();
@@ -720,6 +721,7 @@ class Trade extends Api
         }
         }
 
 
         $map['on_sale']=1;
         $map['on_sale']=1;
+        $map['on_resale']=2;
         $map['userid'] = $this->auth->id;
         $map['userid'] = $this->auth->id;
         $p = $this->request->post('p');
         $p = $this->request->post('p');
         $data_list = db('goods')->where($map)->page($p, 10)->order("id desc")->select();
         $data_list = db('goods')->where($map)->page($p, 10)->order("id desc")->select();
@@ -893,7 +895,7 @@ class Trade extends Api
         }
         }
 
 
         db()->startTrans();
         db()->startTrans();
-        $res=db('trade')->where(['id'=>$id,'status'=>3])->update(['on_resale'=>1]);
+        $res=db('trade')->where(['id'=>$id,'status'=>4])->update(['on_resale'=>1]);
         $res1=db('goods')->where(['id'=>$trade['goodsid']])->update(['time1'=>time(),'on_resale'=> 1]);
         $res1=db('goods')->where(['id'=>$trade['goodsid']])->update(['time1'=>time(),'on_resale'=> 1]);
         if($res && $res1)
         if($res && $res1)
         {
         {

+ 1 - 1
application/shop/controller/User.php

@@ -26,7 +26,7 @@ class User extends Frontend{
     function myhost()
     function myhost()
     {
     {
         $studio=db('studio')->where(['id'=>$this->auth->stuid])->find();
         $studio=db('studio')->where(['id'=>$this->auth->stuid])->find();
-        $total1=db('goods')->where(['stuid'=>$studio['id'],'on_sale'=>1])->count();
+        $total1=db('goods')->where(['stuid'=>$studio['id'],'on_sale'=>1,'on_resale'=>2])->count();
         $total2=db('trade')->where(['status'=>0,'stuid'=>$studio['id']])->count();
         $total2=db('trade')->where(['status'=>0,'stuid'=>$studio['id']])->count();
         $this->view->assign([
         $this->view->assign([
             "studio" => $studio,
             "studio" => $studio,

+ 1 - 2
application/shop/view/goods/goodslist.html

@@ -248,6 +248,7 @@
 							--that.total_seconds;
 							--that.total_seconds;
 						}
 						}
 						else {
 						else {
+							location.reload();
 							clearInterval(that.countdown_interval);
 							clearInterval(that.countdown_interval);
 						}
 						}
 					}, 1000);
 					}, 1000);
@@ -335,9 +336,7 @@
 
 
 			});
 			});
 
 
-			function timeLock(){
 
 
-			}
 			var pag = 1, page;  //p当前页,page总页数
 			var pag = 1, page;  //p当前页,page总页数
 			getList();
 			getList();
 			function getList(){
 			function getList(){

+ 4 - 0
application/shop/view/trade/topay.html

@@ -380,6 +380,10 @@
         });
         });
     }
     }
     $('.topay').click(function () {
     $('.topay').click(function () {
+        if($('#prc').val() == ''){
+            layer.msg('请先上传凭证');
+            return false;
+        }
         jQuery.post("{:url('api/trade/topay')}", {id: $('#tradeid').val(), prc: $('#prc').val()}, function (data) {
         jQuery.post("{:url('api/trade/topay')}", {id: $('#tradeid').val(), prc: $('#prc').val()}, function (data) {
             if (data.code > 0) {
             if (data.code > 0) {
                 layer.msg('支付完成', {time: 1000}, function () {
                 layer.msg('支付完成', {time: 1000}, function () {

+ 1 - 1
application/shop/view/trade/trade3.html

@@ -93,7 +93,7 @@
                         </div>
                         </div>
                         <div class="am-padding-top-sm am-text-right">
                         <div class="am-padding-top-sm am-text-right">
                             {if $v['issell'] == 0}
                             {if $v['issell'] == 0}
-                            <span><input type="button" class="am-btn am-btn-danger am-btn-xs" value="代售" onclick="tosell({$v.id})"></span>&nbsp;&nbsp;
+                            <span><input type="button" class="am-btn am-btn-danger am-btn-xs" value="上架" onclick="tosell({$v.id})"></span>&nbsp;&nbsp;
                             <span><input type="button" class="am-btn am-btn-success am-btn-xs" value="发货到家" onclick="toorder({$v['id']},0)"></span>
                             <span><input type="button" class="am-btn am-btn-success am-btn-xs" value="发货到家" onclick="toorder({$v['id']},0)"></span>
                             {/if}
                             {/if}
                             {if $v['issell'] == 2 && $v['on_resale'] != 1}
                             {if $v['issell'] == 2 && $v['on_resale'] != 1}

+ 1 - 1
application/shop/view/trade/viewonsale.html

@@ -31,7 +31,7 @@
 <!-- Header -->
 <!-- Header -->
 <header data-am-widget="header" class="am-header am-header-default">
 <header data-am-widget="header" class="am-header am-header-default">
     <div class="am-header-left am-header-nav">
     <div class="am-header-left am-header-nav">
-        <a href="/shop/user/index" ><i class="am-header-icon am-icon-angle-left"></i></a>
+        <a onclick="javascript: history.go(-1);" ><i class="am-header-icon am-icon-angle-left"></i></a>
     </div>
     </div>
     <h1 class="am-header-title">
     <h1 class="am-header-title">
         <a href="#title-link">上架审核</a>
         <a href="#title-link">上架审核</a>

+ 1 - 1
application/shop/view/user/myhost.html

@@ -35,7 +35,7 @@
 <!-- Header -->
 <!-- Header -->
 <header data-am-widget="header" class="am-header am-header-default" >
 <header data-am-widget="header" class="am-header am-header-default" >
 	<div class="am-header-left am-header-nav">
 	<div class="am-header-left am-header-nav">
-		<a href="/shop/user/index" ><i class="am-header-icon am-icon-angle-left"></i></a>
+		<a onclick="javascript: history.go(-1);" ><i class="am-header-icon am-icon-angle-left"></i></a>
 	</div>
 	</div>
 	<h1 class="am-header-title ">店长操作台</h1>
 	<h1 class="am-header-title ">店长操作台</h1>