标签:cti als class select his ali groupby where sel
from($this->getInfo())->where(‘$v["is_enable"]==1‘)->where(function (&$v) use ($arr, $keys) { if (in_array($v[‘name‘], $keys)) { //排序字段--按照 传递过来的数组参数排序... $v[‘v_sort‘] = array_keys($keys, $v[‘name‘])[0]; $v[‘text‘] = $v[‘value‘] . $arr[$v[‘name‘]]; return true; } return false; })->select(function ($v) { return [‘id‘ => $v[‘id‘], ‘value‘ => $v[‘value‘], ‘name‘ => $v[‘name‘], ‘remark‘ => $v[‘remark‘], ‘text‘ => $v[‘text‘], ‘v_sort‘ => $v[‘v_sort‘]]; })->orderBy(‘$v["v_sort"]‘)->toList();
$shopList = from($shopList)->groupBy(function (&$k) { //这个 k 变量,是当前循环的数组对象!!! 相当于 foreach 里的的那个 $v.. return $k[‘shop_id‘]; })->toList();
标签:cti als class select his ali groupby where sel
原文地址:https://www.cnblogs.com/whm-blog/p/9007264.html