Ver Fonte

wesmiler ECY 画画交易平台

APPLE há 3 anos atrás
pai
commit
857c7b6977
30 ficheiros alterados com 1071 adições e 414 exclusões
  1. 338 369
      application/api/controller/Index.php
  2. 13 5
      application/api/controller/Trade.php
  3. 143 0
      application/cmgadm/controller/shop/Material.php
  4. 47 0
      application/cmgadm/model/Material.php
  5. 41 0
      application/cmgadm/view/shop/material/add.html
  6. 30 0
      application/cmgadm/view/shop/material/edit.html
  7. 23 0
      application/cmgadm/view/shop/material/index.html
  8. 47 0
      application/common/model/Material.php
  9. 4 2
      application/index/view/user/login.html
  10. 13 0
      application/shop/controller/Goods.php
  11. 6 0
      application/shop/controller/Trade.php
  12. 13 0
      application/shop/controller/User.php
  13. 1 1
      application/shop/view/goods/goodsdetailed.html
  14. 38 17
      application/shop/view/goods/index.html
  15. 136 0
      application/shop/view/goods/model.html
  16. 1 1
      application/shop/view/index/index.html
  17. 1 0
      application/shop/view/trade/managergoods.html
  18. 30 2
      application/shop/view/trade/topay.html
  19. 3 2
      application/shop/view/trade/trade1.html
  20. 3 2
      application/shop/view/trade/trade2.html
  21. 4 3
      application/shop/view/trade/trade3.html
  22. 3 2
      application/shop/view/trade/trade4.html
  23. 3 2
      application/shop/view/trade/trade5.html
  24. 3 2
      application/shop/view/trade/tradelist.html
  25. 1 1
      application/shop/view/user/bonuspage.html
  26. 9 1
      application/shop/view/user/index.html
  27. 112 0
      application/shop/view/user/material.html
  28. 1 1
      application/shop/view/user/myhost.html
  29. 3 0
      application/shop/view/user/sharelink.html
  30. 1 1
      application/shop/view/user/userteam.html

+ 338 - 369
application/api/controller/Index.php

@@ -9,6 +9,7 @@ use app\common\model\Trade;
 use think\db;
 use think\Session;
 use Think\Config;
+
 /**
  * 首页接口
  */
@@ -16,44 +17,39 @@ class Index extends Api
 {
     protected $noNeedLogin = ['*'];
     protected $noNeedRight = ['*'];
-   
+
     /**
      * 首页
      *
      */
-     
     public function index()
     {
-        $yestday=strtotime('today')-60*60*24;
-        $list=db('trade')->where(['status'=>3,'issell'=>2,'create_time'=>$yestday])->select();
-       
-        foreach ($list as $v)
-        {
-            $appointcnt=db('trade')->where(['goodsid'=>$v['goodsid'],'isout'=>0,'status'=>0])->count();
-            $goods=db('goods')->where(['id'=>$v['goodsid']])->find();
-            
-            if($goods['on_sale'] == 1 && $appointcnt == 0)
-            {
-                db('goods')->where(['id'=>$v['goodsid']])->update(['istrade'=>0]);
-                db('trade')->where(['id'=>$v['id']])->update(['status'=>4]);
-            }elseif($goods['on_sale'] == 1 && $appointcnt >0){
-                db('trade')->where(['id'=>$v['id']])->update(['status'=>4]);
-            }elseif($goods['on_sale'] != 1){
-                db('trade')->where(['id'=>$v['id']])->update(['status'=>4]);
-            }else{
+        $yestday = strtotime('today') - 60 * 60 * 24;
+        $list = db('trade')->where(['status' => 3, 'issell' => 2, 'create_time' => $yestday])->select();
+
+        foreach ($list as $v) {
+            $appointcnt = db('trade')->where(['goodsid' => $v['goodsid'], 'isout' => 0, 'status' => 0])->count();
+            $goods = db('goods')->where(['id' => $v['goodsid']])->find();
+
+            if ($goods['on_sale'] == 1 && $appointcnt == 0) {
+                db('goods')->where(['id' => $v['goodsid']])->update(['istrade' => 0]);
+                db('trade')->where(['id' => $v['id']])->update(['status' => 4]);
+            } elseif ($goods['on_sale'] == 1 && $appointcnt > 0) {
+                db('trade')->where(['id' => $v['id']])->update(['status' => 4]);
+            } elseif ($goods['on_sale'] != 1) {
+                db('trade')->where(['id' => $v['id']])->update(['status' => 4]);
+            } else {
                 continue;
             }
         }
-        
-        $list1=db('goods')->where(['isnew'=>1,'on_sale'=>0,'create_user'=>1,'utime'=>[['gt',$yestday],['lt',strtotime('today')]]])->select();
-        foreach ($list1 as $v)
-        {
-            db('goods')->where(['id'=>$v['id']])->update(['create_user'=>0,'on_sale'=>1,'istrade'=>0]);
+
+        $list1 = db('goods')->where(['isnew' => 1, 'on_sale' => 0, 'create_user' => 1, 'utime' => [['gt', $yestday], ['lt', strtotime('today')]]])->select();
+        foreach ($list1 as $v) {
+            db('goods')->where(['id' => $v['id']])->update(['create_user' => 0, 'on_sale' => 1, 'istrade' => 0]);
         }
         $this->success('请求成功');
     }
 
-
     /**
      * 转售产品每日释放
      * @throws \think\exception\DbException
@@ -62,80 +58,80 @@ class Index extends Api
      */
     public function release()
     {
-        $key = input('key','');
-        if($key != md5('hua')){
+        $key = input('key', '');
+        if ($key != md5('hua')) {
             $this->error('非法请求');
         }
 
-        if(date('H:i') >= '07:00'){
+        if (date('H:i') >= '07:00') {
             $this->error('不在释放处理时间段内');
         }
 
         // 计算获取奖池和已释放总额
         $awards = Trade::getAwardTotal();
-        $releaseUsdtTotal = Trade::where(['status'=> 3,'on_resale'=>1])->sum('release_usdt');
-        $awardTotal = isset($awards['total_usdt'])? $awards['total_usdt'] : 0;
-        
+        $releaseUsdtTotal = Trade::where(['status' => 3, 'on_resale' => 1])->sum('release_usdt');
+        $awardTotal = isset($awards['total_usdt']) ? $awards['total_usdt'] : 0;
+
         // 奖池是否还有钱,若已释放完
-        if($awardTotal <= $releaseUsdtTotal){
+        if ($awardTotal <= $releaseUsdtTotal) {
             $this->error('抱歉,奖池金额已释放完');
         }
 
         // 处理转售释放
         $tradeConfig = \app\common\model\Config::getConfigByGroup('trade');
-        $config['release_rate'] = isset($tradeConfig['release_rate'])? $tradeConfig['release_rate']['value'] : 0;
-        if($config['release_rate'] <= 0){
+        $config['release_rate'] = isset($tradeConfig['release_rate']) ? $tradeConfig['release_rate']['value'] : 0;
+        if ($config['release_rate'] <= 0) {
             $this->error('释放参数错误,请先配置');
         }
 
-        $coinRate = CoinRate::getRate('CNY','USD');
-        if($coinRate<=0){
+        $coinRate = CoinRate::getRate('CNY', 'USD');
+        if ($coinRate <= 0) {
             $this->error('汇率参数错误,请稍后重试');
         }
 
         // 待释放产品
-        $tradeList = \app\common\model\Trade::where(['on_resale'=>1])
-            ->whereIn('status', [3,4])
-            ->whereRaw('release_usdt < endnums')
-            ->where('release_time','<', strtotime(date('Y-m-d')))
-            ->field('id,orderNo,goodsid,userid,relevant_userid,status,endnums,release_total,release_usdt,release_total_usdt,release_time')
-            ->order('ctime','asc')
+        $tradeList = \app\common\model\Trade::where(['on_resale' => 1])
+            ->whereIn('status', [3, 4])
+            ->whereRaw('release_usdt < release_total_usdt')
+            ->where('release_time', '<', strtotime(date('Y-m-d')))
+            ->field('id,orderNo,goodsid,userid,relevant_userid,status,endnums,pre_price,release_total,release_usdt,release_total_usdt,release_time')
+            ->order('ctime', 'asc')
             ->limit(1000)
             ->select();
 
-        if(empty($tradeList)){
+        if (empty($tradeList)) {
             $this->error('暂时没有可释放的转售产品');
         }
 
         $success = 0;
         $fail = 0;
-        foreach ($tradeList as $k => $item){
-            $tradeUserId = isset($item['relevant_userid'])? $item['relevant_userid'] : 0;
-            $releaseTotalUsdt = isset($item['release_total_usdt'])? $item['release_total_usdt'] : 0;
+        foreach ($tradeList as $k => $item) {
+            $tradeUserId = isset($item['relevant_userid']) ? $item['relevant_userid'] : 0;
+            $releaseTotalUsdt = isset($item['release_total_usdt']) ? $item['release_total_usdt'] : 0;
             $speedData = Trade::getSpeedTotalByUser($tradeUserId); // 加速值
-            $speedUsdt = isset($speedData['speed_usdt'])? $speedData['speed_usdt'] : 0;
-            $speedTotal = isset($speedData['speed_total'])? $speedData['speed_total'] : 0;
+            $speedUsdt = isset($speedData['speed_usdt']) ? $speedData['speed_usdt'] : 0;
+            $speedTotal = isset($speedData['speed_total']) ? $speedData['speed_total'] : 0;
 
             // 计算释放额度
-            $amount = isset($item['endnums'])? $item['endnums'] : 0;
-            $releaseUsdt = isset($item['release_usdt'])? $item['release_usdt'] : 0;
-            $releaseAmount = $amount? round($amount * $config['release_rate']/100 + $speedTotal, 2) : 0;
-            $releaseAmount = ($amount-$releaseAmount)<$releaseAmount? ($amount-$releaseAmount) : $releaseAmount;
-            $totalUsdt = $releaseTotalUsdt? $releaseTotalUsdt : round(CoinRate::transfer($amount, 'CNY','USD'), 2);
-            $usdt = $totalUsdt? round($totalUsdt * $config['release_rate']/100 + $speedUsdt, 2) : 0;
-            $usdt = ($totalUsdt-$usdt)<$usdt? ($totalUsdt-$usdt) : $usdt;
-
-            $releaseTotal = isset($item['release_total'])? $item['release_total'] : 0;
-            if($tradeUserId<=0 || $amount<=0 || $usdt<=0 || $amount<=$releaseUsdt){
+            $amount = isset($item['pre_price']) ? $item['pre_price'] : 0;
+            $releaseUsdt = isset($item['release_usdt']) ? $item['release_usdt'] : 0;
+            $releaseAmount = $amount ? round($amount * $config['release_rate'] / 100 + $speedTotal, 2) : 0;
+            $releaseAmount = ($amount - $releaseAmount) < $releaseAmount ? ($amount - $releaseAmount) : $releaseAmount;
+            $totalUsdt = $releaseTotalUsdt ? $releaseTotalUsdt : round(CoinRate::transfer($amount, 'CNY', 'USD'), 2);
+            $usdt = $totalUsdt ? round($totalUsdt * $config['release_rate'] / 100 + $speedUsdt, 2) : 0;
+            $usdt = ($totalUsdt - $usdt) < $usdt ? ($totalUsdt - $usdt) : $usdt;
+
+            $releaseTotal = isset($item['release_total']) ? $item['release_total'] : 0;
+            if ($tradeUserId <= 0 || $amount <= 0 || $usdt <= 0 || $amount <= $releaseUsdt) {
                 $fail++;
                 continue;
             }
 
             // 用户信息
-            $user = \app\common\model\User::where(['id'=> $tradeUserId,'status'=>1])
+            $user = \app\common\model\User::where(['id' => $tradeUserId, 'status' => 1])
                 ->field('id,usdt,nickname,username')
                 ->find();
-            if(empty($user)){
+            if (empty($user)) {
                 $fail++;
                 continue;
             }
@@ -143,28 +139,28 @@ class Index extends Api
             // 释放到余额
             Db::startTrans();
             $balance = $user->usdt;
-            $user->usdt = $user->usdt+$usdt;
+            $user->usdt = $user->usdt + $usdt;
             $user->updatetime = time();
-            if(!$user->save()){
+            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 : '系统',
+            $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 : '系统',
             ];
-            if(!Db::name('detailed_usdt')->insertGetId($changedata)){
+            if (!Db::name('detailed_usdt')->insertGetId($changedata)) {
                 $fail++;
                 Db::rollback();
                 continue;
@@ -172,36 +168,36 @@ class Index extends Api
 
             // 释放明细
             $data = [
-                'userid'=> $tradeUserId,
-                'type'=>1,
-                'money'=> $releaseAmount,
-                'usdt_num'=> $usdt,
-                'speed_usdt'=> $speedUsdt,
-                'speed_total'=> $speedTotal,
-                'balance'=> $user->usdt,
-                'orderid'=> $item['id'],
-                'status'=> 1,
-                'create_time'=> time(),
-                'update_time'=> time(),
-                'remark'=> '转售产品每日释放到账',
+                'userid' => $tradeUserId,
+                'type' => 1,
+                'money' => $releaseAmount,
+                'usdt_num' => $usdt,
+                'speed_usdt' => $speedUsdt,
+                'speed_total' => $speedTotal,
+                'balance' => $user->usdt,
+                'orderid' => $item['id'],
+                'status' => 1,
+                'create_time' => time(),
+                'update_time' => time(),
+                'remark' => '转售产品每日释放到账',
             ];
 
-            if(!ReleaseLog::insertGetId($data)){
+            if (!ReleaseLog::insertGetId($data)) {
                 $fail++;
                 Db::rollback();
                 continue;
             }
 
             // 更新释放交易商品数据
-            $tradeData = ['release_total'=> $releaseTotal+$releaseAmount,'release_usdt'=> $releaseUsdt+$usdt,'release_time'=> time()];
-            if($releaseTotalUsdt<=0){
+            $tradeData = ['release_total' => $releaseTotal + $releaseAmount, 'release_usdt' => $releaseUsdt + $usdt, 'release_time' => time()];
+            if ($releaseTotalUsdt <= 0) {
                 $tradeUserId['release_total_usdt'] = $totalUsdt;
             }
-            if($releaseUsdt+$usdt >= $amount){
+            if ($releaseUsdt + $usdt >= $amount) {
                 $tradeData['status'] = 4;
             }
 
-            if(!Trade::where(['id'=> $item['id']])->update($tradeData)){
+            if (!Trade::where(['id' => $item['id']])->update($tradeData)) {
                 $fail++;
                 Db::rollback();
                 continue;
@@ -211,126 +207,109 @@ class Index extends Api
             Db::commit();
         }
 
-        $this->success('请求处理成功', ['success'=> $success,'fail'=> $fail]);
+        $this->success('请求处理成功', ['success' => $success, 'fail' => $fail]);
     }
 
     /*预约上架*/
     function checkappoint()
     {
-        $gids=db('trade')->where(['status'=>0])->group('goodsid')->column('goodsid');
-        foreach ($gids as $vl)
-        {
-            $tradelist=db('trade')->where(['goodsid'=>$vl,'status'=>0])->select();
-            if(count($tradelist) == 1)
-            {
+        $gids = db('trade')->where(['status' => 0])->group('goodsid')->column('goodsid');
+        foreach ($gids as $vl) {
+            $tradelist = db('trade')->where(['goodsid' => $vl, 'status' => 0])->select();
+            if (count($tradelist) == 1) {
                 continue;
-            }else{
-                $cnt=0;
-                foreach ($tradelist as $vs)
-                {
-                  $cnt++;
-                  if($cnt == 1)
-                  {
-                      continue;
-                  }else{
-                      #取消
-                      db('trade')->where(['id'=>$vs['id']])->update(['status'=>-2,'iscancel'=>1,'confirm_time'=>time()]);
-                  }
+            } else {
+                $cnt = 0;
+                foreach ($tradelist as $vs) {
+                    $cnt++;
+                    if ($cnt == 1) {
+                        continue;
+                    } else {
+                        #取消
+                        db('trade')->where(['id' => $vs['id']])->update(['status' => -2, 'iscancel' => 1, 'confirm_time' => time()]);
+                    }
                 }
             }
         }
-        
-        $list=db('goods_cats')->where(['status'=>1])->select();
-        foreach($list as $v)
-        { 
-            if(time()>=strtotime(date("Y-m-d {$v['start']}")) && time()<=strtotime(date("Y-m-d {$v['end']}")))
-            {
-            
-                db('trade')->where(['catid'=>$v['id'],'appoint_time'=>['lt',strtotime('today')],'status'=>0])->update(['status'=>1,'ctime'=>time(),'create_time'=>strtotime('today')]);
+
+        $list = db('goods_cats')->where(['status' => 1])->select();
+        foreach ($list as $v) {
+            if (time() >= strtotime(date("Y-m-d {$v['start']}")) && time() <= strtotime(date("Y-m-d {$v['end']}"))) {
+
+                db('trade')->where(['catid' => $v['id'], 'appoint_time' => ['lt', strtotime('today')], 'status' => 0])->update(['status' => 1, 'ctime' => time(), 'create_time' => strtotime('today')]);
             }
         }
         $this->success('操作完成');
 
     }
+
     function getnowtime()
     {
         $id = input('id', 0);
-        $time=date('Y年m月d日H:i:s',time());
-        $studio=db('studio')->where(['id'=> $id])->find();
-        $startTime = isset($studio['start'])? $studio['start'] : 0;
-        $endTime = isset($studio['end'])? $studio['end'] : 0;
-        $startTime = $startTime? strtotime(date('Y-m-d').' '.$startTime) : 0;
-        $endTime = $endTime? strtotime(date('Y-m-d').' '.$endTime) : 0;
-        $expired = $startTime > time()? $startTime - time() : 0;
-        if($endTime <= time()){
-            $startTime = strtotime(date('Y-m-d',strtotime(date('Y-m-d'))+86400).' '.$startTime);
-            $expired = $startTime > time()? $startTime - time() : 0;
-        }
-        if(date('week') == 1)
-        {
-            $weeks='一';
-        }elseif(date('week') ==2)
-        {
-            $weeks='二';
-        }elseif(date('week') ==3)
-        {
-            $weeks='三';
-        }elseif(date('week') ==4)
-        {
-            $weeks='四';
-        }elseif(date('week') ==5)
-        {
-            $weeks='五';
-        }elseif(date('week') ==6)
-        {
-            $weeks='六';
-        }else{
-            $weeks='七';
-        }
-        $this->success($time.'  星期'.$weeks,['time'=> $endTime,'expired'=>$expired]);
+        $time = date('Y年m月d日H:i:s', time());
+        $studio = db('studio')->where(['id' => $id])->find();
+        $startTime = isset($studio['start']) ? $studio['start'] : 0;
+        $endTime = isset($studio['end']) ? $studio['end'] : 0;
+        $startTime = $startTime ? strtotime(date('Y-m-d') . ' ' . $startTime) : 0;
+        $endTime = $endTime ? strtotime(date('Y-m-d') . ' ' . $endTime) : 0;
+        $expired = $startTime > time() ? $startTime - time() : 0;
+        if ($endTime <= time()) {
+            $startTime = strtotime(date('Y-m-d', strtotime(date('Y-m-d')) + 86400) . ' ' . $startTime);
+            $expired = $startTime > time() ? $startTime - time() : 0;
+        }
+        if (date('week') == 1) {
+            $weeks = '一';
+        } elseif (date('week') == 2) {
+            $weeks = '二';
+        } elseif (date('week') == 3) {
+            $weeks = '三';
+        } elseif (date('week') == 4) {
+            $weeks = '四';
+        } elseif (date('week') == 5) {
+            $weeks = '五';
+        } elseif (date('week') == 6) {
+            $weeks = '六';
+        } else {
+            $weeks = '七';
+        }
+        $this->success($time . '  星期' . $weeks, ['time' => $endTime, 'expired' => $expired]);
     }
+
     function getusername()
     {
-        $names=input('username');
-        if(empty($names))
-        {
+        $names = input('username');
+        if (empty($names)) {
             $this->error('请输入账户');
         }
-        $user=db('user')->where(['username|mobile'=>$names,'status'=>1])->find();
-        if($user)
-        {
-            $this->success('',['name'=>$user['nickname']]);
-        }else{
-            $this->error('用户不存在'.$names);
+        $user = db('user')->where(['username|mobile' => $names, 'status' => 1])->find();
+        if ($user) {
+            $this->success('', ['name' => $user['nickname']]);
+        } else {
+            $this->error('用户不存在' . $names);
         }
     }
+
     /*匹配*/
     function checktrade()
     {
-        $bcf=db('bonus_config')->where('id',4)->find();
-        $list=db('trade')->where(['status'=>['in','1,2']])->select();
-        foreach ($list as $v)
-        {
-            if($v['status'] == 2)
-            {
-                $JC=time()-($v['pay_time']+60*(int)$bcf['cap']);
-                if($JC>0)
-                {//自动确认
-                    db('trade')->where(['id'=>$v['id']])->update(['status'=>-1]);
+        $bcf = db('bonus_config')->where('id', 4)->find();
+        $list = db('trade')->where(['status' => ['in', '1,2']])->select();
+        foreach ($list as $v) {
+            if ($v['status'] == 2) {
+                $JC = time() - ($v['pay_time'] + 60 * (int)$bcf['cap']);
+                if ($JC > 0) {//自动确认
+                    db('trade')->where(['id' => $v['id']])->update(['status' => -1]);
                 }
             }
-            if($v['status'] == 1)
-            {
-                $JC1=time()-($v['ctime']+60*$bcf['value']);
-                if($JC1>0)
-                {//超时未支付
+            if ($v['status'] == 1) {
+                $JC1 = time() - ($v['ctime'] + 60 * $bcf['value']);
+                if ($JC1 > 0) {//超时未支付
                     db()->startTrans();
-                    $res1=db('trade')->where(['id'=>$v['id']])->update(['status'=>-2,'iscancel'=>1,'confirm_time'=>time()]);
-                    $res2=db('goods')->where(['id'=>$v['goodsid']])->update(['istrade'=>0]);
-                    if($res1 && $res2)
-                    {
+                    $res1 = db('trade')->where(['id' => $v['id']])->update(['status' => -2, 'iscancel' => 1, 'confirm_time' => time()]);
+                    $res2 = db('goods')->where(['id' => $v['goodsid']])->update(['istrade' => 0]);
+                    if ($res1 && $res2) {
                         db()->commit();
-                    }else{
+                    } else {
                         db()->rollback();
                     }
                 }
@@ -341,256 +320,246 @@ class Index extends Api
 
     function getnoticelist()
     {
-    	$map['status']=1;
-    	$map['catid']=1;
-    	$p=$this->request->request('p');
-    	if(empty($p))
-    	{
-    		$this->error('缺少参数页码');
-    	}
-    	$pagesize=10;
-    	$total=db('article')->where($map)->count();
-    	$totalPage=ceil($total/$pagesize);
-    	if($p>$totalPage && $total>0)
-    	{
-    		$this->error('页码有误');
-    	}
-    	$list=db('article')->where($map)->page($p,$pagesize)->order('id desc')->select();
-    	foreach ($list as &$v)
-    	{
-    		$v['ctime']=date('Y-m-d H:i:s',$v['ctime']);
-    		$v['abs']=mbsubstr($v['content'],0,30);
-    		$v['prc']=empty($v['prc']) ?'http://' . $_SERVER['HTTP_HOST'].'/assets/shop/img/gg.png':$v['prc'];
-    	}
-    	if(empty($list))
-    	{
-    		$data['list']=[];
-    	}else{
-    		$data['list']=$list;
-    	}
-    	$data['total']=$totalPage;
-    	$this->success('',$data);
+        $map['status'] = 1;
+        $map['catid'] = 1;
+        $p = $this->request->request('p');
+        if (empty($p)) {
+            $this->error('缺少参数页码');
+        }
+        $pagesize = 10;
+        $total = db('article')->where($map)->count();
+        $totalPage = ceil($total / $pagesize);
+        if ($p > $totalPage && $total > 0) {
+            $this->error('页码有误');
+        }
+        $list = db('article')->where($map)->page($p, $pagesize)->order('id desc')->select();
+        foreach ($list as &$v) {
+            $v['ctime'] = date('Y-m-d H:i:s', $v['ctime']);
+            $v['abs'] = mbsubstr($v['content'], 0, 30);
+            $v['prc'] = empty($v['prc']) ? 'http://' . $_SERVER['HTTP_HOST'] . '/assets/shop/img/gg.png' : $v['prc'];
+        }
+        if (empty($list)) {
+            $data['list'] = [];
+        } else {
+            $data['list'] = $list;
+        }
+        $data['total'] = $totalPage;
+        $this->success('', $data);
     }
+
     function fdbonus()
     {
-    	db()->execute('call CashBonus()');
-    	$this->success('执行完毕');
+        db()->execute('call CashBonus()');
+        $this->success('执行完毕');
     }
 
     /*发送留言  */
     function tosendmsg()
     {
-    	$uid=input('uid');
-    	$content=input('content');
-    	if(empty($content))
-    	{
-    		$this->error(__("请输入留言"));
-    	}
-    	$param['content']=$content;
-    	$param['from_uid']=0;
-    	$param['to_uid']=$uid;
-    	$param['ctime']=time();
-    	$param['userid']=$uid;
-    	$ids=db('user_message')->insertGetId($param);
-    	if($ids)
-    	{
-    		goeasy_sms($content);
-    		$this->success(__("留言成功"));
-    	}else{
-    		$this->error(__("留言失败"));
-    	}
+        $uid = input('uid');
+        $content = input('content');
+        if (empty($content)) {
+            $this->error(__("请输入留言"));
+        }
+        $param['content'] = $content;
+        $param['from_uid'] = 0;
+        $param['to_uid'] = $uid;
+        $param['ctime'] = time();
+        $param['userid'] = $uid;
+        $ids = db('user_message')->insertGetId($param);
+        if ($ids) {
+            goeasy_sms($content);
+            $this->success(__("留言成功"));
+        } else {
+            $this->error(__("留言失败"));
+        }
     }
+
     function checkuserappoint()
     {
-        $name=$this->request->request('name');
-        $sid=$this->request->request('sid');
-        $user=db('user')->where(['username|mobile'=>$name])->find();
-        if($user)
-        {
-            $isappoint=db('studio_user')->where(['userid'=>$user['id'],'sid'=>$sid])->find();
-            if($isappoint)
-            {
-                $this->success('',['id'=>$user['id'],'username'=>$user['username'],'isclose'=>0]);
-            }else{
-                $this->success('',['id'=>$user['id'],'username'=>$user['username'],'isclose'=>1]);
+        $name = $this->request->request('name');
+        $sid = $this->request->request('sid');
+        $user = db('user')->where(['username|mobile' => $name])->find();
+        if ($user) {
+            $isappoint = db('studio_user')->where(['userid' => $user['id'], 'sid' => $sid])->find();
+            if ($isappoint) {
+                $this->success('', ['id' => $user['id'], 'username' => $user['username'], 'isclose' => 0]);
+            } else {
+                $this->success('', ['id' => $user['id'], 'username' => $user['username'], 'isclose' => 1]);
             }
-        }else{
+        } else {
             $this->error('您输入的会员不存在');
         }
 
     }
+
     function setuserappoint()
     {
-        $userid=$this->request->request('userid');
-        $sid=$this->request->request('sid');
-        $isappoint=$this->request->request('isappoint');
-        $info=db('studio_user')->where(['userid'=>$userid,'sid'=>$sid])->find();
-        if($info)
-        {
-            if($isappoint == 1)
-            {
-                db('studio_user')->where(['id'=>$info['id']])->delete();
+        $userid = $this->request->request('userid');
+        $sid = $this->request->request('sid');
+        $isappoint = $this->request->request('isappoint');
+        $info = db('studio_user')->where(['userid' => $userid, 'sid' => $sid])->find();
+        if ($info) {
+            if ($isappoint == 1) {
+                db('studio_user')->where(['id' => $info['id']])->delete();
                 $this->success('设置成功');
-            }else{
+            } else {
                 $this->error('您并未做任何修改');
             }
-        }else{
-            if($isappoint == 1)
-            {
+        } else {
+            if ($isappoint == 1) {
                 $this->error('您并未做任何修改');
-            }else{
-                db('studio_user')->insertGetId(['userid'=>$userid,'sid'=>$sid,'ctime'=>time(),'status'=>1]);
+            } else {
+                db('studio_user')->insertGetId(['userid' => $userid, 'sid' => $sid, 'ctime' => time(), 'status' => 1]);
                 $this->success('设置成功');
             }
         }
 
     }
+
     /* 获取节点 */
     function getClass()
     {
-    	$rootid=input('rootid');
-    	$uid=input('uid'); 	
-    	$where['refereeid']=$uid;	 		
-    	if($uid==0){
-    		$myself = db('user')->where(['id'=>$rootid])->find();
-    		$value['uid'] = $myself['id'];
-    		$value['status'] = $myself['status'];
-    		$value['usernumber'] = $myself['username']."[姓名:".$myself['nickname']."]";
-    		$count = db('user')->where('refereeid',$value['uid'])->count();
-    		$value['count']= $count;
-    		if($count!=0){
-    			$value['isParent']= true;
-    		}else{
-    			$value['isParent']= false;
-    		}
-    		$list[] = $value;
-    	}else{
-    		$info = db('user')->where($where)->select();
-    		foreach ($info as $value){
-    			$count = db('user')->where('refereeid',$value['id'])->count();
-    			$value['count']= $count;
-    			if($count!=0){
-    				$value['isParent']= true;
-    			}  else {
-    				$value['isParent']= false;
-    			}
-    			$value['uid']=$value['id'];
-    			$value['usernumber'] = $value['username']."[姓名:".$value['nickname']."]";
-    			$list[] = $value;
-    		}
-    	}
-    	return $list;	
+        $rootid = input('rootid');
+        $uid = input('uid');
+        $where['refereeid'] = $uid;
+        if ($uid == 0) {
+            $myself = db('user')->where(['id' => $rootid])->find();
+            $value['uid'] = $myself['id'];
+            $value['status'] = $myself['status'];
+            $value['usernumber'] = $myself['username'] . "[姓名:" . $myself['nickname'] . "]";
+            $count = db('user')->where('refereeid', $value['uid'])->count();
+            $value['count'] = $count;
+            if ($count != 0) {
+                $value['isParent'] = true;
+            } else {
+                $value['isParent'] = false;
+            }
+            $list[] = $value;
+        } else {
+            $info = db('user')->where($where)->select();
+            foreach ($info as $value) {
+                $count = db('user')->where('refereeid', $value['id'])->count();
+                $value['count'] = $count;
+                if ($count != 0) {
+                    $value['isParent'] = true;
+                } else {
+                    $value['isParent'] = false;
+                }
+                $value['uid'] = $value['id'];
+                $value['usernumber'] = $value['username'] . "[姓名:" . $value['nickname'] . "]";
+                $list[] = $value;
+            }
+        }
+        return $list;
     }
+
     /* 奖金设置 */
     function bonus_set()
     {
-    	$param=$this->request->get();
-    	$data_arr=explode('-',$param['id']);
-		$column=$data_arr['0'];
-		$key=$data_arr['1'];
-		//模型
-		if(count($data_arr)<3){
-			$data_model="bonus_config";
-		}else{
-			$data_model=$data_arr['2'];
-		}	
-		$data[$column]=$param['val'];
-		$info=db($data_model)->where('id',$key)->find();
-		$res=db($data_model)->where('id',$key)->update($data);
-		if($res){
-			$this->success("修改完成");
-		}else{
-			$this->error("修改完成");
-		}
+        $param = $this->request->get();
+        $data_arr = explode('-', $param['id']);
+        $column = $data_arr['0'];
+        $key = $data_arr['1'];
+        //模型
+        if (count($data_arr) < 3) {
+            $data_model = "bonus_config";
+        } else {
+            $data_model = $data_arr['2'];
+        }
+        $data[$column] = $param['val'];
+        $info = db($data_model)->where('id', $key)->find();
+        $res = db($data_model)->where('id', $key)->update($data);
+        if ($res) {
+            $this->success("修改完成");
+        } else {
+            $this->error("修改完成");
+        }
     }
+
     /*切换用户名  */
     function switchname()
     {
-    	$randStr = str_shuffle('1234567890');
-    	$randZm = str_shuffle('abcdefghijklmnopqrstuvwxyz');
-    	$username= substr($randZm,0,2).substr($randStr,0,6);//账号为7位随机数
-    	$this->success($username);
+        $randStr = str_shuffle('1234567890');
+        $randZm = str_shuffle('abcdefghijklmnopqrstuvwxyz');
+        $username = substr($randZm, 0, 2) . substr($randStr, 0, 6);//账号为7位随机数
+        $this->success($username);
     }
+
     function getuserid()
     {
-        $param=$this->request->get();
-        $info=db('user')->where(['username|mobile'=>$param['username']])->find();
-        if($info)
-        {
+        $param = $this->request->get();
+        $info = db('user')->where(['username|mobile' => $param['username']])->find();
+        if ($info) {
             $this->success($info['id']);
-        }else{
+        } else {
             $this->error('用户不存在');
         }
     }
+
     function getstuid()
     {
-        $param=$this->request->get();
-        $info=db('studio')->where(['title'=>$param['title']])->find();
-        if($info)
-        {
+        $param = $this->request->get();
+        $info = db('studio')->where(['title' => $param['title']])->find();
+        if ($info) {
             $this->success($info['id']);
-        }else{
+        } else {
             $this->error('商家不存在');
         }
     }
+
     /* 检测用户名 */
     function checkusername()
     {
-    	$param=$this->request->get();
-    	$info=db('user')->where('username',$param['username'])->find();
-    	if($info)
-    	{
-    		$this->error("用户名已注册,请更换");
-    	}else{
-    		$this->success("用户名可以使用");
-    	}
+        $param = $this->request->get();
+        $info = db('user')->where('username', $param['username'])->find();
+        if ($info) {
+            $this->error("用户名已注册,请更换");
+        } else {
+            $this->success("用户名可以使用");
+        }
     }
+
     /* 获取昵称 */
     function getnickname()
     {
-    	$param=$this->request->get();
-    	$info=db('user')->where(['username|mobile'=>$param['username']])->find();
-    	if($info)
-    	{
-    		$this->success($info['nickname']);
-    	}else{
-    		$this->error('用户不存在');
-    	}
+        $param = $this->request->get();
+        $info = db('user')->where(['username|mobile' => $param['username']])->find();
+        if ($info) {
+            $this->success($info['nickname']);
+        } else {
+            $this->error('用户不存在');
+        }
     }
+
     /* 获取位置节点pos */
     function getpos()
     {
-    	$param=$this->request->get();
-    	$info=db('user')->where(['username'=>$param['username'],'status'=>1])->find();
-    	if(!$info)
-    	{
-    		$this->error("会员不存在或不可用");
-    	}
-    	$str="<option value=''>请选择</option>";
-    	$pos=config('pos');
-    	$list=db('user_parent')->where('pid',$info['id'])->select();
-    	if($list)
-    	{
-    		$pos_arr=[];
-	    	foreach ($list as $k=>$v)
-	    	{
-	    		$pos_arr[$v['position']]=$v;
-	    	}	
-	    	foreach ($pos as $key=>$v)
-	    	{
-	    		if(empty($pos_arr[$key]['userid']))
-	    		{
-	    			$str.="<option value='{$key}'>".$v.'</option>';	
-	    		}else{
-	    			$str.="<option value='{$key}' disabled>".$v.'【'.$pos_arr[$key]['username'].'】</option>';
-	    		}
-	    	}
-    	}else{
-    		foreach ($pos as $key=>$v)
-    		{
-    			$str.="<option value='{$key}'>".$v.'</option>';
-    		}
-    	}
-    	$this->success($str);
+        $param = $this->request->get();
+        $info = db('user')->where(['username' => $param['username'], 'status' => 1])->find();
+        if (!$info) {
+            $this->error("会员不存在或不可用");
+        }
+        $str = "<option value=''>请选择</option>";
+        $pos = config('pos');
+        $list = db('user_parent')->where('pid', $info['id'])->select();
+        if ($list) {
+            $pos_arr = [];
+            foreach ($list as $k => $v) {
+                $pos_arr[$v['position']] = $v;
+            }
+            foreach ($pos as $key => $v) {
+                if (empty($pos_arr[$key]['userid'])) {
+                    $str .= "<option value='{$key}'>" . $v . '</option>';
+                } else {
+                    $str .= "<option value='{$key}' disabled>" . $v . '【' . $pos_arr[$key]['username'] . '】</option>';
+                }
+            }
+        } else {
+            foreach ($pos as $key => $v) {
+                $str .= "<option value='{$key}'>" . $v . '</option>';
+            }
+        }
+        $this->success($str);
     }
 }

+ 13 - 5
application/api/controller/Trade.php

@@ -109,6 +109,7 @@ class Trade extends Api
                     'status'=>1,
                     'relevant_userid'=>$this->auth->id,
                     'fee'=>$fee,
+                    'pre_price'=> $ginfo['pre_price'],
                     'remark'=>date('Y-m-d H:i:s'),
                     'catid'=>$ginfo['catid'],
                     'stuid'=>$ginfo['stuid'],
@@ -275,8 +276,8 @@ class Trade extends Api
             $bcf=db('bonus_config')->where(['id'=>1])->find();
             $endprice=$tradeinfo['nums']*$bcf['value']*0.01+$tradeinfo['nums'];
             db()->startTrans();
-            $res1=db('trade')->where(['id'=>$id])->update(['confirm_time'=>time(),'endnums'=>$endprice,'status'=>3]);
-            $res2=db('goods')->where(['id'=>$tradeinfo['goodsid']])->update(['userid'=>$tradeinfo['relevant_userid'],'update_time'=>time(),'price1'=>$endprice]);
+            $res1=db('trade')->where(['id'=>$id])->update(['confirm_time'=>time(),'endnums'=>$endprice,'pre_price'=> $endprice-$tradeinfo['nums'],'status'=>3]);
+            $res2=db('goods')->where(['id'=>$tradeinfo['goodsid']])->update(['userid'=>$tradeinfo['relevant_userid'],'update_time'=>time(),'price1'=>$endprice,'pre_price'=> $endprice-$tradeinfo['nums']]);
             if($res1  && $res2)
             {
                 db()->commit();
@@ -937,7 +938,7 @@ class Trade extends Api
         }
 
         db()->startTrans();
-        $totalUsdt = CoinRate::transfer($trade['endnums']);
+        $totalUsdt = CoinRate::transfer($trade['pre_price']);
         $res=db('trade')->where(['id'=>$id,'status'=>3])->update(['on_resale'=>1,'status'=>4,'release_total_usdt'=> $totalUsdt]);
         $res1=db('goods')->where(['id'=>$trade['goodsid']])->update(['time1'=>time(),'on_resale'=> 1]);
         if($res && $res1)
@@ -1130,6 +1131,7 @@ class Trade extends Api
         }
         
     }
+    // 拆分
     function tosongoods()
     {
         $gid=input('id');
@@ -1147,25 +1149,30 @@ class Trade extends Api
         // if($goodsinfo['topprice']<=$goodsinfo['price1'])
         // {
         $sum=0;
+        $sumpreprice=0;
         for($i=1;$i<=(int)$goodsinfo['son_nums'];$i++)
         {
             if($i < (int)$goodsinfo['son_nums'])
             {
                 $price=round(($goodsinfo['price1']/$goodsinfo['son_nums']),0);
+                $preprice=round(($goodsinfo['pre_price']/$goodsinfo['son_nums']),0);
                 $sum+=$price;
+                $sumpreprice+=$preprice;
             }else{
                 $price=$goodsinfo['price1']-$sum;
+                $preprice=$goodsinfo['pre_price']-$sumpreprice;
             }
             $data=[
                 'catid'=>$goodsinfo['catid'],
                 'title'=>$goodsinfo['title'].$i,
-                'description'=>$goodsinfo['description'],
+                'description'=>$goodsinfo['description'].'-'.$i,
                 'content'=>$goodsinfo['content'],
                 'image'=>$goodsinfo['image'],
                 'images'=>$goodsinfo['images'],
                 'on_sale'=>1,
-                'price'=>$price,
+                'price'=>$price-$preprice,
                 'price1'=>$price,
+                'pre_price'=>$preprice,
                 'topprice'=>$goodsinfo['topprice'],
                 'son_nums'=>$goodsinfo['son_nums'],
                 'utime'=>time(),
@@ -1177,6 +1184,7 @@ class Trade extends Api
            
             $ids=db('goods')->insertGetId($data);
         }
+
         db('goods')->where(['id'=>$goodsinfo['id']])->update(['on_sale'=>0,'price1'=>0,'price'=>0]);
         db('trade')->where(['goodsid'=>$goodsinfo['id'],'status'=>3])->update(['isout'=>1]);
     // }  

+ 143 - 0
application/cmgadm/controller/shop/Material.php

@@ -0,0 +1,143 @@
+<?php
+
+namespace app\cmgadm\controller\shop;
+
+use app\common\controller\Backend;
+use app\cmgadm\model\Goodscats;
+use Think\Db;
+use think\Session;
+
+/**
+ * 推广素材管理
+ *
+ * @icon fa fa-circle-o
+ */
+class Material extends Backend
+{
+    
+    /**
+     * Material模型对象
+     * @var \app\cmgadm\model\Material
+     */
+    protected $model = null;
+
+    public function _initialize()
+    {
+        parent::_initialize();
+        $this->model = new \app\cmgadm\model\Material;
+        $this->assign('shoptype',config('shopType'));
+    }
+    
+    /**
+     * 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个基础方法、destroy/restore/recyclebin三个回收站方法
+     * 因此在当前控制器中可不用编写增删改查的代码,除非需要自己控制这部分逻辑
+     * 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改
+     */
+    
+
+    /**
+     * 查看
+     */
+    public function index()
+    {
+        //当前是否为关联查询
+        $this->relationSearch = false;
+        //设置过滤方法
+        $this->request->filter(['strip_tags']);
+        if ($this->request->isAjax())
+        {
+            //如果发送的来源是Selectpage,则转发到Selectpage
+            if ($this->request->request('keyField'))
+            {
+                return $this->selectpage();
+            }
+            list($where, $sort, $order, $offset, $limit) = $this->buildparams();
+            $total = $this->model                    
+                    ->where($where)
+                    ->order($sort, $order)
+                    ->count();
+
+            $list = $this->model                   
+                    ->where($where)
+                    ->order($sort, $order)
+                    ->limit($offset, $limit)
+                    ->select();
+
+            $result = array("total" => $total, "rows" => $list);
+
+            return json($result);
+        }
+        return $this->view->fetch();
+    }
+    function add()
+    {
+        if ($this->request->isPost()) {
+            $params = $this->request->post("row/a");
+            if ($params) {
+                $params = $this->preExcludeFields($params);
+                if ($this->dataLimit && $this->dataLimitFieldAutoFill) {
+                    $params[$this->dataLimitField] = $this->auth->id;
+                }
+
+                $result = false;
+                Db::startTrans();
+                try {
+                    //是否采用模型验证
+                    if ($this->modelValidate) {
+                        $name = str_replace("\\model\\", "\\validate\\", get_class($this->model));
+                        $validate = is_bool($this->modelValidate) ? ($this->modelSceneValidate ? $name . '.add' : $name) : $this->modelValidate;
+                        $this->model->validateFailException(true)->validate($validate);
+                    }
+                    $result = $this->model->allowField(true)->insertGetId($params);
+                    Db::commit();
+                } catch (ValidateException $e) {
+                    Db::rollback();
+                    $this->error($e->getMessage());
+                } catch (PDOException $e) {
+                    Db::rollback();
+                    $this->error($e->getMessage());
+                } catch (Exception $e) {
+                    Db::rollback();
+                    $this->error($e->getMessage());
+                }
+                if ($result !== false) {
+                    $this->success();
+                } else {
+                    $this->error(__('No rows were inserted'));
+                }
+            }
+            $this->error(__('Parameter %s can not be empty', ''));
+        }
+        return parent::add();
+    }
+    public function edit($ids = NULL)
+    {
+        $row = $this->model->get($ids);
+        if (!$row)
+        {
+            $this->error(__('No Results were found'));
+        }
+        return parent::edit($ids);
+    }
+	function multi($ids = '')
+	{
+		 $ids = $ids ? $ids : $this->request->param("ids");
+         if ($ids) {
+           $params=input('params');
+           $arrs=explode('=', $params);
+           $data[$arrs[0]]=$arrs[1];
+           $res=$this->model->where(['id'=>$ids])->update ($data);
+           if($res)
+           {
+           		$this->success('操作成功');
+           }else{
+           		$this->error('操作失败');
+           }
+        }else{
+        	$this->error('请选择要操作的数据');
+        }
+		return parent::multi($ids);
+	}
+
+
+}

+ 47 - 0
application/cmgadm/model/Material.php

@@ -0,0 +1,47 @@
+<?php
+
+namespace app\cmgadm\model;
+
+use think\Model;
+
+
+class Material extends Model
+{
+
+    
+
+    
+
+    // 表名
+    protected $name = 'material';
+    
+    // 自动写入时间戳字段
+    protected $autoWriteTimestamp = false;
+
+    // 定义时间戳字段名
+    protected $createTime = false;
+    protected $updateTime = false;
+
+    // 追加属性
+    protected $append = [
+        'ctime_text'
+    ];
+    
+
+    
+
+
+
+    public function getCtimeTextAttr($value, $data)
+    {
+        $value = $value ? $value : (isset($data['ctime']) ? $data['ctime'] : '');
+        return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
+    }
+
+    protected function setCtimeAttr($value)
+    {
+        return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
+    }
+
+
+}

+ 41 - 0
application/cmgadm/view/shop/material/add.html

@@ -0,0 +1,41 @@
+<form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('文案')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-title" data-rule="required" class="form-control" name="row[title]" type="text" maxlength="200">
+        </div>
+    </div>
+     <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('素材图片')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <div class="input-group">
+                <input id="c-images" data-rule="required" class="form-control" size="50" name="row[images]" type="text">
+                <div class="input-group-addon no-border no-padding">
+                    <span><button type="button" id="plupload-images" class="btn btn-danger plupload" data-input-id="c-images" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp" data-multiple="true" data-preview-id="p-images"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
+                    <span><button type="button" id="fachoose-images" class="btn btn-primary fachoose" data-input-id="c-images" data-mimetype="image/*" data-multiple="true"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
+                </div>
+                <span class="msg-box n-right" for="c-images"></span>
+            </div>
+            <ul class="row list-inline plupload-preview" id="p-images"></ul>
+        </div>
+    </div>
+
+    <div class="form-group layer-footer">
+        <label class="control-label col-xs-12 col-sm-2"></label>
+        <div class="col-xs-12 col-sm-8">
+            <button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
+            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
+        </div>
+    </div>
+</form>
+<script src="__CDN__/assets/libs/jquery/dist/jquery.min.js" type="text/javascript"></script>
+<script type="text/javascript">
+$('.addattr').click(function(){
+	var attr=$('#c-attr').val();
+	if(attr != '')
+	{
+		$('.attrs').prepend('<th>'+attr+'</th>');
+	}
+});
+</script>
+

+ 30 - 0
application/cmgadm/view/shop/material/edit.html

@@ -0,0 +1,30 @@
+<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('文案')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-title" data-rule="required" class="form-control" name="row[title]" type="text" value="{$row.title|htmlentities}">
+        </div>
+    </div>
+     <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('素材图片')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <div class="input-group">
+                <input id="c-images" data-rule="required" class="form-control" size="50" name="row[images]" type="text" value="{$row.images|htmlentities}">
+                <div class="input-group-addon no-border no-padding">
+                    <span><button type="button" id="plupload-images" class="btn btn-danger plupload" data-input-id="c-images" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp" data-multiple="true" data-preview-id="p-images"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
+                    <span><button type="button" id="fachoose-images" class="btn btn-primary fachoose" data-input-id="c-images" data-mimetype="image/*" data-multiple="true"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
+                </div>
+                <span class="msg-box n-right" for="c-images"></span>
+            </div>
+            <ul class="row list-inline plupload-preview" id="p-images"></ul>
+        </div>
+    </div>
+
+    <div class="form-group layer-footer">
+        <label class="control-label col-xs-12 col-sm-2"></label>
+        <div class="col-xs-12 col-sm-8">
+            <button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
+            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
+        </div>
+    </div>
+</form>

+ 23 - 0
application/cmgadm/view/shop/material/index.html

@@ -0,0 +1,23 @@
+<div class="panel panel-default panel-intro">
+    {:build_heading()}
+
+    <div class="panel-body">
+        <div id="myTabContent" class="tab-content">
+            <div class="tab-pane fade active in" id="one">
+                <div class="widget-body no-padding">
+                    <div id="toolbar" class="toolbar">
+                        <a href="javascript:;" class="btn btn-primary btn-refresh" title="{:__('Refresh')}" ><i class="fa fa-refresh"></i> </a>
+                        <a href="javascript:;" class="btn btn-success btn-add {:$auth->check('shop/material/add')?'':'hide'}" title="{:__('Add')}" ><i class="fa fa-plus"></i> {:__('Add')}</a>
+                        <a href="javascript:;" class="btn btn-success btn-edit btn-disabled disabled {:$auth->check('shop/material/edit')?'':'hide'}" title="{:__('Edit')}" ><i class="fa fa-pencil"></i> {:__('Edit')}</a>
+                        <a href="javascript:;" class="btn btn-danger btn-del btn-disabled disabled {:$auth->check('shop/material/del')?'':'hide'}" title="{:__('Delete')}" ><i class="fa fa-trash"></i> {:__('Delete')}</a>
+                    </div>
+                    <table id="table" class="table table-striped table-bordered table-hover table-nowrap"
+                           data-operate-edit="{:$auth->check('shop/material/edit')}"
+                           data-operate-del="{:$auth->check('shop/material/del')}"
+                           width="100%">
+                    </table>
+                </div>
+            </div>
+        </div>
+    </div>
+</div>

+ 47 - 0
application/common/model/Material.php

@@ -0,0 +1,47 @@
+<?php
+
+namespace app\common\model;
+
+use think\Model;
+
+
+class Material extends Model
+{
+
+    
+
+    
+
+    // 表名
+    protected $name = 'material';
+    
+    // 自动写入时间戳字段
+    protected $autoWriteTimestamp = false;
+
+    // 定义时间戳字段名
+    protected $createTime = false;
+    protected $updateTime = false;
+
+    // 追加属性
+    protected $append = [
+        'ctime_text'
+    ];
+    
+
+    
+
+
+
+    public function getCtimeTextAttr($value, $data)
+    {
+        $value = $value ? $value : (isset($data['ctime']) ? $data['ctime'] : '');
+        return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
+    }
+
+    protected function setCtimeAttr($value)
+    {
+        return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
+    }
+
+
+}

+ 4 - 2
application/index/view/user/login.html

@@ -46,11 +46,11 @@
 			{:token()}
 			<div class="am-form-group am-form-icon am-margin-bottom-lg">
 				<img class="icons" src="__CDN__/assets/shop/img/login_user.png" >
-				<input type="text" class="am-form-field am-input-lg" placeholder="请输入手机号" value="" name="account">
+				<input id="mobile" type="text" class="am-form-field am-input-lg" placeholder="请输入手机号" value="" name="account">
 			</div>
 			<div class="am-form-group am-form-icon">
 				<img class="icons" src="__CDN__/assets/shop/img/login_pwd.png" >
-				<input type="password" class="am-form-field" placeholder="请输入登录密码" value="" name="password">
+				<input id="password" type="password" class="am-form-field" placeholder="请输入登录密码" value="" name="password">
 			</div>
 			<div class="am-form-group am-form-icon">
 				<img class="icons" src="__CDN__/assets/shop/img/login_verify.png" >
@@ -70,6 +70,8 @@
 </div>
 <script src="__CDN__/assets/shop/js/jquery.min.js"></script>
 <script src="__CDN__/assets/shop/js/amazeui.js"></script>
+<!--<script src="__CDN__/assets/shop/js/cookie.js"></script>-->
+<!--<script src="__CDN__/assets/shop/js/mdd.js"></script>-->
 <script src="__CDN__/assets/libs/layer/layer.js"></script>
 <script>
 

+ 13 - 0
application/shop/controller/Goods.php

@@ -3,6 +3,7 @@
 namespace app\shop\controller;
 use app\common\controller\Frontend;
 use app\common\library\Image;
+use app\common\model\Config;
 use GuzzleHttp\json_decode;
 use think\cache\driver\Redis;
 
@@ -56,13 +57,25 @@ class Goods extends Frontend
             'surplus_usdt'=> isset($counts['surplus_usdt'])? $counts['surplus_usdt'] : 0,
             'release_usdt'=> isset($counts['release_usdt'])? $counts['release_usdt'] : 0,
         ];
+        $config = Config::getConfigByGroup('trade');
+        $rates['release_rate'] = isset($config['release_rate'])? floatval($config['release_rate']['value']) : 0;
+        $rates['award_rate'] = isset($config['award_rate'])? floatval($config['award_rate']['value']) : 0;
 
+        $this->view->assign('config', $rates);
         $this->view->assign('awards', $awards);
         $this->view->assign('cats', $cats);
         $this->view->assign('logo', Image::makeLogo($sinfo['name']));
         return $this->fetch();
     }
 
+    /**
+     * 模式
+     * @return mixed
+     */
+    function model(){
+        return $this->fetch();
+    }
+
 	function goodslist()
 	{
         $catid=input('catid');

+ 6 - 0
application/shop/controller/Trade.php

@@ -443,14 +443,20 @@ class Trade extends Frontend{
         $id=input('id');
         $trade=db('trade')->where(['id'=>$id])->find();
         $goods= db('goods')->where(['id'=>$trade['goodsid']])->find();
+        if(empty($goods)){
+            $this->error('商品信息错误');
+        }
         $selluser=db('user')->where(['id'=>$trade['userid']])->find();
         $level=get_user_data($this->auth->id,'level');
         $feeCf=db('bonus_config')->where(['config_type'=>3,'user_level'=>$level])->find();
         $bcf=db('bonus_config')->where(['id'=>1])->find();
         $rtx=$bcf['value'];
         $goods['price_usdt'] = round(CoinRate::transfer($goods['price1']),2);
+        $goods['pre_price_usdt'] = round(CoinRate::transfer($trade['pre_price']),2);
         $goods['price_thb'] = round(CoinRate::transfer($goods['price1'],'CNY','THB'),2);
+        $goods['pre_price_thb'] = round(CoinRate::transfer($trade['pre_price'],'CNY','THB'),2);
         $goods['price_idr'] = round(CoinRate::transferRp($goods['price1'],'CNY','IDR'),2);
+        $goods['pre_price_idr'] = round(CoinRate::transferRp($trade['pre_price'],'CNY','IDR'),2);
         $selluser['usdt_address_text'] = $selluser['usdt_address']? substr($selluser['usdt_address'],0,6).'***'.substr($selluser['usdt_address'],-6,6) : '';
         $this->view->assign([
             'selluser'=>$selluser,

+ 13 - 0
application/shop/controller/User.php

@@ -157,6 +157,11 @@ class User extends Frontend{
         $this->view->assign("user", $user);
         return $this->view->fetch();
     }
+    function material(){
+        $lists = [];
+        $this->view->assign("lists", $lists);
+        return $this->view->fetch();
+    }
     function setting()
     {
         $user = db('user')->where(['id' => $this->auth->id])->find();
@@ -164,6 +169,14 @@ class User extends Frontend{
         return $this->fetch();
     }
 
+    /**
+     * 联系我们
+     * @return mixed
+     */
+    function aboutus(){
+         return $this->fetch();
+    }
+
     /*修改资料*/
     function updatenickname()
     {

+ 1 - 1
application/shop/view/goods/goodsdetailed.html

@@ -140,7 +140,7 @@
                     {
 						layer.msg(data.msg);
                         setTimeout(function(){
-							location.reload();
+							location= '/shop/trade/topay/id/'+data.data.id;
 						}, 800)
                     }else{
                         layer.msg(data.msg);

+ 38 - 17
application/shop/view/goods/index.html

@@ -101,12 +101,15 @@
             font-size: 18px;
         }
 
+        .block .text span {
+            font-size: 12px;
+            color: #ece1ce;
+        }
         .account .release {
             margin-left: 15px;
         }
 
         .orders {
-            margin: 15px 0;
             border-radius: 2px;
         }
 
@@ -133,6 +136,7 @@
 
         .menu {
             border-radius: 2px;
+            margin: 15px 0;
         }
 
         .menu ul  {
@@ -157,7 +161,7 @@
         }
 
         .goods {
-            padding: 0px 15px;
+            /*padding: 0px 15px;*/
             position: relative;
         }
 
@@ -199,6 +203,12 @@
             white-space: normal;
             overflow: hidden;
         }
+        .goods-img {
+            padding-bottom: 30px;
+        }
+        .goods-img img {
+            width: 100%;
+        }
         .bg-brown {
             background-color: #6e4423;
         }
@@ -227,7 +237,7 @@
         <div class="account">
             <div class="block award bg-brown">
                 <p class="money">{$awards.total_usdt}$</p>
-                <p class="text">流拍基金(usdt)</p>
+                <p class="text">流拍基金(usdt)<br><span>(全网营业额{$config.award_rate}%新增奖池)</span></p>
             </div>
             <div class="block release bg-green">
                 <div class="waiting">
@@ -236,10 +246,28 @@
                 </div>
                 <div class="send" onclick="window.location='/shop/user/releaselog'">
                     <p class="money">{$awards.release_usdt}$</p>
-                    <p class="text">已发放</p>
+                    <p class="text">已发放<br><span>({$config.release_rate}%每天返回本金)</span></p>
                 </div>
             </div>
         </div>
+
+        <div class="menu bg-cyan">
+            <ul>
+                {volist name="cats" id="v"}
+                {if $v.name == '模式'}
+                <li onclick="window.location='/shop/goods/model'" >
+                    <div class=""><img src="{$v.image}" width="75%" style="border-radius:100%;"/></div>
+                    <div class="am-padding-top-xs">{$v.name}</div>
+                </li>
+                {else}
+                <li onclick="window.location='/shop/goods/goodslist/catid/{$v.id}'" >
+                    <div class=""><img src="{$v.image}" width="75%" style="border-radius:100%;"/></div>
+                    <div class="am-padding-top-xs">{$v.name}</div>
+                </li>
+                {/if}
+                {/volist}
+            </ul>
+        </div>
         <div class="orders bg-purple">
             <ul>
                 <li onclick="window.location='/shop/trade/trade1'" >
@@ -256,21 +284,14 @@
                 </li>
             </ul>
         </div>
-        <div class="menu bg-cyan">
-            <ul>
-                {volist name="cats" id="v"}
-                <li onclick="window.location='/shop/goods/goodslist/catid/{$v.id}'" >
-                    <div class=""><img src="{$v.image}" width="75%" style="border-radius:100%;"/></div>
-                    <div class="am-padding-top-xs">{$v.name}</div>
-                </li>
-                {/volist}
-            </ul>
-        </div>
     </div>
     <div class="goods bg-light">
         <div class="title"><img src="__CDN__/assets/shop/img/goods/goods-header.png" alt=""></div>
         <div class="good-list">
-            <div class="list-item">
+            <div class="goods-img">
+                <img src="__CDN__/assets/shop/img/goods/goods.jpeg" alt="">
+            </div>
+            <!--<div class="list-item">
                 <p class="thumb"><img src="__CDN__/assets/shop/img/goods/goods1.jpeg" alt=""></p>
                 <p class="good-name">丝澜 2021年景迈 大宗师普洱生茶2.5kg/提(7饼)</p>
             </div>
@@ -285,14 +306,14 @@
             <div class="list-item">
                 <p class="thumb"><img src="__CDN__/assets/shop/img/goods/goods4.jpeg" alt=""></p>
                 <p class="good-name">丝澜 2021年景迈山里 普洱熟茶2.5kg/提(7饼)</p>
-            </div>
+            </div>-->
         </div>
     </div>
     <!-- Footer-Menu -->
     <div id="navbar">
         <ul id="menu">
             <li class="item"><a data-href="{:url('shop/index/index')}">首页</a></li>
-            <li class="item active"><a data-href="{:url('/shop/goods/index')}" >商城</a></li>
+            <li class="item active"><a data-href="{:url('/shop/goods/index')}" >代拍商城</a></li>
             <li class="item"><a data-href="{:url('shop/trade/tradelist')}" >全部订单</a></li>
             <li class="item"><a data-href="{:url('shop/user/bonuspage')}" >分销中心</a></li>
             <li class="item"><a data-href="{:url('shop/user/index')}">个人中心</a></li>

Diff do ficheiro suprimidas por serem muito extensas
+ 136 - 0
application/shop/view/goods/model.html


+ 1 - 1
application/shop/view/index/index.html

@@ -127,7 +127,7 @@
     <div id="navbar">
         <ul id="menu">
             <li class="item active"><a data-href="{:url('shop/index/index')}">首页</a></li>
-            <li class="item"><a data-href="{:url('/shop/goods/index')}" >商城</a></li>
+            <li class="item"><a data-href="{:url('/shop/goods/index')}" >代拍商城</a></li>
             <li class="item"><a data-href="{:url('shop/trade/tradelist')}" >全部订单</a></li>
             <li class="item"><a data-href="{:url('shop/user/bonuspage')}" >分销中心</a></li>
             <li class="item"><a data-href="{:url('shop/user/index')}">个人中心</a></li>

+ 1 - 0
application/shop/view/trade/managergoods.html

@@ -106,6 +106,7 @@
                                         '<p  class="text-line1 am-bold">'+json[i].title+'</p>'+
                                         '<p  class="am-text-danger">持有人:'+json[i].username+'</p>'+
                                         '<p  class="">价格:'+json[i].price1+'</p>'+
+                                        '<p  class="">代拍金:'+json[i].pre_price+'</p>'+
                                      '</div>'+
                                 '</div>'+
                                  '<div class="am-text-right">' +  btn+'</div>'+

+ 30 - 2
application/shop/view/trade/topay.html

@@ -61,6 +61,10 @@
         .am-list-news-default .am-list .am-list-item-desced .am-list-item-text {
             color: #000
         }
+
+        .text-danger {
+            color: red;
+        }
     </style>
 </head>
 <body class="">
@@ -128,6 +132,12 @@
                     <span class="am-block am-fl am-padding-right-sm">{$goods.price1} CNY</span>
                 </span>
             </li>
+            <li>
+                <span class="">&nbsp;</span>
+                <span class="am-fr">
+                    <span class="am-block am-fl am-padding-right-sm text-danger">代拍金:{$info.pre_price} CNY</span>
+                </span>
+            </li>
             {if $selluser['alipayname'] != ''}
             <li>
                 <span class="">支付宝账户</span>
@@ -183,10 +193,16 @@
                 </span>
             </li>
             <li>
+                <span class="">&nbsp;</span>
+                <span class="am-fr">
+                    <span class="am-block am-fl am-padding-right-sm text-danger">代拍金:{$goods.pre_price_usdt} USDT</span>
+                </span>
+            </li>
+            <li>
                 <span class="">USDT收款地址</span>
                 <span class="am-fr">
                     <span class="am-block am-fl am-padding-right-sm">{$selluser.usdt_address_text}</span>
-<!--                    <span class="copy" onclick="copy()" data-clipboard-text="{$selluser.usdt_address}">复制</span>-->
+                    <span class="copy" onclick="copy()" data-clipboard-text="{$selluser.usdt_address}">复制</span>
                 </span>
             </li>
             {/if}
@@ -203,6 +219,12 @@
                     <span class="am-block am-fl am-padding-right-sm">{$goods.price_thb} THB</span>
                 </span>
             </li>
+            <li>
+                <span class="">&nbsp;</span>
+                <span class="am-fr">
+                    <span class="am-block am-fl am-padding-right-sm text-danger">ยิงทอง:{$goods.pre_price_thb} THB</span>
+                </span>
+            </li>
             {/if}
             {if $selluser['thb_bank_number'] != ''}
             <li>
@@ -247,6 +269,12 @@
                     <span class="am-block am-fl am-padding-right-sm">{$goods.price_idr} IDR</span>
                 </span>
             </li>
+            <li>
+                <span class="">&nbsp;</span>
+                <span class="am-fr">
+                    <span class="am-block am-fl am-padding-right-sm text-danger">Prepayments:{$goods.pre_price_idr} IDR</span>
+                </span>
+            </li>
             {/if}
             {if $selluser['idr_bank_number'] != ''}
             <li>
@@ -387,7 +415,7 @@
         jQuery.post("{:url('api/trade/topay')}", {id: $('#tradeid').val(), prc: $('#prc').val()}, function (data) {
             if (data.code > 0) {
                 layer.msg('支付完成', {time: 1000}, function () {
-                    location = "{:url('shop/trade/trade2')}";
+                    location = "{:url('shop/trade/tradelist')}";
                 });
             } else {
                 layer.msg(data.msg);

+ 3 - 2
application/shop/view/trade/trade1.html

@@ -70,7 +70,8 @@
                     </div>
                     <div class="am-g am-padding-bottom-xs am-padding-top-xs ubb">
                         <div class="am-u-sm-8 am-padding-right-0">买入单时间:{$v.ctime|time_format=###,'Y-m-d H:i:s'}</div>
-                        <div class="am-u-sm-4 am-padding-left-0 am-text-right am-text-danger">价值¥{$v.nums}</div>
+                        <div class="am-u-sm-4 am-padding-left-0 am-text-right am-text-danger">代拍价值¥{$v.nums}</div>
+                        <div class="am-u-sm-12 am-padding-left-0 am-text-right am-text-danger">代拍金¥{$v.pre_price}</div>
                     </div>
                     <div class="am-padding-top-sm am-text-right">
                        {if $v['flag'] == 2 && $v['status'] == 1}
@@ -89,7 +90,7 @@
 <div id="navbar">
     <ul id="menu">
         <li class="item"><a data-href="{:url('shop/index/index')}">首页</a></li>
-        <li class="item"><a data-href="{:url('/shop/goods/index')}" >商城</a></li>
+        <li class="item"><a data-href="{:url('/shop/goods/index')}" >代拍商城</a></li>
         <li class="item active"><a data-href="{:url('shop/trade/tradelist')}" >全部订单</a></li>
         <li class="item"><a data-href="{:url('shop/user/bonuspage')}" >分销中心</a></li>
         <li class="item"><a data-href="{:url('shop/user/index')}">个人中心</a></li>

+ 3 - 2
application/shop/view/trade/trade2.html

@@ -69,7 +69,8 @@
                         </div>
                         <div class="am-g am-padding-bottom-xs am-padding-top-xs ubb">
                             <div class="am-u-sm-8 am-padding-right-0">买入单时间:{$v.ctime|time_format=###,'Y-m-d H:i:s'}</div>
-                            <div class="am-u-sm-4 am-padding-left-0 am-text-right am-text-danger">价值¥{$v.nums}</div>
+                            <div class="am-u-sm-4 am-padding-left-0 am-text-right am-text-danger">代拍价值¥{$v.nums}</div>
+                            <div class="am-u-sm-12 am-padding-left-0 am-text-right am-text-danger">代拍金¥{$v.pre_price}</div>
                         </div>
                         <div class="am-padding-top-sm am-text-right">
                             {if $v['flag'] == 1 && $v['status'] == 2 }
@@ -88,7 +89,7 @@
 <div id="navbar">
     <ul id="menu">
         <li class="item"><a data-href="{:url('shop/index/index')}">首页</a></li>
-        <li class="item"><a data-href="{:url('/shop/goods/index')}" >商城</a></li>
+        <li class="item"><a data-href="{:url('/shop/goods/index')}" >代拍商城</a></li>
         <li class="item active"><a data-href="{:url('shop/trade/tradelist')}" >全部订单</a></li>
         <li class="item"><a data-href="{:url('shop/user/bonuspage')}" >分销中心</a></li>
         <li class="item"><a data-href="{:url('shop/user/index')}">个人中心</a></li>

+ 4 - 3
application/shop/view/trade/trade3.html

@@ -87,7 +87,8 @@
                         </div>
                        <div class="am-g am-padding-bottom-xs am-padding-top-xs ubb">
                             <div class="am-u-sm-8 am-padding-right-0">买入单时间:{$v.ctime|time_format=###,'Y-m-d H:i:s'}</div>
-                            <div class="am-u-sm-4 am-padding-left-0 am-text-right am-text-danger">价值¥{if $v['issell'] == 2}{$v.endnums}{else/}{$v.nums}{/if}</div>
+                            <div class="am-u-sm-4 am-padding-left-0 am-text-right am-text-danger">代拍价值¥{if $v['issell'] == 2}{$v.endnums}{else/}{$v.nums}{/if}</div>
+                            <div class="am-u-sm-12 am-padding-left-0 am-text-right am-text-danger">代拍金¥{$v.pre_price}</div>
                         </div>
                          <div class="am-g am-padding-bottom-xs am-padding-top-xs ubb">
                             <div class="am-u-sm-8 am-padding-right-0">确认时间:{$v.confirm_time|time_format=###,'Y-m-d H:i:s'}</div>
@@ -114,7 +115,7 @@
 <div id="navbar">
     <ul id="menu">
         <li class="item"><a data-href="{:url('shop/index/index')}">首页</a></li>
-        <li class="item"><a data-href="{:url('/shop/goods/index')}" >商城</a></li>
+        <li class="item"><a data-href="{:url('/shop/goods/index')}" >代拍商城</a></li>
         <li class="item active"><a data-href="{:url('shop/trade/tradelist')}" >全部订单</a></li>
         <li class="item"><a data-href="{:url('shop/user/bonuspage')}" >分销中心</a></li>
         <li class="item"><a data-href="{:url('shop/user/index')}">个人中心</a></li>
@@ -177,7 +178,7 @@
                 if(data.code>0)
                 {
                     layer.msg('操作完成',{time:1000},function(){
-                        location=location;
+                        location= '/shop/trade/trade4/';
                     });
                 }else{
                     layer.msg(data.msg);

+ 3 - 2
application/shop/view/trade/trade4.html

@@ -57,7 +57,7 @@
 <div id="navbar">
     <ul id="menu">
         <li class="item"><a data-href="{:url('shop/index/index')}">首页</a></li>
-        <li class="item"><a data-href="{:url('/shop/goods/index')}" >商城</a></li>
+        <li class="item"><a data-href="{:url('/shop/goods/index')}" >代拍商城</a></li>
         <li class="item active"><a data-href="{:url('shop/trade/tradelist')}" >全部订单</a></li>
         <li class="item"><a data-href="{:url('shop/user/bonuspage')}" >分销中心</a></li>
         <li class="item"><a data-href="{:url('shop/user/index')}">个人中心</a></li>
@@ -141,7 +141,8 @@
                                 '</div>'+
                                '<div class="am-g am-padding-bottom-xs am-padding-top-xs ubb">' +
                                     '<div class="am-u-sm-8 am-padding-right-0">买入单时间:'+json[i].ctime1+'</div>'+
-                                    '<div class="am-u-sm-4 am-padding-left-0 am-text-right am-text-danger">价值¥'+json[i].endnums+'</div>'+
+                                    '<div class="am-u-sm-4 am-padding-left-0 am-text-right am-text-danger">代拍价值¥'+json[i].endnums+'</div>'+
+                                    '<div class="am-u-sm-12 am-padding-left-0 am-text-right am-text-danger">代拍金¥'+json[i].pre_price+'</div>'+
                                 '</div>';
                     if(json[i].on_resale == 1 && json[i].flag==2 && json[i].status == 4) {
                         _ +='<div class="am-g  am-padding-bottom-xs am-padding-top-xs  ubb">' +

+ 3 - 2
application/shop/view/trade/trade5.html

@@ -72,7 +72,8 @@
                         </div>
                         <div class="am-g am-padding-bottom-xs am-padding-top-xs ubb">
                             <div class="am-u-sm-8 am-padding-right-0">买入单时间:{$v.ctime|time_format=###,'Y-m-d H:i:s'}</div>
-                            <div class="am-u-sm-4 am-padding-left-0 am-text-right am-text-danger">价值¥{$v.nums}</div>
+                            <div class="am-u-sm-4 am-padding-left-0 am-text-right am-text-danger">代拍价值¥{$v.nums}</div>
+                            <div class="am-u-sm-12 am-padding-left-0 am-text-right am-text-danger">代拍金¥{$v.pre_price}</div>
                         </div>
                         <div class="am-padding-top-sm am-text-right">
                             {if $v['flag'] == 1 &&$v['status'] == -1}
@@ -91,7 +92,7 @@
 <div id="navbar">
     <ul id="menu">
         <li class="item"><a data-href="{:url('shop/index/index')}">首页</a></li>
-        <li class="item"><a data-href="{:url('/shop/goods/index')}" >商城</a></li>
+        <li class="item"><a data-href="{:url('/shop/goods/index')}" >代拍商城</a></li>
         <li class="item active"><a data-href="{:url('shop/trade/tradelist')}" >全部订单</a></li>
         <li class="item"><a data-href="{:url('shop/user/bonuspage')}" >分销中心</a></li>
         <li class="item"><a data-href="{:url('shop/user/index')}">个人中心</a></li>

+ 3 - 2
application/shop/view/trade/tradelist.html

@@ -60,7 +60,7 @@
 <div id="navbar">
     <ul id="menu">
         <li class="item"><a data-href="{:url('shop/index/index')}">首页</a></li>
-        <li class="item"><a data-href="{:url('/shop/goods/index')}" >商城</a></li>
+        <li class="item"><a data-href="{:url('/shop/goods/index')}" >代拍商城</a></li>
         <li class="item active"><a data-href="{:url('shop/trade/tradelist')}" >全部订单</a></li>
         <li class="item"><a data-href="{:url('shop/user/bonuspage')}" >分销中心</a></li>
         <li class="item"><a data-href="{:url('shop/user/index')}">个人中心</a></li>
@@ -179,7 +179,8 @@
                                 '</div>'+
                                 '<div class="am-g am-padding-bottom-xs am-padding-top-xs ubb">' +
                                     '<div class="am-u-sm-8 am-padding-right-0">买入单时间:'+json[i].ctime1+'</div>'+
-                                    '<div class="am-u-sm-4 am-padding-left-0 am-text-right am-text-danger">价值¥'+newprice+'</div>'+
+                                    '<div class="am-u-sm-4 am-padding-left-0 am-text-right am-text-danger">代拍价值¥'+newprice+'</div>'+
+                                    '<div class="am-u-sm-12 am-padding-left-0 am-text-right am-text-danger">代拍金¥'+json[i].pre_price+'</div>'+
                                 '</div>'+
                                cfirm+
                                 '<div class="am-padding-top-sm am-text-right">'+

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

@@ -117,7 +117,7 @@
 <div id="navbar">
 	<ul id="menu">
 		<li class="item"><a data-href="{:url('shop/index/index')}">首页</a></li>
-		<li class="item"><a data-href="{:url('/shop/goods/index')}" >商城</a></li>
+		<li class="item"><a data-href="{:url('/shop/goods/index')}" >代拍商城</a></li>
 		<li class="item"><a data-href="{:url('shop/trade/tradelist')}" >全部订单</a></li>
 		<li class="item active"><a data-href="{:url('shop/user/bonuspage')}" >分销中心</a></li>
 		<li class="item"><a data-href="{:url('shop/user/index')}">个人中心</a></li>

+ 9 - 1
application/shop/view/user/index.html

@@ -31,6 +31,9 @@
 		.menulist li{
 			border-bottom: 1px solid #dedede;
 		}
+		.wapper {
+			padding-bottom: 40px;
+		}
 	</style>
 </head>
 <body class="">
@@ -123,6 +126,11 @@
 					<span>绑定信息</span>
 					<span class="am-fr am-link-muted"><i class="am-icon am-icon-angle-right"></i></span>
 				</li>
+				<li onclick="window.location.href='aboutus.html'">
+					<img src="__CDN__/assets/shop/img/icon22.png" class="am-menu-icon" />
+					<span>联系我们</span>
+					<span class="am-fr am-link-muted"><i class="am-icon am-icon-angle-right"></i></span>
+				</li>
 				<li onclick="window.location.href='/shop/order/addresslist.html'">
 					<img src="__CDN__/assets/shop/img/icon10.png" class="am-menu-icon" />
 					<span>地址管理</span>
@@ -139,7 +147,7 @@
 <div id="navbar">
 	<ul id="menu">
 		<li class="item"><a data-href="{:url('shop/index/index')}">首页</a></li>
-		<li class="item"><a data-href="{:url('/shop/goods/index')}" >商城</a></li>
+		<li class="item"><a data-href="{:url('/shop/goods/index')}" >代拍商城</a></li>
 		<li class="item"><a data-href="{:url('shop/trade/tradelist')}" >全部订单</a></li>
 		<li class="item"><a data-href="{:url('shop/user/bonuspage')}" >分销中心</a></li>
 		<li class="item active"><a data-href="{:url('shop/user/index')}">个人中心</a></li>

+ 112 - 0
application/shop/view/user/material.html

@@ -0,0 +1,112 @@
+<!doctype html>
+<html class="no-js">
+<head>
+    <meta charset="utf-8">
+    <meta http-equiv="X-UA-Compatible" content="IE=edge">
+    <meta name="description" content="">
+    <meta name="keywords" content="">
+    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
+    <title>推广素材</title>
+    <!-- Set render engine for 360 browser -->
+    <meta name="renderer" content="webkit">
+    <link rel="stylesheet" href="__CDN__/assets/shop/css/amazeui.css">
+    <link rel="stylesheet" href="__CDN__/assets/shop/css/app.css">
+    <style>
+        .app {
+            font-size: 14px;
+            text-align: left;
+            padding: 64px 15px;
+        }
+        .lists .list-item {
+            border: 1px solid #ccc;
+            border-radius: 2px;
+
+        }
+
+        .action {
+            border-top: 1px solid #ccc;
+            padding: 10px 0;
+            text-align: center;
+        }
+        .action button {
+            background-color: #333;
+            color: #fff;
+            border-radius: 10px;
+            text-align: center;
+            padding: 4px 8px;
+            margin-right: 10px;
+            float: right;
+        }
+    </style>
+</head>
+<body>
+<!-- Header -->
+<header data-am-widget="header" class="am-header am-header-default">
+    <div class="am-header-left am-header-nav">
+        <a href="javascript:void(0);" onclick="javascript:history.back(-1);return false;"><i class="am-header-icon am-icon-angle-left"></i></a>
+    </div>
+    <h1 class="am-header-title">
+        <a href="#title-link">推广素材</a>
+    </h1>
+</header>
+<div class="wapper app">
+    <div class="lists">
+        <div class="list-item">
+            <div class="title">说到底是个单身狗是根深蒂固的三十多个单身狗单身狗单身狗</div>
+            <div class="albums" id="albums-1">
+                <img src="" alt="">
+                <img src="" alt="">
+                <img src="" alt="">
+            </div>
+            <div class="action">
+                <button onclick="copy('afsafs')">复制文案</button>
+                <button onclick="savePics(1)">保存图片</button>
+            </div>
+        </div>
+    </div>
+</div>
+</body>
+<script src="__CDN__/assets/shop/js/jquery.min.js"></script>
+<script src="__CDN__/assets/shop/js/amazeui.min.js"></script>
+<script src="__CDN__/assets/shop/js/app.js"></script>
+<script src="__CDN__/assets/libs/layer/layer.js"></script>
+<script>
+
+    /**
+     * 批量
+     */
+    function savePics(k){
+        var $urls = $("#albums-"+k).find('img');
+        if(urls.length <= 0){
+            layer.msg('暂无素材图片');
+            return false;
+        }
+
+        $urls.each(function(item,k){
+            var url = $(this).attr('src');
+            if(url){
+                doenloadPic(url);
+            }
+        })
+    }
+
+    /**
+     * 下载
+     * @param imgUrl
+     */
+    function doenloadPic(imgUrl){
+        let triggerEvent = "touchstart"; //指定下载方式
+        let blob=new Blob([''], {type:'application/octet-stream'});
+        let url = URL.createObjectURL(blob); //创建一个字符串路径空位
+        let a = document.createElement('a');
+        a.href = imgUrl;  //把路径赋到a标签的href上
+        a.download = imgUrl.replace(/(.*\/)*([^.]+.*)/ig,"$2").split("?")[0];
+        let e = new MouseEvent('click', ( true, false, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null));
+        a.dispatchEvent(e);
+        //释放一个已经存在的路径(有创建createObjectURL就要释放revokeObjectURL)
+        URL.revokeObjectURL(url);
+    }
+</script>
+</html>
+
+

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

@@ -117,7 +117,7 @@
 <div id="navbar">
 	<ul id="menu">
 		<li class="item"><a data-href="{:url('shop/index/index')}">首页</a></li>
-		<li class="item"><a data-href="{:url('/shop/goods/index')}" >商城</a></li>
+		<li class="item"><a data-href="{:url('/shop/goods/index')}" >代拍商城</a></li>
 		<li class="item"><a data-href="{:url('shop/trade/tradelist')}" >全部订单</a></li>
 		<li class="item active"><a data-href="{:url('shop/user/bonuspage')}" >分销中心</a></li>
 		<li class="item "><a data-href="{:url('shop/user/index')}">个人中心</a></li>

+ 3 - 0
application/shop/view/user/sharelink.html

@@ -52,6 +52,9 @@
 						<input type="hidden" class="am-form-field am-radius url-link1" value="{$tjurl}" readonly="readonly" />
 						<input type="button" class="am-btn am-btn-primary am-round copy-btn " onclick="copyUrl1();"  value="复制邀请链接" style="width: 200px;"/>
 					</div>
+					<div class="am-padding-top-sm am-padding-bottom-sm">
+						<input type="button" class="am-btn am-btn-primary am-round copy-btn " onclick="javascript: location='/shop/user/material';"  value="推广素材" style="width: 200px;"/>
+					</div>
 				</div>
 			</div>
 

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

@@ -48,7 +48,7 @@
 	</header>
 	<div class="am-g perBg am-padding-top-xl am-padding-bottom-xl am-text-center">
 		<div class="am-g integral_box am-margin-top">
-			<ul class="am-list am-avg-sm-4 am-text-center am-padding-top-sm am-padding-bottom-sm am-margin-bottom-0 am-text-lg am-text-white">
+			<ul class="am-list am-avg-sm-4 am-text-center am-padding-top-sm am-padding-bottom-sm am-margin-bottom-0 am-text-sm am-text-white">
 				<li>
 					<p>团队人数</p>
 					<p>{$total}</p>