优化:多提货点模式 - 只有一个提货点时 直接默认选中
This commit is contained in:
parent
60f58e2e9c
commit
3e1eafbe90
|
|
@ -89,7 +89,8 @@ class PointRepository extends BaseRepository{
|
|||
*/
|
||||
public function getUseInfo(int $useId = 0):array{
|
||||
$list = $this->getSearchModel([])->withoutField('create_time,update_time')->select()->toArray();
|
||||
$config = $useId > 0 ? (array_column($list, null, 'id')[$useId] ?? []) : [];
|
||||
if(count($list) == 1) $config = $list[0] ?? [];
|
||||
else $config = $useId > 0 ? (array_column($list, null, 'id')[$useId] ?? []) : [];
|
||||
|
||||
return compact('list', 'config');
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue