更新数据维护和查询等功能,适配CIS数据表实体表善事查询。
This commit is contained in:
@@ -58,7 +58,7 @@ class PdmSymbol extends AdminController
|
||||
* @throws DbException
|
||||
* @throws ModelNotFoundException
|
||||
*/
|
||||
public function dataList(array $params): array // static 限定后, $this-> 不可用。
|
||||
public static function dataList(array $params): array // static 限定后, $this-> 不可用。
|
||||
{
|
||||
// $where = array();
|
||||
// if (!empty($params['status'])) {
|
||||
@@ -71,14 +71,16 @@ class PdmSymbol extends AdminController
|
||||
// $count = $this->model->where($where)->count();
|
||||
// $list = $this->model->where($where)->order('sort asc')->select()->toArray();
|
||||
|
||||
$where = $this->buildSelectParams();
|
||||
$count = $this->model->where($where)->count();
|
||||
$fieldList = $this->model->getFields();
|
||||
$controller = new PdmSymbol();
|
||||
|
||||
$where = $controller->buildSelectParams();
|
||||
$count = $controller->model->where($where)->count();
|
||||
$fieldList = $controller->model->getFields();
|
||||
$order = !array_key_exists('sort', $fieldList) ? 'id' : 'sort';
|
||||
$subQuery = $this->model->field('id')->where($where)->order($order, 'asc')->buildSql();
|
||||
$subQuery = $controller->model->field('id')->where($where)->order($order, 'asc')->buildSql();
|
||||
$subQuery = '( SELECT object.id FROM ' . $subQuery . ' AS object )';
|
||||
// $list = $this->model->with($this->relationModel)->where('id in' . $subQuery)->order($order, 'asc')->select()->toArray(); // 如果是'desc' list_to_tree 函数返回为空!
|
||||
$list = $this->model->with($this->relationModel)->where('id in' . $subQuery)->order($order, 'asc')->select(); // 如果是'desc' list_to_tree 函数返回为空!
|
||||
$list = $controller->model->with($controller->relationModel)->where('id in' . $subQuery)->order($order, 'asc')->select(); // 如果是'desc' list_to_tree 函数返回为空!
|
||||
|
||||
foreach($list as $key => $value){
|
||||
// throw new \Exception(json_encode($value));
|
||||
@@ -98,9 +100,9 @@ class PdmSymbol extends AdminController
|
||||
foreach($list as $key => $value){
|
||||
if(!in_array($value['pid'],$nodeid) && $value['pid'] > 0){
|
||||
$nodeid[] = $value['pid'];
|
||||
$nodevalue = $this->model->find($value['pid']);
|
||||
$nodevalue = $controller->model->find($value['pid']);
|
||||
// throw new \Exception(json_encode($nodevalue));
|
||||
$nodevalue = $this->model->find($value['pid'])->toArray();
|
||||
$nodevalue = $controller->model->find($value['pid'])->toArray();
|
||||
// throw new \Exception(json_encode($nodevalue));
|
||||
// throw new \Exception(json_encode($list));
|
||||
if(!empty($nodevalue)){
|
||||
|
||||
Reference in New Issue
Block a user