market_user_1124

This commit is contained in:
dengbw
2022-11-24 09:51:16 +08:00
parent 4f392cb38d
commit f907c6d1a9
3 changed files with 17 additions and 23 deletions
+7
View File
@@ -97,6 +97,13 @@ class Draw extends CI_Controller
if (!$winNum) {
$this->show_json(400, '请选择中奖人数');
}
$re = $this->mdSyliveActivity->get(['activityId' => $activityId]);
if (!$re) {
$this->show_json(400, '暂无活动');
}
if (date('Y-m-d H:i:s') > $re['timeEnd']) {
$this->show_json(400, '直播已结束,不能开始抽奖');
}
$winTypeAry = $this->mdSyliveOrder->winTypeAry($activityId);
$price = $winTypeAry[$winType]['price'];
$limit = $winNum >= 50 ? 100 : 50;
+5 -11
View File
@@ -34,11 +34,7 @@ class TeamUser extends BaseController
!$limit && $limit = 10;
$sort_order = 'userId desc';
if ($sort && $order) {
if ($sort == 'sexName') {
$sort_order = 'sex ' . $order;
} else {
$sort_order = $sort . ' ' . $order;
}
$sort_order = $sort . ' ' . $order;
}
$list = [];
$where['status>='] = 0;
@@ -49,11 +45,11 @@ class TeamUser extends BaseController
if ($count) {
$res = $this->mdSyliveUser->select($where, $sort_order, $page, $limit);
foreach ($res as $v) {
$sexName = $this->mdSyliveUser->sexAry($v['sex']);
$status = intval($v['status']);
$createTime = $v['createTime'] != '0000-00-00 00:00:00' ? $v['createTime'] : '';
$list[] = [
'userId' => $v['userId'], 'uname' => $v['uname'], 'nickname' => $v['nickname'], 'mobile' => $v['mobile']
, 'teamId' => $teamId, 'status' => $status, 'sex' => $v['sex'], 'sexName' => $sexName, 'createTime' => $v['createTime']];
, 'teamId' => $teamId, 'status' => $status, 'createTime' => $createTime];
}
}
$date = ['list' => $list, 'count' => $count];
@@ -69,7 +65,6 @@ class TeamUser extends BaseController
{
$mobile = $this->input_param('mobile');
$teamId = intval($this->input_param('teamId'));
$sex = intval($this->input_param('sex'));
$uname = $this->input_param('uname');
if (!$mobile) {
$this->return_json('请输入手机号');
@@ -86,7 +81,7 @@ class TeamUser extends BaseController
$this->return_json('手机号已存在');
}
}
$addDate = ['teamId' => $teamId, 'sex' => $sex, 'uname' => $uname, 'status' => 0, 'organizationId' => 0];
$addDate = ['teamId' => $teamId, 'uname' => $uname, 'status' => 0, 'organizationId' => 0];
if ($re['userId']) {
$this->mdSyliveUser->update($addDate, ['userId' => $re['userId']]);
$this->return_response([], '绑定用户成功');
@@ -110,7 +105,6 @@ class TeamUser extends BaseController
{
$userId = intval($this->input_param('userId'));
$teamId = intval($this->input_param('teamId'));
$sex = intval($this->input_param('sex'));
$uname = $this->input_param('uname');
if (!$userId) {
$this->return_json('参数错误');
@@ -121,7 +115,7 @@ class TeamUser extends BaseController
if (!$uname) {
$this->return_json('请输入姓名');
}
$upDate = ['teamId' => $teamId, 'sex' => $sex, 'uname' => $uname];
$upDate = ['teamId' => $teamId, 'uname' => $uname];
$this->mdSyliveUser->update($upDate, ['userId' => $userId]);
$this->return_response();
}
+5 -12
View File
@@ -34,11 +34,7 @@ class User extends BaseController
!$limit && $limit = 10;
$sort_order = 'userId desc';
if ($sort && $order) {
if ($sort == 'sexName') {
$sort_order = 'sex ' . $order;
} else {
$sort_order = $sort . ' ' . $order;
}
$sort_order = $sort . ' ' . $order;
}
$list = [];
$where['status>='] = 0;
@@ -54,12 +50,11 @@ class User extends BaseController
if ($count) {
$res = $this->mdSyliveUser->select($where, $sort_order, $page, $limit);
foreach ($res as $v) {
$sexName = $this->mdSyliveUser->sexAry($v['sex']);
$status = intval($v['status']);
$createTime = $v['createTime'] != '0000-00-00 00:00:00' ? $v['createTime'] : '';
$list[] = [
'userId' => $v['userId'], 'uname' => $v['uname'], 'nickname' => $v['nickname'], 'mobile' => $v['mobile']
, 'roleName' => $roleName, 'organizationId' => $organizationId, 'status' => $status
, 'sex' => $v['sex'], 'sexName' => $sexName, 'createTime' => $v['createTime']];
, 'roleName' => $roleName, 'organizationId' => $organizationId, 'status' => $status, 'createTime' => $createTime];
}
}
$date = ['list' => $list, 'count' => $count];
@@ -75,7 +70,6 @@ class User extends BaseController
{
$mobile = $this->input_param('mobile');
$organizationId = intval($this->input_param('organizationId'));
$sex = intval($this->input_param('sex'));
$uname = $this->input_param('uname');
if (!$mobile) {
$this->return_json('请输入手机号');
@@ -92,7 +86,7 @@ class User extends BaseController
$this->return_json('手机号已存在');
}
}
$addDate = ['organizationId' => $organizationId, 'sex' => $sex, 'uname' => $uname, 'status' => 0, 'teamId' => 0];
$addDate = ['organizationId' => $organizationId, 'uname' => $uname, 'status' => 0, 'teamId' => 0];
if ($re['userId']) {
$this->mdSyliveUser->update($addDate, ['userId' => $re['userId']]);
$this->return_response([], '绑定用户成功');
@@ -116,7 +110,6 @@ class User extends BaseController
{
$userId = intval($this->input_param('userId'));
$organizationId = intval($this->input_param('organizationId'));
$sex = intval($this->input_param('sex'));
$uname = $this->input_param('uname');
if (!$userId) {
$this->return_json('参数错误');
@@ -127,7 +120,7 @@ class User extends BaseController
if (!$uname) {
$this->return_json('请输入姓名');
}
$upDate = ['organizationId' => $organizationId, 'sex' => $sex, 'uname' => $uname];
$upDate = ['organizationId' => $organizationId, 'uname' => $uname];
$this->mdSyliveUser->update($upDate, ['userId' => $userId]);
$this->return_response();
}