|
|
|
@ -41,7 +41,49 @@ class OrderRefund extends OrderRefundModel |
|
|
|
|
// if(!UserService::isStore()) { |
|
|
|
|
// $filter[] = ['user.user_id' ,'=', UserService::getCurrentLoginUserId() ]; |
|
|
|
|
// } |
|
|
|
|
$filterOr = [];Ne |
|
|
|
|
$filterOr = []; |
|
|
|
|
if (!empty($param['searchValue']) && $param['searchType'] == 'all') { |
|
|
|
|
// $filterOr = [ |
|
|
|
|
// ['order.order_no', 'like', "%{$param['searchValue']}%"], |
|
|
|
|
// ['user.nick_name', 'like', "%{$param['searchValue']}%"], |
|
|
|
|
// ['order.user_id', '=', (int)$param['searchValue']] |
|
|
|
|
// ]; |
|
|
|
|
|
|
|
|
|
$filterOr = [ |
|
|
|
|
['order.order_no|user.nick_name|order.user_id', 'like', "%{$param['searchValue']}%"] |
|
|
|
|
]; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 获取列表数据 |
|
|
|
|
$query = $this->alias('refund') |
|
|
|
|
->field('refund.*, order.order_no') |
|
|
|
|
->join('order', 'order.order_id = refund.order_id') |
|
|
|
|
->join('user', 'user.user_id = order.user_id') |
|
|
|
|
->where($filter); |
|
|
|
|
if(!empty($filterOr)){ |
|
|
|
|
// $query = $query->whereOr($filterOr); |
|
|
|
|
$query = $query->where($filterOr); |
|
|
|
|
} |
|
|
|
|
$list = $query->order(['refund.create_time' => 'desc', 'refund.' . $this->getPk()]) |
|
|
|
|
->paginate(10); |
|
|
|
|
// 加载关联订单数据 |
|
|
|
|
return static::preload($list, ['orderGoods.image', 'orderData', 'user.avatar']); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 获取售后单列表 |
|
|
|
|
* @param array $param |
|
|
|
|
* @return iterable|\think\model\Collection|\think\Paginator |
|
|
|
|
*/ |
|
|
|
|
public function getNewList(array $param = []) |
|
|
|
|
{ |
|
|
|
|
// 检索查询条件 |
|
|
|
|
$filter = $this->getFilter($param); |
|
|
|
|
//不是店长查询当前用户订单 |
|
|
|
|
if(!UserService::isStore()) { |
|
|
|
|
$filter[] = ['user.user_id' ,'=', UserService::getCurrentLoginUserId() ]; |
|
|
|
|
} |
|
|
|
|
$filterOr = []; |
|
|
|
|
if (!empty($param['searchValue']) && $param['searchType'] == 'all') { |
|
|
|
|
// $filterOr = [ |
|
|
|
|
// ['order.order_no', 'like', "%{$param['searchValue']}%"], |
|
|
|
|