hasMany('app\\common\\model\\order\\Order', 'order_id', 'order_id'); } /** * 详情 */ public static function detail($where, $with = []) { is_array($where) ? $filter = $where : $filter['id'] = (int)$where; return (new static())->with($with)->where($filter)->find(); } /** * 详情 */ public static function detailWithOrder($where) { $list = (new static())->where($where)->select(); $orderList = []; foreach ($list as $trade){ array_push($orderList, Order::detail($trade['order_id'])); } return $orderList; } }