Browse Source

user

master
林一峰 7 years ago
parent
commit
5875599c54
  1. 2
      app/Http/Controllers/Admin/ArticleController.php
  2. 24
      app/Http/Controllers/Admin/KuaidiController.php
  3. 23
      app/Http/Controllers/Admin/SlideController.php
  4. 24
      app/Http/Controllers/Admin/UserController.php
  5. 24
      app/Http/Controllers/Admin/UserWithdrawController.php
  6. 16
      app/Http/Controllers/Admin/WeixinMenuController.php
  7. 2
      app/Http/Controllers/Api/NotifyController.php
  8. 8
      app/Http/Logic/ArctypeLogic.php
  9. 9
      app/Http/Logic/ArticleLogic.php
  10. 8
      app/Http/Logic/BonusLogic.php
  11. 2
      app/Http/Logic/CollectGoodsLogic.php
  12. 8
      app/Http/Logic/SlideLogic.php
  13. 8
      app/Http/Logic/UserLogic.php
  14. 9
      app/Http/Logic/UserWithdrawLogic.php
  15. 2
      resources/views/admin/feedback/index.blade.php
  16. 2
      resources/views/weixin/user/userWithdrawList.blade.php

2
app/Http/Controllers/Admin/ArticleController.php

@ -1,7 +1,5 @@
<?php
namespace App\Http\Controllers\Admin;
use App\Http\Controllers\Admin\CommonController;
use DB;
use App\Common\ReturnData;
use Illuminate\Http\Request;

24
app/Http/Controllers/Admin/KuaidiController.php

@ -1,10 +1,11 @@
<?php
namespace App\Http\Controllers\Admin;
use App\Http\Controllers\Admin\CommonController;
use DB;
use App\Http\Model\Kuaidi;
use App\Common\ReturnData;
use App\Common\Helper;
use Illuminate\Http\Request;
use App\Http\Logic\KuaidiLogic;
use App\Http\Model\Kuaidi;
class KuaidiController extends CommonController
{
@ -13,18 +14,17 @@ class KuaidiController extends CommonController
parent::__construct();
}
public function getLogic()
{
return new KuaidiLogic();
}
public function index()
{
$data['posts'] = parent::pageList('kuaidi', '', [['status', 'asc'], ['listorder', 'asc']]);
if($data['posts'])
{
foreach($data['posts'] as $k=>$v)
{
$data['posts'][$k]->status_text = Kuaidi::getStatusText(array('status'=>$v->status));
}
}
$where = '';
$posts = $this->getLogic()->getPaginate($where, [['status', 'asc'], ['listorder', 'asc']]);
$data['posts'] = $posts;
return view('admin.kuaidi.index', $data);
}

23
app/Http/Controllers/Admin/SlideController.php

@ -1,8 +1,10 @@
<?php
namespace App\Http\Controllers\Admin;
use App\Http\Controllers\Admin\CommonController;
use DB;
use App\Common\ReturnData;
use App\Common\Helper;
use Illuminate\Http\Request;
use App\Http\Logic\SlideLogic;
use App\Http\Model\Slide;
class SlideController extends CommonController
@ -12,18 +14,17 @@ class SlideController extends CommonController
parent::__construct();
}
public function getLogic()
{
return new SlideLogic();
}
public function index()
{
$data['posts'] = parent::pageList('slide', '', [['is_show', 'asc'], ['listorder', 'asc']]);
if($data['posts'])
{
foreach($data['posts'] as $k=>$v)
{
$data['posts'][$k]->type_text = Slide::getTypeText(array('type'=>$v->type));
}
}
$where = '';
$posts = $this->getLogic()->getPaginate($where, array('id', 'desc'));
$data['posts'] = $posts;
return view('admin.slide.index', $data);
}

24
app/Http/Controllers/Admin/UserController.php

@ -1,10 +1,11 @@
<?php
namespace App\Http\Controllers\Admin;
use App\Http\Controllers\Admin\CommonController;
use DB;
use App\Http\Model\User;
use App\Common\ReturnData;
use App\Common\Helper;
use Illuminate\Http\Request;
use App\Http\Logic\UserLogic;
use App\Http\Model\User;
class UserController extends CommonController
{
@ -13,18 +14,15 @@ class UserController extends CommonController
parent::__construct();
}
public function getLogic()
{
return new UserLogic();
}
public function index()
{
$posts = parent::pageList('user');
if($posts)
{
foreach($posts as $k=>$v)
{
$posts[$k]->sex_text = User::getSexText(['sex'=>$v->sex]);
$posts[$k]->status_text = User::getStatusText(['status'=>$v->status]);
}
}
$where = '';
$posts = $this->getLogic()->getPaginate($where, array('id', 'desc'));
$data['posts'] = $posts;
return view('admin.user.index', $data);

24
app/Http/Controllers/Admin/UserWithdrawController.php

@ -1,10 +1,11 @@
<?php
namespace App\Http\Controllers\Admin;
use App\Http\Controllers\Admin\CommonController;
use DB;
use App\Http\Model\UserWithdraw;
use App\Common\ReturnData;
use App\Common\Helper;
use Illuminate\Http\Request;
use App\Http\Logic\UserWithdrawLogic;
use App\Http\Model\UserWithdraw;
class UserWithdrawController extends CommonController
{
@ -13,18 +14,15 @@ class UserWithdrawController extends CommonController
parent::__construct();
}
public function getLogic()
{
return new UserWithdrawLogic();
}
public function index()
{
$posts = parent::pageList('user_withdraw',array('is_delete'=>0));
if($posts)
{
foreach($posts as $k=>$v)
{
$posts[$k]->user = DB::table('user')->where('id', $v->user_id)->first();
$posts[$k]->status_text = UserWithdraw::getStatusText(['status'=>$v->status]);
}
}
$where['delete_time'] = 0;
$posts = $this->getLogic()->getPaginate($where, array('id', 'desc'));
$data['posts'] = $posts;
return view('admin.UserWithdraw.index', $data);

16
app/Http/Controllers/Admin/WeixinMenuController.php

@ -1,8 +1,10 @@
<?php
namespace App\Http\Controllers\Admin;
use App\Http\Controllers\Admin\CommonController;
use DB;
use App\Common\ReturnData;
use App\Common\Helper;
use Illuminate\Http\Request;
use App\Http\Logic\WeixinMenuLogic;
use App\Http\Model\WeixinMenu;
use App\Common\WechatMenu;
@ -13,10 +15,16 @@ class WeixinMenuController extends CommonController
parent::__construct();
}
public function getLogic()
{
return new WeixinMenuLogic();
}
public function index()
{
$catlist = WeixinMenu::getList(array('is_show'=>-1));
$where['is_show'] = -1;
$catlist = $this->getLogic()->getPaginate($where, array('id', 'desc'));
$data['catlist'] = $catlist;
return view('admin.WeixinMenu.index', $data);
}

2
app/Http/Controllers/Api/NotifyController.php

@ -76,7 +76,7 @@ class NotifyController extends CommonController
$order_update_data['pay_id'] = 2;
$order_update_data['pay_time'] = $pay_time_timestamp;
$order_update_data['pay_name'] = 'wxpay_jsapi';
$order_update_data['out_trade_no'] = $post_data['transaction_id'];
$order_update_data['trade_no'] = $post_data['transaction_id'];
$order_update_data['updated_at'] = time();
DB::table('order')->where(array('order_sn'=>$post_data['out_trade_no'],'order_status'=>0,'pay_status'=>0))->update($order_update_data);

8
app/Http/Logic/ArctypeLogic.php

@ -45,6 +45,14 @@ class ArctypeLogic extends BaseLogic
{
$res = $this->getModel()->getPaginate($where, $order, $field, $limit);
if($res->count() > 0)
{
foreach($res as $k=>$v)
{
$res[$k] = $this->getDataView($v);
}
}
return $res;
}

9
app/Http/Logic/ArticleLogic.php

@ -45,9 +45,14 @@ class ArticleLogic extends BaseLogic
public function getPaginate($where = array(), $order = '', $field = '*', $limit = '')
{
$res = $this->getModel()->getPaginate($where, $order, $field, $limit);
foreach($res as $k=>$v)
if($res->count() > 0)
{
$res[$k]->typename = $this->getModel()->getTypenameAttr(array('typeid'=>$v->typeid));
foreach($res as $k=>$v)
{
$res[$k] = $this->getDataView($v);
$res[$k]->typename = $this->getModel()->getTypenameAttr(array('typeid'=>$v->typeid));
}
}
return $res;

8
app/Http/Logic/BonusLogic.php

@ -46,6 +46,14 @@ class BonusLogic extends BaseLogic
{
$res = $this->getModel()->getPaginate($where, $order, $field, $limit);
if($res->count() > 0)
{
foreach($res as $k=>$v)
{
$res[$k] = $this->getDataView($v);
}
}
return $res;
}

2
app/Http/Logic/CollectGoodsLogic.php

@ -88,7 +88,7 @@ class CollectGoodsLogic extends BaseLogic
$validator = $this->getValidate($data, 'add');
if ($validator->fails()){return ReturnData::create(ReturnData::PARAMS_ERROR, null, $validator->errors()->first());}
if($this->getModel()->getOne(array('user_id'=>$data['user_id'],'goods_id'=>$data['goods_id']))){return '亲,您已经收藏啦!';}
if($this->getModel()->getOne(array('user_id'=>$data['user_id'],'goods_id'=>$data['goods_id']))){return ReturnData::create(ReturnData::FAIL,null,'亲,您已经收藏啦!');}
$res = $this->getModel()->add($data,$type);
if($res){return ReturnData::create(ReturnData::SUCCESS,$res);}

8
app/Http/Logic/SlideLogic.php

@ -45,6 +45,14 @@ class SlideLogic extends BaseLogic
{
$res = $this->getModel()->getPaginate($where, $order, $field, $limit);
if($res->count() > 0)
{
foreach($res as $k=>$v)
{
$res[$k] = $this->getDataView($v);
}
}
return $res;
}

8
app/Http/Logic/UserLogic.php

@ -51,6 +51,14 @@ class UserLogic extends BaseLogic
{
$res = $this->getModel()->getPaginate($where, $order, $field, $limit);
if($res->count() > 0)
{
foreach($res as $k=>$v)
{
$res[$k] = $this->getDataView($v);
}
}
return $res;
}

9
app/Http/Logic/UserWithdrawLogic.php

@ -47,6 +47,15 @@ class UserWithdrawLogic extends BaseLogic
{
$res = $this->getModel()->getPaginate($where, $order, $field, $limit);
if($res->count() > 0)
{
foreach($res as $k=>$v)
{
$res[$k] = $this->getDataView($v);
$res[$k]->user = model('User')->getOne(['id'=>$v->user_id]);
}
}
return $res;
}

2
resources/views/admin/feedback/index.blade.php

@ -17,7 +17,7 @@
<td><?php echo $row->id; ?></td>
<td><?php echo $row->title; ?></td>
<td><?php echo $row->content; ?></td>
<td><?php echo $row->created_at; ?></td>
<td><?php echo date('Y-m-d H:i:s', $row->add_time); ?></td>
<td><a onclick="delconfirm('<?php echo route('admin_feedback_del',array('id'=>$row->id)); ?>')" href="javascript:;">删除</a></td>
</tr><?php }} ?>
</tbody></table></div><!-- 表格结束 --></form><!-- 表单结束 -->

2
resources/views/weixin/user/userWithdrawList.blade.php

@ -24,7 +24,7 @@
<li>
<span class="green">- <?php echo $v['money']; ?></span>
<div class="info"><p class="tit">提现</p>
<p class="des">收款账号:<?php echo $v['name']; ?> ,提现方式:<?php echo $v['method']; ?> ,姓名:<?php echo $v['name']; ?><br>状态:<font color="red"><?php echo $v['status_text']; ?></font></p>
<p class="des">收款账号:<?php echo $v['name']; ?><br/>姓名:<?php echo $v['name']; ?><br/>提现方式:<?php echo $v['method']; ?><br>状态:<font color="red"><?php echo $v['status_text']; ?></font></p>
<p class="time"><?php echo date('Y-m-d H:i:s',$v['add_time']); ?></p></div>
</li>
<?php } ?>

Loading…
Cancel
Save