params['work_id'])){ $rechargeOrder = RechargeOrder::with(['orderGoods'])->where('work_id',$this->params['work_id'])->where('payment_type','IN',[0,1])->find()->toArray(); $this->params['goods_id'] = $rechargeOrder['orderGoods'][0]['goods_id']??0; } return [ '=' => ['goods_id'], ]; } /* * 查询条件 * @return array * @author liuguanci * @date 2024/7/11 下午1:46 */ public function queryWhere(){ $where = []; return $where; } /** * @notes 获取列表 * @return array * @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\DbException * @throws \think\db\exception\ModelNotFoundException * @author likeadmin * @date 2024/09/14 15:08 */ public function lists(): array { return GoodsFeeStandards::where($this->queryWhere())->where($this->searchWhere) ->field(['*']) ->append(['type_text']) ->select()->toArray(); /*return array_values(array_reduce($data, function ($carry, $item) { $type = $item['type']; if (!isset($carry[$type])) { $carry[$type] = [ 'type' => $type, 'type_text'=>$item['type_text'], 'type_data'=>[], ]; } $carry[$type]['type_data'][] = $item; return $carry; }, []));*/ } /** * @notes 获取数量 * @return int * @author likeadmin * @date 2024/09/14 15:08 */ public function count(): int { return GoodsFeeStandards::where($this->queryWhere())->where($this->searchWhere)->count(); } }