优化物流公司

This commit is contained in:
evoxwht 2023-06-28 17:46:35 +08:00
parent 73da9941cc
commit ebd33098f0
3 changed files with 5 additions and 5 deletions

View File

@ -43,7 +43,8 @@ class Express extends AuthController
public function index()
{
$where = $this->request->getMore([
['keyword', '']
['keyword', ''],
['is_show', '']
]);
return app('json')->success($this->services->getExpressList($where));
}

View File

@ -42,7 +42,7 @@ class ExpressDao extends BaseDao
*/
public function getExpressList(array $where, string $field, int $page, int $limit)
{
return $this->search($where)->field($field)->order('sort DESC,id DESC')
return $this->search($where)->field($field)->order('sort DESC,is_show DESC')
->when($page > 0 && $limit > 0, function ($query) use ($page, $limit) {
$query->page($page, $limit);
})->select()->toArray();

View File

@ -41,11 +41,10 @@ class Express extends BaseModel
* 物流公司是否显示
* @param Model $query
* @param $value
* @param $data
*/
public function searchIsShowAttr($query, $value, $data)
public function searchIsShowAttr($query, $value)
{
$query->where('is_show', $value);
if ($value !== '') $query->where('is_show', $value);
}
/**