['order_sn', 'uid', 'project_id', 'order_type', 'status', 'paid', 'pay_time', 'customer_name', 'phone'], ]; } /** * @notes 获取列表 * @return array * @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\DbException * @throws \think\db\exception\ModelNotFoundException * @author likeadmin * @date 2025/07/17 17:16 */ public function lists(): array { return Order::where($this->searchWhere) ->with(['project']) ->field(['id', 'order_sn', 'uid', 'project_id', 'order_type', 'total_amount', 'pay_amount', 'status', 'paid', 'pay_time', 'customer_name', 'phone', 'address', 'delivery_time', 'create_time']) ->limit($this->limitOffset, $this->limitLength) ->order(['id' => 'desc']) ->select() ->each(function ($item) { $item['status_text'] = $item->statusText; $item['pay_status_text'] = $item->payStatusText; $item['order_type_text'] = $item->orderTypeText; }) ->toArray(); } /** * @notes 获取数量 * @return int * @author likeadmin * @date 2025/07/17 17:16 */ public function count(): int { return Order::where($this->searchWhere)->count(); } }