$list=Db::name("storage_name")
->alias('a')
->join('storage b','a.name=b.storage_name')
->field(['a.id,a.name,sum(b.number) as count'])
->group('a.name')
->paginate(15);
alias is equivalent to as in sql
The filed here can be spelled directly using the sql statement
group grouping
pageinate pagination.