数据优化

This commit is contained in:
devil_gong 2019-01-10 11:32:15 +08:00
parent 6b6066be3f
commit 712bda53f4
7 changed files with 29 additions and 10 deletions

View File

@ -49,6 +49,7 @@ class Message extends Common
// 参数
$params = $this->data_post;
$params['user'] = $this->user;
$params['user_type'] = 'user';
// 消息更新未已读
MessageService::MessageRead($params);

View File

@ -50,6 +50,7 @@ class Order extends Common
// 参数
$params = $this->data_post;
$params['user'] = $this->user;
$params['user_type'] = 'user';
// 分页
$number = 10;

View File

@ -50,6 +50,7 @@ class UserIntegral extends Common
// 参数
$params = $this->data_post;
$params['user'] = $this->user;
$params['user_type'] = 'user';
// 分页
$number = 10;

View File

@ -50,6 +50,7 @@ class UserIntegral extends Common
// 参数
$params = input();
$params['user'] = $this->user;
$params['user_type'] = 'user';
// 分页
$number = 10;

View File

@ -69,12 +69,20 @@ class IntegralService
*/
public static function UserIntegralLogListWhere($params = [])
{
// 用户类型
$user_type = isset($params['user_type']) ? $params['user_type'] : 'user';
// 条件初始化
$where = [];
// 用户id
if(!empty($params['user']))
// 用户类型
if(isset($params['user_type']) && $params['user_type'] == 'user')
{
$where[] = ['user_id', '=', $params['user']['id']];
// 用户id
if(!empty($params['user']))
{
$where[] = ['user_id', '=', $params['user']['id']];
}
}
if(!empty($params['keywords']))

View File

@ -62,6 +62,10 @@ class MessageService
*/
public static function MessageListWhere($params = [])
{
// 用户类型
$user_type = isset($params['user_type']) ? $params['user_type'] : 'user';
// 条件初始化
$where = [
['is_delete_time', '=', 0],
];
@ -75,8 +79,6 @@ class MessageService
// 用户类型
if(isset($params['user_type']) && $params['user_type'] == 'user')
{
$where[] = ['user_is_delete_time', '=', 0];
// 用户id
if(!empty($params['user']))
{

View File

@ -452,7 +452,6 @@ class OrderService
// 条件初始化
$where = [
['is_delete_time', '=', 0],
['user_is_delete_time', '=', 0],
];
// id
@ -460,11 +459,17 @@ class OrderService
{
$where[] = ['id', '=', intval($params['id'])];
}
// 用户id
if(!empty($params['user']))
// 用户类型
if(isset($params['user_type']) && $params['user_type'] == 'user')
{
$where[] = ['user_id', '=', $params['user']['id']];
$where[] = ['user_is_delete_time', '=', 0];
// 用户id
if(!empty($params['user']))
{
$where[] = ['user_id', '=', $params['user']['id']];
}
}
if(!empty($params['keywords']))