更新数组

This commit is contained in:
mkm 2023-08-01 14:51:11 +08:00
parent 5de2b425cd
commit 09a53cc867
2 changed files with 28 additions and 1 deletions

View File

@ -56,7 +56,6 @@ class CategoryBusinessLists extends BaseAdminDataLists implements ListsSearchInt
{
$lists=CategoryBusiness::where($this->searchWhere)
->field(['id', 'name', 'pid', 'sort', 'status'])
->limit($this->limitOffset, $this->limitLength)
->order(['id' => 'desc'])
->select()
->toArray();

View File

@ -0,0 +1,28 @@
<?php
namespace app\api\controller;
use app\common\model\category_business\CategoryBusiness;
/**
* 商机分类
* Class SmsController
* @package app\api\controller
*/
class CategoryBusinessController extends BaseApiController
{
public array $notNeedLogin = ['list'];
/**
*/
public function list()
{
$lists = CategoryBusiness::field(['id', 'name', 'pid', 'sort', 'status'])
->order(['id' => 'desc'])
->select()
->toArray();
return $this->success('操作成功',linear_to_tree($lists, 'children'));
}
}