|
@@ -11,6 +11,7 @@
|
|
|
|
|
|
namespace app\love\controller;
|
|
|
|
|
|
+use app\common\Fun;
|
|
|
use app\love\model\ActiveApplyModel;
|
|
|
use app\love\model\ActiveModel;
|
|
|
use cmf\controller\AdminBaseController;
|
|
@@ -118,15 +119,26 @@ class AdminActiveController extends AdminBaseController
|
|
|
$param = $this->request->param();
|
|
|
$this->assign('id', $param['id']);
|
|
|
$this->assign('check_status', $param['check_status'] ?? 0);
|
|
|
+ $this->assign('sex', $param['sex'] ?? 0);
|
|
|
|
|
|
$where = [
|
|
|
['active_id', '=', $param['id']],
|
|
|
];
|
|
|
if (!empty($param['check_status'])) {
|
|
|
- $where[] = ['check_status', '=', $param['check_status']];
|
|
|
+ $where[] = ['cmf_active_apply.check_status', '=', $param['check_status']];
|
|
|
}
|
|
|
- $list = ActiveApplyModel::with('user')->where($where)->order('check_status asc')->paginate(10);
|
|
|
+ $sexWhere = [];
|
|
|
+ if (!empty($param['sex'])) {
|
|
|
+ $sexWhere = ['sex'=>$param['sex']];
|
|
|
+ }
|
|
|
+ $total = ActiveApplyModel::hasWhere('user',$sexWhere)->where($where)->count();
|
|
|
+ $this->assign('total', $total);
|
|
|
|
|
|
+ $list = ActiveApplyModel::hasWhere('user',$sexWhere)->with('user')->where($where)->order('check_status asc')->paginate(10);
|
|
|
+ foreach ($list as $v) {
|
|
|
+ $v['age'] = Fun::getAgeByBirth($v['user']['birthday']);
|
|
|
+ }
|
|
|
+ \think\facade\Log::record('sql为:'.ActiveApplyModel::getLastSql());
|
|
|
$page = $list->render();
|
|
|
$this->assign('list', $list);
|
|
|
$this->assign('page', $page);
|