From 5875599c545543fc21e37bb01fe0f2f6fd7028f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9E=97=E4=B8=80=E5=B3=B0?= <1feng.0595@gmail.com> Date: Wed, 6 Jun 2018 00:38:49 +0800 Subject: [PATCH] user --- .../Controllers/Admin/ArticleController.php | 2 -- .../Controllers/Admin/KuaidiController.php | 24 +++++++++---------- .../Controllers/Admin/SlideController.php | 23 +++++++++--------- app/Http/Controllers/Admin/UserController.php | 24 +++++++++---------- .../Admin/UserWithdrawController.php | 24 +++++++++---------- .../Admin/WeixinMenuController.php | 16 +++++++++---- app/Http/Controllers/Api/NotifyController.php | 2 +- app/Http/Logic/ArctypeLogic.php | 8 +++++++ app/Http/Logic/ArticleLogic.php | 9 +++++-- app/Http/Logic/BonusLogic.php | 8 +++++++ app/Http/Logic/CollectGoodsLogic.php | 2 +- app/Http/Logic/SlideLogic.php | 8 +++++++ app/Http/Logic/UserLogic.php | 8 +++++++ app/Http/Logic/UserWithdrawLogic.php | 9 +++++++ .../views/admin/feedback/index.blade.php | 2 +- .../weixin/user/userWithdrawList.blade.php | 2 +- 16 files changed, 110 insertions(+), 61 deletions(-) diff --git a/app/Http/Controllers/Admin/ArticleController.php b/app/Http/Controllers/Admin/ArticleController.php index 484c3fd..beab04c 100644 --- a/app/Http/Controllers/Admin/ArticleController.php +++ b/app/Http/Controllers/Admin/ArticleController.php @@ -1,7 +1,5 @@ $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); } diff --git a/app/Http/Controllers/Admin/SlideController.php b/app/Http/Controllers/Admin/SlideController.php index 4020aa8..fef4036 100644 --- a/app/Http/Controllers/Admin/SlideController.php +++ b/app/Http/Controllers/Admin/SlideController.php @@ -1,8 +1,10 @@ $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); } diff --git a/app/Http/Controllers/Admin/UserController.php b/app/Http/Controllers/Admin/UserController.php index df6521d..7c20f3c 100644 --- a/app/Http/Controllers/Admin/UserController.php +++ b/app/Http/Controllers/Admin/UserController.php @@ -1,10 +1,11 @@ $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); diff --git a/app/Http/Controllers/Admin/UserWithdrawController.php b/app/Http/Controllers/Admin/UserWithdrawController.php index 578417a..d5d0059 100644 --- a/app/Http/Controllers/Admin/UserWithdrawController.php +++ b/app/Http/Controllers/Admin/UserWithdrawController.php @@ -1,10 +1,11 @@ 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); diff --git a/app/Http/Controllers/Admin/WeixinMenuController.php b/app/Http/Controllers/Admin/WeixinMenuController.php index 6c94cfe..0c8d4a5 100644 --- a/app/Http/Controllers/Admin/WeixinMenuController.php +++ b/app/Http/Controllers/Admin/WeixinMenuController.php @@ -1,8 +1,10 @@ -1)); - + $where['is_show'] = -1; + $catlist = $this->getLogic()->getPaginate($where, array('id', 'desc')); + $data['catlist'] = $catlist; return view('admin.WeixinMenu.index', $data); } diff --git a/app/Http/Controllers/Api/NotifyController.php b/app/Http/Controllers/Api/NotifyController.php index 548b7a6..9c3d2f1 100644 --- a/app/Http/Controllers/Api/NotifyController.php +++ b/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); diff --git a/app/Http/Logic/ArctypeLogic.php b/app/Http/Logic/ArctypeLogic.php index 0afb186..be8f9eb 100644 --- a/app/Http/Logic/ArctypeLogic.php +++ b/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; } diff --git a/app/Http/Logic/ArticleLogic.php b/app/Http/Logic/ArticleLogic.php index afbf39f..d91f0bf 100644 --- a/app/Http/Logic/ArticleLogic.php +++ b/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; diff --git a/app/Http/Logic/BonusLogic.php b/app/Http/Logic/BonusLogic.php index e84fd41..25fcbc4 100644 --- a/app/Http/Logic/BonusLogic.php +++ b/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; } diff --git a/app/Http/Logic/CollectGoodsLogic.php b/app/Http/Logic/CollectGoodsLogic.php index 87488de..788edac 100644 --- a/app/Http/Logic/CollectGoodsLogic.php +++ b/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);} diff --git a/app/Http/Logic/SlideLogic.php b/app/Http/Logic/SlideLogic.php index f2a5731..7994a2e 100644 --- a/app/Http/Logic/SlideLogic.php +++ b/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; } diff --git a/app/Http/Logic/UserLogic.php b/app/Http/Logic/UserLogic.php index 71958bb..84ee37e 100644 --- a/app/Http/Logic/UserLogic.php +++ b/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; } diff --git a/app/Http/Logic/UserWithdrawLogic.php b/app/Http/Logic/UserWithdrawLogic.php index 72de749..1e506d0 100644 --- a/app/Http/Logic/UserWithdrawLogic.php +++ b/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; } diff --git a/resources/views/admin/feedback/index.blade.php b/resources/views/admin/feedback/index.blade.php index f0523d3..42231af 100644 --- a/resources/views/admin/feedback/index.blade.php +++ b/resources/views/admin/feedback/index.blade.php @@ -17,7 +17,7 @@ id; ?> title; ?> content; ?> -created_at; ?> +add_time); ?> 删除 diff --git a/resources/views/weixin/user/userWithdrawList.blade.php b/resources/views/weixin/user/userWithdrawList.blade.php index 3162a54..308e22d 100644 --- a/resources/views/weixin/user/userWithdrawList.blade.php +++ b/resources/views/weixin/user/userWithdrawList.blade.php @@ -24,7 +24,7 @@
  • -

    提现

    -

    收款账号: ,提现方式: ,姓名:
    状态:

    +

    收款账号:
    姓名:
    提现方式:
    状态: